Tulip  5.3.0
Large graphs analysis and drawing
tlp::FilterIterator< TYPE, FILTER > Class Template Reference

#include <FilterIterator.h>

+ Inheritance diagram for tlp::FilterIterator< TYPE, FILTER >:
+ Collaboration diagram for tlp::FilterIterator< TYPE, FILTER >:

Public Member Functions

 FilterIterator (Iterator< TYPE > *it, FILTER filter)
 
bool hasNext ()
 
TYPE next ()
 
- Public Member Functions inherited from tlp::Iterator< TYPE >
iterator_t begin ()
 
iterator_t end ()
 

Detailed Description

template<typename TYPE, typename FILTER>
class tlp::FilterIterator< TYPE, FILTER >

Iterator that enables to filter an other Iterator.

Parameters
itthe iterator that should be filtered
filterthe functor or lambda function that enables to test whether or not an element is filtered

The functor function should have the following form:

class AFilterFunctor {
bool operator()(TYPE a) {
return true if a should be iterated, false if a should be removed;
}
};

Definition at line 46 of file FilterIterator.h.

Member Function Documentation

◆ hasNext()

template<typename TYPE, typename FILTER>
bool tlp::FilterIterator< TYPE, FILTER >::hasNext ( )
inlinevirtual

Tells if the sequence is at its end.

Returns
bool Whether there are more elements to iterate.

Implements tlp::Iterator< TYPE >.

Definition at line 59 of file FilterIterator.h.

+ Here is the call graph for this function:

◆ next()

template<typename TYPE, typename FILTER>
TYPE tlp::FilterIterator< TYPE, FILTER >::next ( )
inlinevirtual

Moves the Iterator on the next element.

Returns
The current element pointed by the Iterator.

Implements tlp::Iterator< TYPE >.

Definition at line 54 of file FilterIterator.h.