DGtal  0.9.3beta
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator Class Reference

#include <DGtal/base/IndexedListWithBlocks.h>

Collaboration diagram for DGtal::IndexedListWithBlocks< TValue, N, M >::Iterator:
[legend]

Public Types

typedef Iterator Self
 
typedef TValue Value
 
typedef ValuePointer
 
typedef ValueReference
 
typedef std::ptrdiff_t DifferenceType
 
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
 
unsigned int myNbValues
 
ValuemyValues
 
AnyBlockmyNext
 

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

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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

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.

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

Default destructor.

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

Default constructor.

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

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.
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.
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.
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.
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.
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.
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'.
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.
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 Function Documentation

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

Definition at line 358 of file IndexedListWithBlocks.h.

Field Documentation

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.

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.

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.

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: