DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Private Attributes
DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue > Class Template Reference

#include <OutputIteratorAdapter.h>

Collaboration diagram for DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >:
Collaboration graph
[legend]

Public Types

typedef TIterator Iterator

Public Member Functions

 BOOST_CONCEPT_ASSERT ((boost::ForwardIterator< Iterator >))
 BOOST_CONCEPT_ASSERT ((CUnaryFunctor< TFunctor, typename iterator_traits< Iterator >::value_type &, TInputValue & >))
 OutputIteratorAdapter (const Iterator &it, const TFunctor &f)
 OutputIteratorAdapter (const OutputIteratorAdapter &other)
 ~OutputIteratorAdapter ()
OutputIteratorAdapteroperator= (const TInputValue &aValue)
OutputIteratorAdapteroperator* ()
OutputIteratorAdapteroperator++ ()
OutputIteratorAdapter operator++ (int)

Private Attributes

Iterator myIt
const TFunctor * myF

Detailed Description

template<typename TIterator, typename TFunctor, typename TInputValue>
class DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >

Aim: Adapts an output iterator i with a unary functor f, both given at construction, so that the element pointed to by i is updated with a given value through f.

Description of template class 'OutputIteratorAdapter'

Template Parameters:
TIteratoran output iterator
TInputValueany input value
TFunctora unary functor with reference on the element type as argument type and reference on the the input value type as return type

Definition at line 74 of file OutputIteratorAdapter.h.


Member Typedef Documentation

template<typename TIterator , typename TFunctor , typename TInputValue >
typedef TIterator DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::Iterator

Definition at line 81 of file OutputIteratorAdapter.h.


Constructor & Destructor Documentation

template<typename TIterator , typename TFunctor , typename TInputValue >
DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::OutputIteratorAdapter ( const Iterator it,
const TFunctor &  f 
)
inline

Constructor.

Parameters:
itany iterator
fany functor

Definition at line 93 of file OutputIteratorAdapter.h.

: myIt(it), myF(&f) {}
template<typename TIterator , typename TFunctor , typename TInputValue >
DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::OutputIteratorAdapter ( const OutputIteratorAdapter< TIterator, TFunctor, TInputValue > &  other)
inline

Copy constructor.

Parameters:
otherthe object to clone.

Definition at line 100 of file OutputIteratorAdapter.h.

: myIt(other.myIt), myF(other.myF) {}
template<typename TIterator , typename TFunctor , typename TInputValue >
DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::~OutputIteratorAdapter ( )
inline

Destructor.

Definition at line 106 of file OutputIteratorAdapter.h.

{}

Member Function Documentation

template<typename TIterator , typename TFunctor , typename TInputValue >
DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::BOOST_CONCEPT_ASSERT ( (boost::ForwardIterator< Iterator >)  )
template<typename TIterator , typename TFunctor , typename TInputValue >
DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::BOOST_CONCEPT_ASSERT ( (CUnaryFunctor< TFunctor, typename iterator_traits< Iterator >::value_type &, TInputValue & >)  )
template<typename TIterator , typename TFunctor , typename TInputValue >
OutputIteratorAdapter& DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::operator* ( )
inline

Dereference operator

Returns:
a reference to *this

Definition at line 127 of file OutputIteratorAdapter.h.

{ return *this; }
template<typename TIterator , typename TFunctor , typename TInputValue >
OutputIteratorAdapter& DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::operator++ ( )
inline

Pre-increment operator

Returns:
a reference to *this

Definition at line 133 of file OutputIteratorAdapter.h.

References DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::myIt.

{ ++myIt; return *this; }
template<typename TIterator , typename TFunctor , typename TInputValue >
OutputIteratorAdapter DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::operator++ ( int  )
inline

Post-increment operator

Returns:
*this

Definition at line 139 of file OutputIteratorAdapter.h.

References DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::myIt.

{
OutputIteratorAdapter tmp = *this;
++myIt;
return tmp;
}
template<typename TIterator , typename TFunctor , typename TInputValue >
OutputIteratorAdapter& DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::operator= ( const TInputValue &  aValue)
inline

Assignment

Parameters:
aValueany value
Template Parameters:
TInputValuetype of the value used for the update
Returns:
a reference to *this

Definition at line 117 of file OutputIteratorAdapter.h.

References DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::myF.

{
myF->operator()( *myIt ) = aValue;
return *this;
}

Field Documentation

template<typename TIterator , typename TFunctor , typename TInputValue >
const TFunctor* DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::myF
private

Aliasing pointer on the underlying functor

Definition at line 163 of file OutputIteratorAdapter.h.

Referenced by DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::operator=().

template<typename TIterator , typename TFunctor , typename TInputValue >
Iterator DGtal::OutputIteratorAdapter< TIterator, TFunctor, TInputValue >::myIt
private

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