Tulip  5.3.1
Large graphs analysis and drawing
tlp::ConversionIterator< TYPEIN, TYPEOUT, ConversionFunc > Class Template Reference

#include <ConversionIterator.h>

+ Inheritance diagram for tlp::ConversionIterator< TYPEIN, TYPEOUT, ConversionFunc >:
+ Collaboration diagram for tlp::ConversionIterator< TYPEIN, TYPEOUT, ConversionFunc >:

Public Member Functions

 ConversionIterator (Iterator< TYPEIN > *it, ConversionFunc convFunctor)
 
bool hasNext ()
 
TYPEOUT next ()
 
- Public Member Functions inherited from tlp::Iterator< TYPEOUT >
iterator_t begin ()
 
iterator_t end ()
 

Detailed Description

template<typename TYPEIN, typename TYPEOUT, typename ConversionFunc>
class tlp::ConversionIterator< TYPEIN, TYPEOUT, ConversionFunc >

Iterator that enables to convert an Iterator of type TYPEIN to an Iterator of type TYPEOUT.

Parameters
itthe iterator that should be converted
convFunctorthe functor or lamnda function that enables to convert TYPEIN to TYPEOUT

The functor function shouls have the following form:

class AConversionFunc {
TYPEOUT operator()(TYPEIN a) {
return a converted in TYPEOUT;
}
};

Definition at line 45 of file ConversionIterator.h.

Member Function Documentation

◆ hasNext()

template<typename TYPEIN, typename TYPEOUT, typename ConversionFunc>
bool tlp::ConversionIterator< TYPEIN, TYPEOUT, ConversionFunc >::hasNext ( )
inlinevirtual

Tells if the sequence is at its end.

Returns
bool Whether there are more elements to iterate.

Implements tlp::Iterator< TYPEOUT >.

Definition at line 52 of file ConversionIterator.h.

◆ next()

template<typename TYPEIN, typename TYPEOUT, typename ConversionFunc>
TYPEOUT tlp::ConversionIterator< TYPEIN, TYPEOUT, ConversionFunc >::next ( )
inlinevirtual

Moves the Iterator on the next element.

Returns
The current element pointed by the Iterator.

Implements tlp::Iterator< TYPEOUT >.

Definition at line 55 of file ConversionIterator.h.