21 #ifndef FILTERITERATOR_H
22 #define FILTERITERATOR_H
24 #include <tulip/memorypool.h>
44 template <
typename TYPE,
typename FILTER>
45 class FilterIterator :
public Iterator<TYPE> {
47 FilterIterator(Iterator<TYPE> *it, FILTER filter):
60 inline bool hasNext() {
68 while (_it->hasNext()) {
69 _curVal = _it->next();
71 if (_filter(_curVal)) {
90 template <
typename TYPE,
typename FILTER>
91 class MPFilterIterator :
public FilterIterator<TYPE, FILTER>,
public MemoryPool<MPFilterIterator<TYPE, FILTER> > {
93 MPFilterIterator(Iterator<TYPE> *it, FILTER filter):
94 FilterIterator<TYPE, FILTER>(it, filter) {
99 #endif // FILTERITERATOR_H