DGtal 2.2.0
Loading...
Searching...
No Matches
DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator Class Reference

#include <DGtal/base/LabelledMap.h>

Public Types

typedef BlockIterator Self
typedef TData Value
typedef Value * Pointer
typedef Value & Reference
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

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

Protected Member Functions

 BlockIterator (__FirstBlock &block, unsigned int idx, unsigned int size)

Protected Attributes

unsigned int myIdx
 current index in myDatas of the iterator
unsigned int myNbDatas
 number of valid data in array myDatas
Data * myDatas
 array of myNbDatas data.
__AnyBlock * myNext
 pointer to next block or 0 if last block.

Friends

class LabelledMap

Detailed Description

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
class DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator

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

Definition at line 394 of file LabelledMap.h.

Member Typedef Documentation

◆ difference_type

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
typedef DifferenceType DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::difference_type

Definition at line 405 of file LabelledMap.h.

◆ DifferenceType

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
typedef std::ptrdiff_t DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::DifferenceType

only positive offsets allowed.

Definition at line 400 of file LabelledMap.h.

◆ iterator_category

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
typedef std::forward_iterator_tag DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::iterator_category

Definition at line 409 of file LabelledMap.h.

◆ Pointer

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
typedef Value* DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::Pointer

Definition at line 398 of file LabelledMap.h.

◆ pointer

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
typedef Pointer DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::pointer

Definition at line 406 of file LabelledMap.h.

◆ Reference

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
typedef Value& DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::Reference

Definition at line 399 of file LabelledMap.h.

◆ reference

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
typedef Reference DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::reference

Definition at line 407 of file LabelledMap.h.

◆ Self

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
typedef BlockIterator DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::Self

Definition at line 396 of file LabelledMap.h.

◆ size_type

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
typedef std::size_t DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::size_type

Definition at line 404 of file LabelledMap.h.

◆ Value

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
typedef TData DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::Value

Definition at line 397 of file LabelledMap.h.

◆ value_type

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
typedef Value DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::value_type

Definition at line 403 of file LabelledMap.h.

Constructor & Destructor Documentation

◆ BlockIterator() [1/3]

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::BlockIterator ( __FirstBlock & block,
unsigned int idx,
unsigned int size )
protected

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

References DGtal::LabelledMap< TData, L, TWord, N, M >::size().

Referenced by BlockIterator().

◆ ~BlockIterator()

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::~BlockIterator ( )

Default destructor.

◆ BlockIterator() [2/3]

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::BlockIterator ( )

Default constructor.

◆ BlockIterator() [3/3]

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::BlockIterator ( const BlockIterator & other)

Copy constructor.

Parameters
otherthe object to clone.

References BlockIterator().

Member Function Documentation

◆ operator!=()

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
bool DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::operator!= ( const Self & other) const

Inequality operator.

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

◆ operator*()

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
Reference DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::operator* ( ) const

Dereference operator.

Returns
the current data of the iterator, if valid.

◆ operator++() [1/2]

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
Self & DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::operator++ ( )

Pre-increment operator.

Returns
a reference to itself.

◆ operator++() [2/2]

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
Self DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::operator++ ( int )

Post-increment operator.

Returns
a reference to itself.

◆ operator+=()

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
Self & DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::operator+= ( DifferenceType n)

Addition operator. Moves the iterator at position + n.

Parameters
nany positive integer
Returns
a reference to itself.

◆ operator->()

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
Pointer DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::operator-> ( ) const

Pointer dereference operator.

Returns
a non-mutable pointer on the current data.

◆ operator=()

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
Self & DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::operator= ( const Self & other)

Assignment.

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

◆ operator==()

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
bool DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::operator== ( const Self & other) const

Equality operator.

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

◆ operator[]()

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
Reference DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::operator[] ( DifferenceType n) const

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

Parameters
nany positive integer
Returns
a reference to itself.

◆ LabelledMap

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
friend class LabelledMap
friend

Definition at line 418 of file LabelledMap.h.

References LabelledMap.

Referenced by LabelledMap.

Field Documentation

◆ myDatas

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
Data* DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::myDatas
protected

array of myNbDatas data.

Definition at line 415 of file LabelledMap.h.

◆ myIdx

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
unsigned int DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::myIdx
protected

current index in myDatas of the iterator

Definition at line 413 of file LabelledMap.h.

◆ myNbDatas

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
unsigned int DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::myNbDatas
protected

number of valid data in array myDatas

Definition at line 414 of file LabelledMap.h.

◆ myNext

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
__AnyBlock* DGtal::LabelledMap< TData, L, TWord, N, M >::BlockIterator::myNext
protected

pointer to next block or 0 if last block.

Definition at line 416 of file LabelledMap.h.


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