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,
119 ConversionFunc convFunc) {
124 #endif // CONVERSIONITERATOR_H
Iterator that enables to convert an Iterator of type TYPEIN to an Iterator of type TYPEOUT...
virtual T next()=0
Moves the Iterator on the next element.
Interface for Tulip iterators. Allows basic iteration operations only.
ConversionIterator< TIN, TOUT, ConversionFunc > * conversionIterator(tlp::Iterator< TIN > *it, ConversionFunc convFunc)
Convenient function for creating a ConversionIterator.
bool hasNext()
Tells if the sequence is at its end.
TYPEOUT next()
Moves the Iterator on the next element.
virtual bool hasNext()=0
Tells if the sequence is at its end.
MPConversionIterator implements memory pool for 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.