Extension module to build an opaque data source, accessible as Lumiera Forward Iterator.
It is based on combining an IterAdapter with classical polymorphism; here, the data source, which is addressed by IderAdapter through the "iteration control API", is abstracted behind an interface (with virtual functions). Together this allows to build a simple data source type, without needing to disclose details of the implementation.
- Todo:
- the design used for the "iteration control API" is misaligned with the purpose of this adapter. Rather, it should be shaped similar to IterStateWrapper with three control functions //////////////////////////////////////TICKET #1125
Standard Adapters
As a complement, this header contains a generic implementation of the IterSource interface by wrapping an existing Lumiera Forward Iterator. Using this WrappedLumieraIter, the details of this wrapped source iterator remain opaque. To ease the use of this adapter, a selection of free functions is provided, allowing to build opaque "all elements" or "all keys" iterators for various STL containers.
- See also
- iter-adapter.hpp
-
itertool.hpp
-
iter-source-test.cpp
Definition in file iter-source.hpp.
|
| template<class IT > |
| _PairIterT< IT >::KeyIter | takePairFirst (IT &&source) |
| |
| template<class IT > |
| _PairIterT< IT >::ValIter | takePairSecond (IT &&source) |
| |
| template<class IT > |
| _IterT< IT >::Iter | wrapIter (IT &&source) |
| | wraps a given Lumiera Forward Iterator, exposing just a IterSource based frontend.
|
| |
| template<typename VAL > |
| auto | singleVal (VAL &&something) |
| | an IterSource frontend to return just a single value once.
|
| |
| template<class IT , class FUN > |
| _TransformIterT< IT, FUN >::Iter | transform (IT &&source, FUN processingFunc) |
| | pipes a given Lumiera Forward Iterator through a transformation function and wraps the resulting transforming Iterator, exposing just an IterSource.
|
| |
| template<class MAP > |
| _MapT< MAP >::KeyIter | eachMapKey (MAP &map) |
| |
| template<class MAP > |
| _MapT< MAP >::ValIter | eachMapVal (MAP &map) |
| |
| template<class MAP > |
| _MapT< MAP >::KeyIter | eachDistinctKey (MAP &map) |
| |
| template<class MAP > |
| _MapT< MAP >::ValIter | eachValForKey (MAP &map, typename _MapT< MAP >::Key key) |
| |
| template<class CON > |
| _SeqT< CON >::Iter | eachEntry (CON &container) |
| |
| template<class IT > |
| _RangeT< IT >::Iter | eachEntry (IT const &begin, IT const &end) |
| |