DGtal
0.6.devel
|
#include <ConstIteratorAdapter.h>
Public Types | |
typedef IteratorCirculatorTraits < TIterator >::Type | Type |
Public Member Functions | |
ConstIteratorAdapter () | |
ConstIteratorAdapter (TIterator const &i, TLightFunctor f) | |
template<class OtherFunctor , class OtherIterator , class OtherReturnType > | |
ConstIteratorAdapter (ConstIteratorAdapter< OtherFunctor, OtherIterator, OtherReturnType > const &other) | |
TLightFunctor | functor () const |
Private Types | |
typedef boost::iterator_adaptor < ConstIteratorAdapter < TIterator, TLightFunctor, TReturnType >, TIterator, TReturnType, boost::use_default, TReturnType > | Super |
Private Member Functions | |
Super::reference | dereference () const |
Private Attributes | |
TLightFunctor | myF |
Friends | |
class | boost::iterator_core_access |
This class adapts any iterator so that operator* returns another element than the one pointed to by the iterator.
Description of template class 'ConstIteratorAdapter'
TIterator | the type of the iterator to adapt |
To achieve this goal, the adapter is based on a functor f given at construction so that operator* calls f(<em>it), instead of calling directly operator of the underlying iterator it.
TLightFunctor | the type of functor that transforms the pointed element into another one (required to be light because the functor is passed by value) |
TReturnType | the type of the element returned by the underlying functor (if TLightFunctor has a nested type called 'Value', TReturnType is set to TLightFunctor::Value by default) |
NB: from boost/iterator/transform_iterator.hpp
Definition at line 79 of file ConstIteratorAdapter.h.
|
private |
Definition at line 86 of file ConstIteratorAdapter.h.
typedef IteratorCirculatorTraits<TIterator>::Type DGtal::ConstIteratorAdapter< TIterator, TLightFunctor, TReturnType >::Type |
Definition at line 92 of file ConstIteratorAdapter.h.
|
inline |
|
inline |
Constructor
i | any iterator |
f | any functor |
Definition at line 106 of file ConstIteratorAdapter.h.
|
inline |
Copy constructor
other | the object to copy |
Definition at line 118 of file ConstIteratorAdapter.h.
|
inlineprivate |
Dereference function
Definition at line 140 of file ConstIteratorAdapter.h.
References DGtal::ConstIteratorAdapter< TIterator, TLightFunctor, TReturnType >::myF.
|
inline |
Accessor on the functor
Definition at line 129 of file ConstIteratorAdapter.h.
References DGtal::ConstIteratorAdapter< TIterator, TLightFunctor, TReturnType >::myF.
|
friend |
Definition at line 88 of file ConstIteratorAdapter.h.
|
private |
functor
Definition at line 144 of file ConstIteratorAdapter.h.
Referenced by DGtal::ConstIteratorAdapter< TIterator, TLightFunctor, TReturnType >::dereference(), and DGtal::ConstIteratorAdapter< TIterator, TLightFunctor, TReturnType >::functor().