DGtal
1.5.beta
|
Aim: It is a simple class that mimics a (non mutable) iterator over integers. You can increment it, decrement it, displace it, compare it, etc. It is useful if you have a collection of consecutive integers, and you wish to create an iterator over it. It is used in the class TriangulatedSurface for example, since vertices are numbers from 0 to nbVertices - 1. More...
#include <DGtal/base/IntegerSequenceIterator.h>
Public Types | |
typedef IntegerSequenceIterator< TInteger > | Self |
typedef TInteger | Integer |
Public Member Functions | |
IntegerSequenceIterator (Integer n=Integer(0)) | |
~IntegerSequenceIterator ()=default | |
IntegerSequenceIterator (const IntegerSequenceIterator &other)=default | |
IntegerSequenceIterator (IntegerSequenceIterator &&other)=default | |
IntegerSequenceIterator & | operator= (const IntegerSequenceIterator &other)=default |
IntegerSequenceIterator & | operator= (IntegerSequenceIterator &&other)=default |
Protected Attributes | |
Integer | myNumber |
The current value of the interator. More... | |
Private Member Functions | |
void | increment () |
Increments the iterator. Required by boost::iterator_facade. More... | |
void | decrement () |
Decrements the iterator. Required by boost::iterator_facade. More... | |
void | advance (std::ptrdiff_t n) |
std::ptrdiff_t | distance_to (IntegerSequenceIterator const &other) |
bool | equal (IntegerSequenceIterator const &other) const |
Integer const & | dereference () const |
Friends | |
class | boost::iterator_core_access |
Aim: It is a simple class that mimics a (non mutable) iterator over integers. You can increment it, decrement it, displace it, compare it, etc. It is useful if you have a collection of consecutive integers, and you wish to create an iterator over it. It is used in the class TriangulatedSurface for example, since vertices are numbers from 0 to nbVertices - 1.
Description of template class 'IntegerSequenceIterator'
It is model of boost::RandomAccessIterator.
Definition at line 65 of file IntegerSequenceIterator.h.
typedef TInteger DGtal::IntegerSequenceIterator< TInteger >::Integer |
Definition at line 72 of file IntegerSequenceIterator.h.
typedef IntegerSequenceIterator<TInteger> DGtal::IntegerSequenceIterator< TInteger >::Self |
Definition at line 71 of file IntegerSequenceIterator.h.
|
inline |
Constructor from Integer;
n | any integer (default to zero). |
Definition at line 81 of file IntegerSequenceIterator.h.
|
default |
Destructor.
|
default |
Copy constructor.
other | the object to clone. |
|
default |
Move constructor.
other | the object to move. |
|
inlineprivate |
Advances the iterator. Required by boost::iterator_facade.
n | the number of forward steps performed by the iterator. |
Definition at line 124 of file IntegerSequenceIterator.h.
References DGtal::IntegerSequenceIterator< TInteger >::myNumber.
|
inlineprivate |
Decrements the iterator. Required by boost::iterator_facade.
Definition at line 121 of file IntegerSequenceIterator.h.
References DGtal::IntegerSequenceIterator< TInteger >::myNumber.
|
inlineprivate |
Definition at line 135 of file IntegerSequenceIterator.h.
References DGtal::IntegerSequenceIterator< TInteger >::myNumber.
|
inlineprivate |
Distance to given iterator. Required by boost::iterator_facade.
other | any iterator on the same sequence. |
Definition at line 127 of file IntegerSequenceIterator.h.
References DGtal::IntegerSequenceIterator< TInteger >::myNumber.
|
inlineprivate |
Equality comparison with another iterator. Required by boost::iterator_facade.
other | any iterator on the same sequence. |
Definition at line 131 of file IntegerSequenceIterator.h.
References DGtal::IntegerSequenceIterator< TInteger >::myNumber.
|
inlineprivate |
Increments the iterator. Required by boost::iterator_facade.
Definition at line 119 of file IntegerSequenceIterator.h.
References DGtal::IntegerSequenceIterator< TInteger >::myNumber.
|
default |
Copy assignment operator.
other | the object to copy. |
|
default |
Move assignment operator.
other | the object to move. |
|
friend |
Definition at line 116 of file IntegerSequenceIterator.h.
|
protected |
The current value of the interator.
Definition at line 143 of file IntegerSequenceIterator.h.
Referenced by DGtal::IntegerSequenceIterator< TInteger >::advance(), DGtal::IntegerSequenceIterator< TInteger >::decrement(), DGtal::IntegerSequenceIterator< TInteger >::dereference(), DGtal::IntegerSequenceIterator< TInteger >::distance_to(), DGtal::IntegerSequenceIterator< TInteger >::equal(), and DGtal::IntegerSequenceIterator< TInteger >::increment().