template<class SRC, class RES>
class lib::iter_explorer::Expander< SRC, RES >
Decorator for IterExplorer adding the ability to "expand children". The expandChildren() operation is the key element of a depth-first evaluation: it consumes one element and performs a preconfigured expansion functor on that element to yield its "children". These are given in the form of another iterator, which needs to be compatible to the source iterator ("compatibility" boils down to both iterators yielding a compatible value type). Now, this sequence of children effectively replaces the expanded source element in the overall resulting sequence; which means, the nested sequence was flattened into the results. Since this expand() operation can again be invoked on the results, the implementation of such an evaluation requires a stack datastructure, so the nested iterator from each expand() invocation can be pushed to become the new active source for iteration. Thus the primary purpose of this Expander (decorator) is to integrate those "nested child iterators" seamlessly into the overall iteration process; once a child iterator is exhausted, it will be popped and iteration continues with the previous child iterator or finally with the source iterator wrapped by this decorator. The source pipeline is only pulled once the expanded children are exhausted.
- Template Parameters
-
SRC | the wrapped source iterator, typically a IterExplorer or nested decorator. |
FUN | the concrete type of the functor passed. Will be dissected to find the signature |
Definition at line 560 of file iter-explorer.hpp.