Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Helpers for working with iterators based on the pipeline model.
Iterators abstract from the underlying data container and provide the contained data as a source to pull values from. Based on this model, we can build pipelines, with filters, valves, junction points and transforming facilities. The templates in this header enable such, based on the Lumiera Forward Iterator concept. They build on generic programming techniques, thus are intended to be combined at compile time using definitive type information. Contrast this to an iterator model as in Java's Collections, where Iterator is an Interface based on virtual functions. Thus, the basic problem to overcome is the lack of a single common interface, which could serve as foundation for type inference. As a solution, we use a "onion" approach, where a generic base gets configured with an active core, implementing the filtering or processing functionality, while the base class (IterTool) exposes the operations necessary to comply to the Forward Iterator Concept.
bool
test might pull and exhaust the source iterator completely, in an attempt to find the first element passing the predicate test.Definition in file itertools.hpp.
#include "lib/iter-adapter.hpp"
#include "lib/meta/value-type-binding.hpp"
#include "lib/meta/function.hpp"
#include "lib/meta/trait.hpp"
#include "lib/wrapper.hpp"
#include "lib/util.hpp"
#include <functional>
#include <utility>
Classes | |
class | ExtensibleFilterIter< IT > |
Additional capabilities for FilterIter, allowing to extend the filter condition underway. More... | |
struct | FilterCore< IT > |
Implementation of the filter logic. More... | |
class | FilterIter< IT > |
Iterator tool filtering pulled data according to a predicate. More... | |
struct | IdentityCore< IT > |
A neutral identity-function core, also serving as point-of reference how any core is intended to work. More... | |
class | IterTool< CORE > |
Standard functionality to build up any iterator tool. More... | |
class | SingleValCore< VAL > |
Implementation of a singleton value holder, which discards the contained value once "iterated". More... | |
class | SingleValIter< VAL > |
Pseudo-Iterator to yield just a single value. More... | |
class | SkipRepetition< VAL > |
Helper: predicate returning true whenever the argument value changes during a sequence of invocations. More... | |
class | TransformingCore< IT, VAL > |
Implementation of custom processing logic. More... | |
class | TransformIter< IT, VAL > |
Iterator tool treating pulled data by a custom transformation (function) More... | |
Functions | |
template<class IT , class CON > | |
void | append_all (IT iter, CON &container) |
template<class IT , typename PRED > | |
auto | filterIterator (IT const &src, PRED filterPredicate) |
Build a FilterIter: convenience free function shortcut, picking up the involved types automatically. More... | |
template<class IT , typename PRED > | |
auto | filterIterator (IT &&src, PRED filterPredicate) |
template<class IT > | |
auto | filterRepetitions (IT const &source) |
filters away repeated values emitted by source iterator | |
template<class IT > | |
auto | filterRepetitions (IT &&source) |
template<class VAL > | |
auto | nilIterator () |
not-anything-at-all iterator | |
template<class CX > | |
bool | operator!= (IterTool< CX > const &ito1, IterTool< CX > const &ito2) |
template<class CX > | |
bool | operator== (IterTool< CX > const &it1, IterTool< CX > const &it2) |
template<class IT > | |
IT::value_type | pull_last (IT iter) |
template<class VAL > | |
auto | singleValIterator (VAL &&something) |
Build a SingleValIter: convenience free function shortcut, to pick up just any value and wrap it as Lumiera Forward Iterator. More... | |
template<class IT , typename FUN > | |
auto | transformIterator (IT const &src, FUN processingFunc) |
Build a TransformIter: convenience free function shortcut, picking up the involved types automatically. More... | |
template<class IT , typename FUN > | |
auto | transformIterator (IT &&src, FUN processingFunc) |
Namespaces | |
lib | |
Implementation namespace for support and library code. | |