DGtal
0.6.devel
|
#include <InputIteratorWithRankOnSequence.h>
Public Types | |
typedef TSequence | Sequence |
typedef TRank | Rank |
typedef InputIteratorWithRankOnSequence < Sequence, Rank > | Self |
typedef Sequence::value_type | SequenceValue |
typedef std::pair < SequenceValue, Rank > | Value |
typedef Sequence::const_iterator | ConstIterator |
typedef const Value * | Pointer |
typedef Value | value_type |
typedef Sequence::size_type | size_type |
typedef Sequence::difference_type | difference_type |
typedef Pointer | pointer |
typedef const value_type & | reference |
typedef const reference | const_reference |
typedef std::input_iterator_tag | iterator_category |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((boost::Sequence< TSequence >)) | |
BOOST_CONCEPT_ASSERT ((CInteger< TRank >)) | |
~InputIteratorWithRankOnSequence () | |
InputIteratorWithRankOnSequence (const Sequence &seq, ConstIterator it) | |
InputIteratorWithRankOnSequence (Sequence *ptrSeq, ConstIterator it) | |
InputIteratorWithRankOnSequence (const CountedPtr< Sequence > &ptrSeq, ConstIterator it) | |
InputIteratorWithRankOnSequence (const Self &other) | |
Self & | operator= (const Self &other) |
Value | operator* () const |
Pointer | operator-> () const |
Self & | operator++ () |
Self | operator++ (int) |
bool | operator== (const Self &other) const |
bool | operator!= (const Self &other) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Protected Member Functions | |
InputIteratorWithRankOnSequence () |
Private Attributes | |
CountedPtr< Sequence > | mySequence |
ConstIterator | myIterator |
Value | myTmpValue |
Aim: Useful to create an iterator that returns a pair (value,rank) when visiting a sequence. The sequence is smartly copied within the iterator. Hence, the given sequence need not to persist during the visit. Since it is only an input sequence, it is not necessary to give a valid sequence when creating the end() iterator.
Description of template class 'InputIteratorWithRankOnSequence'
It is used by SternBrocot::Fraction, LightSternBrocot::Fraction, LighterSternBrocot::Fraction to visit the quotients of the continued fraction.
It is a model of boost::InputIterator.
TSequence | the type of sequence (a model of Sequence). |
TRank | the type of the rank (a model of CInteger). |
Definition at line 79 of file InputIteratorWithRankOnSequence.h.
typedef const reference DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::const_reference |
Definition at line 100 of file InputIteratorWithRankOnSequence.h.
typedef Sequence::const_iterator DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::ConstIterator |
Definition at line 91 of file InputIteratorWithRankOnSequence.h.
typedef Sequence::difference_type DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::difference_type |
Definition at line 97 of file InputIteratorWithRankOnSequence.h.
typedef std::input_iterator_tag DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::iterator_category |
Definition at line 101 of file InputIteratorWithRankOnSequence.h.
typedef const Value* DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::Pointer |
Definition at line 92 of file InputIteratorWithRankOnSequence.h.
typedef Pointer DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::pointer |
Definition at line 98 of file InputIteratorWithRankOnSequence.h.
typedef TRank DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::Rank |
Definition at line 87 of file InputIteratorWithRankOnSequence.h.
typedef const value_type& DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::reference |
Definition at line 99 of file InputIteratorWithRankOnSequence.h.
typedef InputIteratorWithRankOnSequence<Sequence,Rank> DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::Self |
Definition at line 88 of file InputIteratorWithRankOnSequence.h.
typedef TSequence DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::Sequence |
Definition at line 86 of file InputIteratorWithRankOnSequence.h.
typedef Sequence::value_type DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::SequenceValue |
Definition at line 89 of file InputIteratorWithRankOnSequence.h.
typedef Sequence::size_type DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::size_type |
Definition at line 96 of file InputIteratorWithRankOnSequence.h.
typedef std::pair<SequenceValue,Rank> DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::Value |
Definition at line 90 of file InputIteratorWithRankOnSequence.h.
typedef Value DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::value_type |
Definition at line 95 of file InputIteratorWithRankOnSequence.h.
|
inline |
|
inline |
Constructor.
seq | any sequence. |
it | any iterator in the sequence seq. |
Definition at line 52 of file InputIteratorWithRankOnSequence.ih.
|
inline |
Constructor.
ptrSeq | any dynamically allocated pointer on a sequence (acquired). |
it | any iterator in the sequence ptrSeq. |
Definition at line 60 of file InputIteratorWithRankOnSequence.ih.
|
inline |
Constructor.
ptrSeq | any smart pointer on a sequence (CountedPtr or CowPtr). |
it | any iterator in the sequence ptrSeq. |
Definition at line 69 of file InputIteratorWithRankOnSequence.ih.
|
inline |
Copy constructor.
other | the object to clone. |
Definition at line 77 of file InputIteratorWithRankOnSequence.ih.
|
protected |
Constructor.
DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::BOOST_CONCEPT_ASSERT | ( | (boost::Sequence< TSequence >) | ) |
DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::BOOST_CONCEPT_ASSERT | ( | (CInteger< TRank >) | ) |
|
inline |
Checks the validity/consistency of the object.
Definition at line 191 of file InputIteratorWithRankOnSequence.ih.
|
inline |
Inequality operator.
other | any other iterator. |
Definition at line 162 of file InputIteratorWithRankOnSequence.ih.
References operator==().
|
inline |
Dereference operator.
Definition at line 100 of file InputIteratorWithRankOnSequence.ih.
|
inline |
Pre-increment operator.
Definition at line 119 of file InputIteratorWithRankOnSequence.ih.
|
inline |
Post-increment operator.
Definition at line 129 of file InputIteratorWithRankOnSequence.ih.
|
inline |
Pointer dereference operator.
Definition at line 109 of file InputIteratorWithRankOnSequence.ih.
References operator*().
|
inline |
Assignment.
other | the object to copy. |
Definition at line 86 of file InputIteratorWithRankOnSequence.ih.
References DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::myIterator, and DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::mySequence.
|
inline |
Equality operator.
other | any other iterator. |
Definition at line 140 of file InputIteratorWithRankOnSequence.ih.
References DGtal::CountedPtr< T >::get(), DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::myIterator, and DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::mySequence.
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 178 of file InputIteratorWithRankOnSequence.ih.
|
private |
The current iterator position on the sequence.
Definition at line 206 of file InputIteratorWithRankOnSequence.h.
Referenced by DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::operator=(), and DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::operator==().
|
private |
A smart pointer to the visited sequence.
Definition at line 204 of file InputIteratorWithRankOnSequence.h.
Referenced by DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::operator=(), and DGtal::InputIteratorWithRankOnSequence< TSequence, TRank >::operator==().
|
private |
Hack to store a value when using operator->. This value is not copied nor initialized.
Definition at line 209 of file InputIteratorWithRankOnSequence.h.