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

#include "lib/iter-explorer.hpp"

Description

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

Decorator for IterExplorer to cut iteration once a predicate ceases to be true. Similar to Filter, the given functor is adapted as appropriate, yet is required to yield a bool convertible result. The functor will be evaluated whenever the »exhausted« state of the resulting iterator is checked, on each access and before iteration; this evaluation is not cached (and thus could also detect ongoing state changes by side-effect).

Note
usually an exhausted iterator will be abandoned — however, since the test is not cached, the iterator might become active again, if for some reason the condition becomes true again (e.g. as result of expandChildern())

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

Public Member Functions

template<typename FUN >
 StopTrigger (SRC &&dataSrc, FUN &&condition)
 
bool checkPoint () const
 adapt the iteration control API for IterableDecorator: check the stop condition first and block eventually
 
- Public Member Functions inherited from IterStateCore< SRC >
bool checkPoint () const
 
void iterNext ()
 
SRC ::reference yield () const
 

Private Types

using Cond = function< bool(SRC &)>
 
using Core = IterStateCore< SRC >
 

Private Attributes

Cond whileCondition_
 

Additional Inherited Members

- Protected Member Functions inherited from IterStateCore< SRC >
SRC & srcIter () const
 
+ Inheritance diagram for StopTrigger< SRC >:
+ Collaboration diagram for StopTrigger< SRC >:

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