DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Friends
DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator Class Reference

#include <LabelledMap.h>

Collaboration diagram for DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator:
Collaboration graph
[legend]

Public Types

typedef ConstIterator Self
typedef const ValuePointer
typedef Value Reference
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

 ~ConstIterator ()
 ConstIterator ()
 ConstIterator (const ConstIterator &other)
Selfoperator= (const Self &other)
Reference operator* () const
Pointer operator-> () const
Selfoperator++ ()
Self operator++ (int)
bool operator== (const Self &other) const
bool operator!= (const Self &other) const
Data_data () const
const Data_const_data () const

Protected Member Functions

 ConstIterator (LabelsConstIterator lIt, BlockConstIterator bIt)

Private Attributes

LabelsConstIterator myLabelsIt
BlockConstIterator myBlockIt

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 >::ConstIterator

This class allows to visit all stored pairs (key,value).

Definition at line 629 of file LabelledMap.h.


Member Typedef Documentation

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

Definition at line 643 of file LabelledMap.h.

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 >::ConstIterator::DifferenceType

Definition at line 638 of file LabelledMap.h.

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 >::ConstIterator::iterator_category

Definition at line 647 of file LabelledMap.h.

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

Definition at line 635 of file LabelledMap.h.

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

Definition at line 644 of file LabelledMap.h.

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

Note the trick here. The reference is a rvalue. Works only for const iterator.

Definition at line 637 of file LabelledMap.h.

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

Definition at line 645 of file LabelledMap.h.

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

Definition at line 632 of file LabelledMap.h.

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 >::ConstIterator::size_type

Definition at line 642 of file LabelledMap.h.

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

Definition at line 641 of file LabelledMap.h.


Constructor & Destructor Documentation

template<typename TData , unsigned int L, typename TWord , unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::ConstIterator ( LabelsConstIterator  lIt,
BlockConstIterator  bIt 
)
inlineprotected

Constructor. Internal. Used by LabelledMap.

Definition at line 417 of file LabelledMap.ih.

: myLabelsIt( lIt ), myBlockIt( bIt )
{}
template<typename TData , unsigned int L, typename TWord , unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::~ConstIterator ( )
inline

Default destructor.

Definition at line 424 of file LabelledMap.ih.

{}
template<typename TData , unsigned int L, typename TWord , unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::ConstIterator ( )
inline

Default constructor.

Definition at line 430 of file LabelledMap.ih.

{}
template<typename TData , unsigned int L, typename TWord , unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::ConstIterator ( const ConstIterator other)
inline

Copy constructor.

Parameters:
otherthe object to clone.

Definition at line 436 of file LabelledMap.ih.

: myLabelsIt( other.myLabelsIt ), myBlockIt( other.myBlockIt )
{}

Member Function Documentation

template<typename TData , unsigned int L, typename TWord , unsigned int N, unsigned int M>
const DGtal::LabelledMap< TData, L, TWord, N, M >::Data & DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::_const_data ( ) const
inline

Definition at line 528 of file LabelledMap.ih.

{
return *myBlockIt;
}
template<typename TData , unsigned int L, typename TWord , unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::Data & DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::_data ( ) const
inline

Definition at line 519 of file LabelledMap.ih.

{
return const_cast<Data&>( *myBlockIt );
}
template<typename TData , unsigned int L, typename TWord , unsigned int N, unsigned int M>
bool DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::operator!= ( const Self other) const
inline

Inequality operator.

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

Definition at line 510 of file LabelledMap.ih.

References DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::myLabelsIt.

{
return myLabelsIt != other.myLabelsIt;
}
template<typename TData , unsigned int L, typename TWord , unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::Reference DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::operator* ( ) const
inline

Dereference operator.

Returns:
the current data of the iterator, if valid.

Definition at line 458 of file LabelledMap.ih.

{
return std::make_pair( *myLabelsIt, *myBlockIt );
}
template<typename TData , unsigned int L, typename TWord , unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::Self & DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::operator++ ( )
inline

Pre-increment operator.

Returns:
a reference to itself.

Definition at line 479 of file LabelledMap.ih.

{
return *this;
}
template<typename TData , unsigned int L, typename TWord , unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::Self DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::operator++ ( int  )
inline

Post-increment operator.

Returns:
a reference to itself.

Definition at line 490 of file LabelledMap.ih.

{
Self tmp( *this );
this->operator++();
return tmp;
}
template<typename TData , unsigned int L, typename TWord , unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::Pointer DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::operator-> ( ) const
inline

Pointer dereference operator. Warning: Not thread-safe !! Use operator* instead.

Returns:
a non-mutable pointer on the current data.

Definition at line 467 of file LabelledMap.ih.

References operator*().

{
// Warning: not thread-safe.
static Value __static_tmp;
__static_tmp = this->operator*();
return &__static_tmp;
}
template<typename TData , unsigned int L, typename TWord , unsigned int N, unsigned int M>
DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::Self & DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::operator= ( const Self other)
inline

Assignment.

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

Definition at line 444 of file LabelledMap.ih.

References DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::myBlockIt, and DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::myLabelsIt.

{
if ( this != &other )
{
myLabelsIt = other.myLabelsIt;
myBlockIt = other.myBlockIt;
}
return *this;
}
template<typename TData , unsigned int L, typename TWord , unsigned int N, unsigned int M>
bool DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::operator== ( const Self other) const
inline

Equality operator.

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

Definition at line 501 of file LabelledMap.ih.

References DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::myLabelsIt.

{
return myLabelsIt == other.myLabelsIt;
}

Friends And Related Function Documentation

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

Definition at line 631 of file LabelledMap.h.


Field Documentation

template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
BlockConstIterator DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::myBlockIt
private
template<typename TData, unsigned int L, typename TWord, unsigned int N, unsigned int M>
LabelsConstIterator DGtal::LabelledMap< TData, L, TWord, N, M >::ConstIterator::myLabelsIt
private

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