20 #ifndef CONVERSIONITERATOR_H
21 #define CONVERSIONITERATOR_H
23 #include <tulip/Iterator.h>
24 #include <tulip/StlIterator.h>
25 #include <tulip/memorypool.h>
44 template <
typename TYPEIN,
typename TYPEOUT,
typename ConversionFunc>
48 : _it(it), _convFunctor(convFunctor) {}
56 return _convFunctor(_it->
next());
61 ConversionFunc _convFunctor;
70 template <
typename TIN,
typename TOUT,
typename ConversionFunc>
72 public MemoryPool<MPConversionIterator<TIN, TOUT, ConversionFunc>> {
93 template <
typename TOUT,
typename ConversionFunc,
typename TIN>
95 ConversionFunc convFunc) {
115 template <
typename TOUT,
typename ConversionFunc,
typename Container>
116 typename std::enable_if<has_const_iterator<Container>::value,
117 ConversionIterator<typename Container::value_type, TOUT, ConversionFunc>
119 ConversionFunc convFunc) {
Iterator that enables to convert an Iterator of type TYPEIN to an Iterator of type TYPEOUT.
TYPEOUT next()
Moves the Iterator on the next element.
bool hasNext()
Tells if the sequence is at its end.
MPConversionIterator implements memory pool for ConversionIterator.
ConversionIterator< TIN, TOUT, ConversionFunc > * conversionIterator(tlp::Iterator< TIN > *it, ConversionFunc convFunc)
Convenient function for creating a ConversionIterator.
std::enable_if< has_const_iterator< Container >::value, StlIterator< typename Container::value_type, typename Container::const_iterator > * >::type stlIterator(const Container &stlContainer)
Convenient function for creating a StlIterator from a stl container.
Interface for Tulip iterators. Allows basic iteration operations only.
virtual bool hasNext()=0
Tells if the sequence is at its end.
virtual T next()=0
Moves the Iterator on the next element.