DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator Class Reference

#include <DGtal/base/IndexedListWithBlocks.h>

Public Types

typedef Iterator Self
 
typedef TValue Value
 
typedef ValuePointer
 
typedef ValueReference
 
typedef std::ptrdiff_t DifferenceType
 only positive offsets allowed.
 
typedef Value value_type
 
typedef std::size_t size_type
 
typedef DifferenceType difference_type
 
typedef Pointer pointer
 
typedef Reference reference
 
typedef std::forward_iterator_tag iterator_category
 

Public Member Functions

 ~Iterator ()
 
 Iterator ()
 
 Iterator (const Iterator &other)
 
Selfoperator= (const Self &other)
 
Reference operator* () const
 
Pointer operator-> () const
 
Selfoperator++ ()
 
Self operator++ (int)
 
Selfoperator+= (DifferenceType n)
 
Reference operator[] (DifferenceType n) const
 
bool operator== (const Self &other) const
 
bool operator!= (const Self &other) const
 

Protected Member Functions

 Iterator (FirstBlock &block, unsigned int idx)
 

Protected Attributes

unsigned int myIdx
 current index in myValues of the iterator
 
unsigned int myNbValues
 number of valid values in array myValues
 
ValuemyValues
 array of myNbValues values.
 
AnyBlockmyNext
 pointer to next block or 0 if last block.
 

Friends

class IndexedListWithBlocks
 

Detailed Description

template<typename TValue, unsigned int N, unsigned int M>
class DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator

Pseudo-random iterator to visit IndexedListWithBlocks (it is only a random forward iterator). Model of boost::ForwardIterator. Provides also + and += arithmetic.

Definition at line 334 of file IndexedListWithBlocks.h.

Member Typedef Documentation

◆ difference_type

template<typename TValue , unsigned int N, unsigned int M>
typedef DifferenceType DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::difference_type

Definition at line 345 of file IndexedListWithBlocks.h.

◆ DifferenceType

template<typename TValue , unsigned int N, unsigned int M>
typedef std::ptrdiff_t DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::DifferenceType

only positive offsets allowed.

Definition at line 340 of file IndexedListWithBlocks.h.

◆ iterator_category

template<typename TValue , unsigned int N, unsigned int M>
typedef std::forward_iterator_tag DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::iterator_category

Definition at line 349 of file IndexedListWithBlocks.h.

◆ Pointer

template<typename TValue , unsigned int N, unsigned int M>
typedef Value* DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::Pointer

Definition at line 338 of file IndexedListWithBlocks.h.

◆ pointer

template<typename TValue , unsigned int N, unsigned int M>
typedef Pointer DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::pointer

Definition at line 346 of file IndexedListWithBlocks.h.

◆ Reference

template<typename TValue , unsigned int N, unsigned int M>
typedef Value& DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::Reference

Definition at line 339 of file IndexedListWithBlocks.h.

◆ reference

template<typename TValue , unsigned int N, unsigned int M>
typedef Reference DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::reference

Definition at line 347 of file IndexedListWithBlocks.h.

◆ Self

template<typename TValue , unsigned int N, unsigned int M>
typedef Iterator DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::Self

Definition at line 336 of file IndexedListWithBlocks.h.

◆ size_type

template<typename TValue , unsigned int N, unsigned int M>
typedef std::size_t DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::size_type

Definition at line 344 of file IndexedListWithBlocks.h.

◆ Value

template<typename TValue , unsigned int N, unsigned int M>
typedef TValue DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::Value

Definition at line 337 of file IndexedListWithBlocks.h.

◆ value_type

template<typename TValue , unsigned int N, unsigned int M>
typedef Value DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::value_type

Definition at line 343 of file IndexedListWithBlocks.h.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

template<typename TValue , unsigned int N, unsigned int M>
DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::Iterator ( FirstBlock & block,
unsigned int idx )
protected

Constructor from first block and index. Used by class IndexedListWithBlocks.

◆ ~Iterator()

template<typename TValue , unsigned int N, unsigned int M>
DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::~Iterator ( )

Default destructor.

◆ Iterator() [2/3]

template<typename TValue , unsigned int N, unsigned int M>
DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::Iterator ( )

Default constructor.

◆ Iterator() [3/3]

template<typename TValue , unsigned int N, unsigned int M>
DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::Iterator ( const Iterator & other)

Copy constructor.

Parameters
otherthe object to clone.

Member Function Documentation

◆ operator!=()

template<typename TValue , unsigned int N, unsigned int M>
bool DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::operator!= ( const Self & other) const

Inequality operator.

Parameters
otherany other iterator.
Returns
'true' iff the iterators points on different elements.

◆ operator*()

template<typename TValue , unsigned int N, unsigned int M>
Reference DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::operator* ( ) const

Dereference operator.

Returns
the current value of the iterator, if valid.

◆ operator++() [1/2]

template<typename TValue , unsigned int N, unsigned int M>
Self & DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::operator++ ( )

Pre-increment operator.

Returns
a reference to itself.

◆ operator++() [2/2]

template<typename TValue , unsigned int N, unsigned int M>
Self DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::operator++ ( int )

Post-increment operator.

Returns
a reference to itself.

◆ operator+=()

template<typename TValue , unsigned int N, unsigned int M>
Self & DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::operator+= ( DifferenceType n)

Addition operator. Moves the iterator at position + n.

Parameters
nany positive integer
Returns
a reference to itself.

◆ operator->()

template<typename TValue , unsigned int N, unsigned int M>
Pointer DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::operator-> ( ) const

Pointer dereference operator.

Returns
a non-mutable pointer on the current value.

◆ operator=()

template<typename TValue , unsigned int N, unsigned int M>
Self & DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::operator= ( const Self & other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.

◆ operator==()

template<typename TValue , unsigned int N, unsigned int M>
bool DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::operator== ( const Self & other) const

Equality operator.

Parameters
otherany other iterator.
Returns
'true' iff the iterators points on the same element.

◆ operator[]()

template<typename TValue , unsigned int N, unsigned int M>
Reference DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::operator[] ( DifferenceType n) const

Positive offset dereference operator. Moves the iterator at position + n.

Parameters
nany positive integer
Returns
a reference to itself.

Friends And Related Symbol Documentation

◆ IndexedListWithBlocks

template<typename TValue , unsigned int N, unsigned int M>
friend class IndexedListWithBlocks
friend

Definition at line 358 of file IndexedListWithBlocks.h.

Field Documentation

◆ myIdx

template<typename TValue , unsigned int N, unsigned int M>
unsigned int DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::myIdx
protected

current index in myValues of the iterator

Definition at line 353 of file IndexedListWithBlocks.h.

◆ myNbValues

template<typename TValue , unsigned int N, unsigned int M>
unsigned int DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::myNbValues
protected

number of valid values in array myValues

Definition at line 354 of file IndexedListWithBlocks.h.

◆ myNext

template<typename TValue , unsigned int N, unsigned int M>
AnyBlock* DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::myNext
protected

pointer to next block or 0 if last block.

Definition at line 356 of file IndexedListWithBlocks.h.

◆ myValues

template<typename TValue , unsigned int N, unsigned int M>
Value* DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator::myValues
protected

array of myNbValues values.

Definition at line 355 of file IndexedListWithBlocks.h.


The documentation for this class was generated from the following file: