template<typename T, class COR>
class lib::IterableDecorator< T, COR >
Decorator-Adapter to make a »state core« iterable as Lumiera Forward Iterator.
This is a fundamental (and low-level) building block and works essentially the same as IterStateWrapper — with the significant difference however that the Core is mixed in by inheritance and thus its full interface remains publicly accessible. Another notable difference is that this adapter deliberately performs no sanity-checks. This can be dangerous, but allows to use this setup even in performance critical code.
- Warning
- be sure to understand the consequences of using ´core.yield()´ without checks; it might be a good idea to build safety checks into the Core API functions instead, or to wrap the Core into CheckedCore.
- Template Parameters
-
T | nominal result type (maybe const, but without reference). The resulting iterator will yield a reference to this type T |
COR | type of the »state core«. The resulting iterator will mix-in this type, and thus inherit properties like copy, move, compare, VTable, POD. The COR must implement the following iteration control API:
checkPoint establishes if the given state element represents a valid state
- ´iterNext
evolves this state by one step (sideeffect) -# yieldrealises the given state, exposing a result of type T&`
|
- See also
- IterExplorer a pipeline builder framework on top of IterableDecorator
-
iter-explorer-test.hpp
-
iter-adaptor-test.cpp
Definition at line 599 of file iter-adapter.hpp.