DGtal
1.5.beta
|
This class adapts any iterator so that operator* returns another element than the one pointed to by the iterator. More...
#include <DGtal/base/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(*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 85 of file ConstIteratorAdapter.h.
|
private |
Definition at line 92 of file ConstIteratorAdapter.h.
typedef IteratorCirculatorTraits<TIterator>::Type DGtal::ConstIteratorAdapter< TIterator, TLightFunctor, TReturnType >::Type |
Definition at line 98 of file ConstIteratorAdapter.h.
|
inline |
|
inline |
Constructor
i | any iterator |
f | any functor |
Definition at line 112 of file ConstIteratorAdapter.h.
|
inline |
Copy constructor
other | the object to copy |
Definition at line 124 of file ConstIteratorAdapter.h.
|
inlineprivate |
Dereference function
Definition at line 146 of file ConstIteratorAdapter.h.
References DGtal::ConstIteratorAdapter< TIterator, TLightFunctor, TReturnType >::myF.
|
inline |
Accessor on the functor
Definition at line 135 of file ConstIteratorAdapter.h.
References DGtal::ConstIteratorAdapter< TIterator, TLightFunctor, TReturnType >::myF.
|
friend |
Definition at line 94 of file ConstIteratorAdapter.h.
|
private |
functor
Definition at line 150 of file ConstIteratorAdapter.h.
Referenced by DGtal::ConstIteratorAdapter< TIterator, TLightFunctor, TReturnType >::dereference(), and DGtal::ConstIteratorAdapter< TIterator, TLightFunctor, TReturnType >::functor().