Overview     Modules     Class Hierarchy     Classes     Members  
tlp::FilterIterator< TYPE, FILTER > Class Template Reference

Iterator that enables to filter an other Iterator. More...

#include <filteriterator.h>

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

List of all members.

Public Member Functions


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 that enables to test wheter or not an element is filtered

The functor function shoul have the following form

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

Constructor & Destructor Documentation

template<typename TYPE , typename FILTER >
tlp::FilterIterator< TYPE, FILTER >::FilterIterator ( Iterator< TYPE > *  it,
FILTER  filter 
) [inline]
template<typename TYPE , typename FILTER >
tlp::FilterIterator< TYPE, FILTER >::~FilterIterator ( ) [inline]

Member Function Documentation

template<typename TYPE , typename FILTER >
bool tlp::FilterIterator< TYPE, FILTER >::hasNext ( ) [inline, virtual]

Tells if the sequence is at its end.

Returns:
bool Whether there are more elements to iterate on.

Implements tlp::Iterator< TYPE >.

template<typename TYPE , typename FILTER >
TYPE tlp::FilterIterator< TYPE, FILTER >::next ( ) [inline, virtual]

Moves the Iterator on the next element.

Returns:
The current element pointed by the Iterator.

Implements tlp::Iterator< TYPE >.



Tulip Software by LaBRI Visualization Team    2001 - 2012