DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
DGtal::IndexedListWithBlocks< TValue, N, M >::ConstIterator Class Reference

#include <DGtal/base/IndexedListWithBlocks.h>

Public Types

typedef ConstIterator Self
 
typedef TValue Value
 
typedef const ValuePointer
 
typedef const ValueReference
 
typedef std::ptrdiff_t DifferenceType
 only positive offsets allowed. More...
 
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

 ~ConstIterator ()
 
 ConstIterator ()
 
 ConstIterator (const ConstIterator &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

 ConstIterator (const FirstBlock &block, unsigned int idx)
 

Protected Attributes

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

Friends

class IndexedListWithBlocks
 

Detailed Description

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

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

Definition at line 451 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 >::ConstIterator::difference_type

Definition at line 462 of file IndexedListWithBlocks.h.

◆ DifferenceType

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

only positive offsets allowed.

Definition at line 457 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 >::ConstIterator::iterator_category

Definition at line 466 of file IndexedListWithBlocks.h.

◆ Pointer

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

Definition at line 455 of file IndexedListWithBlocks.h.

◆ pointer

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

Definition at line 463 of file IndexedListWithBlocks.h.

◆ Reference

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

Definition at line 456 of file IndexedListWithBlocks.h.

◆ reference

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

Definition at line 464 of file IndexedListWithBlocks.h.

◆ Self

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

Definition at line 453 of file IndexedListWithBlocks.h.

◆ size_type

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

Definition at line 461 of file IndexedListWithBlocks.h.

◆ Value

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

Definition at line 454 of file IndexedListWithBlocks.h.

◆ value_type

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

Definition at line 460 of file IndexedListWithBlocks.h.

Constructor & Destructor Documentation

◆ ConstIterator() [1/3]

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

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

◆ ~ConstIterator()

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

Default destructor.

◆ ConstIterator() [2/3]

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

Default constructor.

◆ ConstIterator() [3/3]

template<typename TValue , unsigned int N, unsigned int M>
DGtal::IndexedListWithBlocks< TValue, N, M >::ConstIterator::ConstIterator ( const ConstIterator 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 >::ConstIterator::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 >::ConstIterator::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 >::ConstIterator::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 >::ConstIterator::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 >::ConstIterator::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 >::ConstIterator::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 >::ConstIterator::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 >::ConstIterator::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 >::ConstIterator::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

◆ IndexedListWithBlocks

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

Definition at line 475 of file IndexedListWithBlocks.h.

Field Documentation

◆ myIdx

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

current index in myValues of the iterator

Definition at line 470 of file IndexedListWithBlocks.h.

◆ myNbValues

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

number of valid values in array myValues

Definition at line 471 of file IndexedListWithBlocks.h.

◆ myNext

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

pointer to next block or 0 if last block.

Definition at line 473 of file IndexedListWithBlocks.h.

◆ myValues

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

array of myNbValues values.

Definition at line 472 of file IndexedListWithBlocks.h.


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