Lumiera  0.pre.03
»edit your freedom«
Filter< SRC > Class Template Reference

#include "lib/iter-explorer.hpp"

Description

template<class SRC>
class lib::iter_explorer::Filter< SRC >

Decorator for IterExplorer to filter elements based on a predicate. Similar to the Transformer, the given functor is adapted as appropriate. However, we require the functor's result type to be convertible to bool, to serve as approval test. The filter predicate and thus the source iterator is evaluated eagerly, to establish the invariant of this class: if a "current element" exists, it has already been approved.

Definition at line 1085 of file iter-explorer.hpp.

Public Member Functions

template<typename FUN >
 Filter (SRC &&dataSrc, FUN &&filterFun)
 
bool checkPoint () const
 
void expandChildren ()
 refresh state when other layers manipulate the source sequence. More...
 
void iterNext ()
 
SRC::reference yield () const
 

Protected Types

using FilterPredicate = function< bool(SRC &)>
 

Protected Member Functions

bool isDisabled () const
 
void pullFilter ()
 
SRC & srcIter () const
 

Protected Attributes

FilterPredicate predicate_
 

Member Function Documentation

◆ expandChildren()

void expandChildren ( )
inline

refresh state when other layers manipulate the source sequence.

Note
possibly pulls to re-establish the invariant

Definition at line 1112 of file iter-explorer.hpp.

◆ pullFilter()

void pullFilter ( )
inlineprotected
Note
establishes the invariant: whatever the source yields as current element, has already been approved by our predicate

Definition at line 1157 of file iter-explorer.hpp.

+ Inheritance diagram for Filter< SRC >:
+ Collaboration diagram for Filter< SRC >:

The documentation for this class was generated from the following file: