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

#include "lib/iter-explorer.hpp"

Description

template<class SRC, class RES>
class lib::iter_explorer::Transformer< SRC, RES >

Decorator for IterExplorer to map a transformation function on all results. The transformation function is invoked on demand, and only once per item to be treated, storing the treated result into an universal value holder buffer. The given functor is adapted in a similar way as the "expand functor", so to detect and convert the expected input on invocation.

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

Public Types

using pointer = typename meta::ValueTypeBinding< RES >::pointer
 
using reference = typename meta::ValueTypeBinding< RES >::reference
 
using value_type = typename meta::ValueTypeBinding< RES >::value_type
 

Public Member Functions

template<typename FUN >
 Transformer (SRC &&dataSrc, FUN &&transformFunctor)
 
bool checkPoint () const
 
void expandChildren ()
 refresh state when other layers manipulate the source sequence More...
 
void iterNext ()
 
reference yield () const
 

Private Types

using TransformedItem = wrapper::ItemWrapper< RES >
 
using TransformFunctor = function< RES(SRC &)>
 

Private Member Functions

reference invokeTransformation ()
 
SRC & srcIter () const
 

Private Attributes

TransformFunctor trafo_
 
TransformedItem treated_
 

Member Function Documentation

◆ expandChildren()

void expandChildren ( )
inline

refresh state when other layers manipulate the source sequence

Remarks
expansion replaces the current element by a sequence of "child" elements. Since we cache our transformation, we need to ensure possibly new source elements get processed

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

+ Inheritance diagram for Transformer< SRC, RES >:
+ Collaboration diagram for Transformer< SRC, RES >:

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