DGtal 1.4.0
|
This class adapts any lvalue iterator so that operator* returns a member on the element pointed to by the iterator, instead the element itself. More...
#include <DGtal/base/IteratorAdapter.h>
Public Types | |
typedef IteratorAdapter< TIterator, TFunctor, TReturnType > | Self |
typedef boost::transform_iterator< TFunctor, TIterator, TReturnType &, TReturnType > | Parent |
Public Member Functions | |
IteratorAdapter () | |
IteratorAdapter (const TIterator &iter, TFunctor func) | |
IteratorAdapter (const Self &other) | |
IteratorAdapter (const Parent &other) | |
Self & | operator= (const Self &other) |
Self & | operator= (const Parent &other) |
~IteratorAdapter () | |
Private Member Functions | |
BOOST_CONCEPT_ASSERT ((boost_concepts::LvalueIteratorConcept< TIterator >)) | |
This class adapts any lvalue iterator so that operator* returns a member on the element pointed to by the iterator, instead the element itself.
Description of template class 'IteratorAdapter'
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. This operation returns a reference (or constant reference) on a member of the element pointed to by the iterator, which can be read as well as assigned (if the member is not constant).
TFunctor | the type of functor that transforms the pointed element into another one |
TReturnType | the type of the element returned by the underlying functor |
Definition at line 76 of file IteratorAdapter.h.
typedef boost::transform_iterator< TFunctor, TIterator, TReturnType&, TReturnType > DGtal::IteratorAdapter< TIterator, TFunctor, TReturnType >::Parent |
parent class
Definition at line 87 of file IteratorAdapter.h.
typedef IteratorAdapter< TIterator, TFunctor, TReturnType > DGtal::IteratorAdapter< TIterator, TFunctor, TReturnType >::Self |
this class
Definition at line 85 of file IteratorAdapter.h.
|
inline |
Default constructor
Definition at line 92 of file IteratorAdapter.h.
|
inline |
Constructor from an iterator and a functor
iter | any iterator |
func | any functor |
Definition at line 99 of file IteratorAdapter.h.
|
inline |
Copy operator
other | the object of type Self to copy. |
Definition at line 105 of file IteratorAdapter.h.
|
inline |
Copy operator
other | the object of type Parent to copy. |
Definition at line 111 of file IteratorAdapter.h.
|
inline |
|
private |
|
inline |
Assignement operator
other | the object of type Parent to copy. |
Definition at line 130 of file IteratorAdapter.h.
|
inline |
Assignement operator
other | the object of type Self to copy. |
Definition at line 118 of file IteratorAdapter.h.