Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
FilterCore< IT > Struct Template Reference

#include "lib/itertools.hpp"

Description

template<class IT>
struct lib::FilterCore< IT >

Implementation of the filter logic.

This core stores a function object instance, passing each pulled source element to this predicate function for evaluation.

Note
predicate is evaluated at most once for each value yielded by the source

Definition at line 279 of file itertools.hpp.

Public Types

using Raw = IdentityCore< IT >
 
using Val = iter::Yield< IT >
 
- Public Types inherited from IdentityCore< IT >
using pointer = IT::pointer
 
using reference = IT::reference
 
using value_type = IT::value_type
 

Public Attributes

function< bool(Val)> predicate_
 
bool cached_
 
bool isOK_
 
- Public Attributes inherited from IdentityCore< IT >
IT source_
 

Public Member Functions

bool evaluate () const
 
bool currVal_isOK () const
 <
 
void advance ()
 
template<typename PRED >
 FilterCore (IT &&source, PRED prediDef)
 
template<typename PRED >
 FilterCore (IT const &source, PRED prediDef)
 
- Public Member Functions inherited from IdentityCore< IT >
 IdentityCore (IT &&orig)
 
 IdentityCore (IT const &orig)
 
IT & pipe ()
 
IT const & pipe () const
 
void advance ()
 
bool evaluate () const
 

Constructor & Destructor Documentation

◆ FilterCore() [1/2]

template<class IT >
template<typename PRED >
FilterCore ( IT &&  source,
PRED  prediDef 
)
inline

Definition at line 316 of file itertools.hpp.

◆ FilterCore() [2/2]

template<class IT >
template<typename PRED >
FilterCore ( IT const &  source,
PRED  prediDef 
)
inline

Definition at line 324 of file itertools.hpp.

Member Typedef Documentation

◆ Raw

template<class IT >
using Raw = IdentityCore<IT>

Definition at line 282 of file itertools.hpp.

◆ Val

template<class IT >
using Val = iter::Yield<IT>

Definition at line 283 of file itertools.hpp.

Member Function Documentation

◆ evaluate()

template<class IT >
bool evaluate ( ) const
inline

Definition at line 289 of file itertools.hpp.

References FilterCore< IT >::currVal_isOK().

+ Here is the call graph for this function:

◆ currVal_isOK()

template<class IT >
bool currVal_isOK ( ) const
inline

<

Returns
(maybe cached) result of filter predicate

Definition at line 300 of file itertools.hpp.

References FilterCore< IT >::cached_, FilterCore< IT >::isOK_, and FilterCore< IT >::predicate_.

Referenced by FilterCore< IT >::evaluate().

+ Here is the caller graph for this function:

◆ advance()

template<class IT >
void advance ( )
inline

Definition at line 308 of file itertools.hpp.

References FilterCore< IT >::cached_.

Member Data Documentation

◆ predicate_

template<class IT >
function<bool(Val)> predicate_

Definition at line 286 of file itertools.hpp.

Referenced by FilterCore< IT >::currVal_isOK().

◆ cached_

template<class IT >
bool cached_
mutable

Definition at line 296 of file itertools.hpp.

Referenced by FilterCore< IT >::advance(), and FilterCore< IT >::currVal_isOK().

◆ isOK_

template<class IT >
bool isOK_
mutable

Definition at line 297 of file itertools.hpp.

Referenced by FilterCore< IT >::currVal_isOK().

+ Inheritance diagram for FilterCore< IT >:
+ Collaboration diagram for FilterCore< IT >:

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