![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "lib/iter-adapter.hpp"
Another Lumiera Forward Iterator building block, based on incorporating a state type as »*State Core*«, right into the iterator.
Contrast this to IterAdapter, which refers to a managing container behind the scenes. To the contrary, here all of the state is assumed to live in the custom type embedded into this iterator, accessed and manipulated through a dedicated iteration control API exposed as member functions.
When building iterators with the help of IterStateWrapper or IterableAdapter, it is assumed that the adapted state core type represents a process of state evolution, which reaches a well defined end state eventually, but this end state is also the bottom
checkPoint establishes if the given state element represents a valid active stateiterNext evolves this state by one step (sideeffect)yield realises the given state, yielding an element of result type T | ST | type of the »state core«, defaults to T. The resulting iterator will hold an instance of ST, which thus needs to be copyable and default constructible to the extent this is required for the iterator as such. |
| T | (optional) result type, usually deduced from ST::yield |
Definition at line 374 of file iter-adapter.hpp.
Public Types | |
| using | value_type = meta::RefTraits< T >::Value |
| using | reference = meta::RefTraits< T >::Reference |
| using | pointer = meta::RefTraits< T >::Pointer |
Public Member Functions | |
| IterStateWrapper (ST &&initialState) | |
| IterStateWrapper (ST const &initialState) | |
| IterStateWrapper () | |
| operator bool () const | |
| T | operator* () const |
| pointer | operator-> () const |
| IterStateWrapper & | operator++ () |
| bool | isValid () const |
| bool | empty () const |
| ENABLE_USE_IN_STD_RANGE_FOR_LOOPS (IterStateWrapper) | |
Friends | |
| template<class STX , class T1 , class T2 > | |
| bool | operator== (IterStateWrapper< STX, T1 > const &, IterStateWrapper< STX, T2 > const &) |
| comparison is allowed to access state implementation core | |
Protected Member Functions | |
| ST & | stateCore () |
| allow derived classes to access state representation | |
| ST const & | stateCore () const |
| void | __throw_if_empty () const |
Private Attributes | |
| ST | core_ |
|
inline |
Definition at line 383 of file iter-adapter.hpp.
|
inline |
Definition at line 387 of file iter-adapter.hpp.
|
inline |
Definition at line 391 of file iter-adapter.hpp.
| using value_type = meta::RefTraits<T>::Value |
Definition at line 379 of file iter-adapter.hpp.
| using reference = meta::RefTraits<T>::Reference |
Definition at line 380 of file iter-adapter.hpp.
| using pointer = meta::RefTraits<T>::Pointer |
Definition at line 381 of file iter-adapter.hpp.
|
inlineexplicit |
Definition at line 396 of file iter-adapter.hpp.
References IterStateWrapper< ST, T >::isValid().
Here is the call graph for this function:
|
inline |
Definition at line 405 of file iter-adapter.hpp.
References IterStateWrapper< ST, T >::__throw_if_empty(), and IterStateWrapper< ST, T >::core_.
Here is the call graph for this function:
|
inline |
Definition at line 412 of file iter-adapter.hpp.
References IterStateWrapper< ST, T >::__throw_if_empty(), and IterStateWrapper< ST, T >::core_.
Here is the call graph for this function:
|
inline |
Definition at line 426 of file iter-adapter.hpp.
References IterStateWrapper< ST, T >::__throw_if_empty(), and IterStateWrapper< ST, T >::core_.
Here is the call graph for this function:
|
inline |
Definition at line 434 of file iter-adapter.hpp.
References IterStateWrapper< ST, T >::core_.
Referenced by IterStateWrapper< ST, T >::__throw_if_empty(), IterStateWrapper< ST, T >::empty(), Expander< SRC, RES >::invariant(), IterStateWrapper< ST, T >::operator bool(), and lib::operator==().
Here is the caller graph for this function:
|
inline |
Definition at line 440 of file iter-adapter.hpp.
References IterStateWrapper< ST, T >::isValid().
Referenced by lib::operator==().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprotected |
allow derived classes to access state representation
Definition at line 449 of file iter-adapter.hpp.
References IterStateWrapper< ST, T >::core_.
Referenced by CommandQueue::clear().
Here is the caller graph for this function:
|
inlineprotected |
Definition at line 450 of file iter-adapter.hpp.
References IterStateWrapper< ST, T >::core_.
|
inlineprotected |
Definition at line 453 of file iter-adapter.hpp.
References IterStateWrapper< ST, T >::isValid().
Referenced by IterStateWrapper< ST, T >::operator*(), IterStateWrapper< ST, T >::operator++(), and IterStateWrapper< ST, T >::operator->().
Here is the call graph for this function:
Here is the caller graph for this function:| ENABLE_USE_IN_STD_RANGE_FOR_LOOPS | ( | IterStateWrapper< ST, T > | ) |
|
private |
Definition at line 376 of file iter-adapter.hpp.
Referenced by IterStateWrapper< ST, T >::isValid(), IterStateWrapper< ST, T >::operator*(), IterStateWrapper< ST, T >::operator++(), IterStateWrapper< ST, T >::operator->(), lib::operator==(), IterStateWrapper< ST, T >::stateCore(), and IterStateWrapper< ST, T >::stateCore().
|
friend |
comparison is allowed to access state implementation core
Inheritance diagram for IterStateWrapper< ST, T >:
Collaboration diagram for IterStateWrapper< ST, T >: