Overview | Modules | Class Hierarchy | Classes | Members

Public Member Functions
tlp::FilterIterator< TYPE, FILTER > Class Template Reference
Iterator | Iterators

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

`#include <filteriterator.h>`

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

List of all members.

## Public Member Functions

- FilterIterator (Iterator< TYPE > *it, FILTER filter)
- ~FilterIterator ()
- TYPE next ()
    Moves the Iterator on the next element.
- bool hasNext ()
    Tells if the sequence is at its end.

## Detailed Description

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

Iterator that enables to filter an other Iterator.

Parameters:

  it | the iterator that should be filtered
  filter | the 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