Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/iter-chain-search.hpp"
Iterator based linear search mechanism, with the ability to perform consecutive search with backtracking.
The IterChainSearch can be configured with a sequence of search goals (filter conditions), and will apply these in succession on the underlying iterator. It will search by linear search for the first hit of the first condition, and then continue to search from there matching on the second condition, and so on. After the first combination of matches is exhausted, the search will backtrack and try to evaluate the next combination, leading to a tree of on-demand search solutions.
Definition at line 149 of file iter-chain-search.hpp.
Public Member Functions | |
template<class SEQ > | |
IterChainSearch (SEQ &&srcData) | |
Build a chain-search mechanism based on the given source data sequence. More... | |
template<typename FUN > | |
IterChainSearch && | addStep (FUN &&configureSearchStep) |
configure additional chained search condition. More... | |
IterChainSearch && | clearFilter () |
drop all search condition frames. More... | |
void | iterNext () |
IterChainSearch & | operator++ () |
template<typename FUN > | |
disable_if< is_convertible< FUN, Value >, IterChainSearch &&> | search (FUN &&filterPredicate) |
attach additional search with the given filter predicate. More... | |
IterChainSearch && | search (Value target) |
attach additional direct search for a given value. More... | |
Private Member Functions | |
bool | needsExpansion () const |
Private Attributes | |
std::vector< Step > | stepChain_ |
Storage for a sequence of filter configuration functors. | |
|
inlineexplicit |
Build a chain-search mechanism based on the given source data sequence.
begin()
, end()
) iterators is retrieved; the latter is also the reason why a rvalue reference to STL container is rejected, since the container needs to reside elsewhere; only the iterator is wrapped here. Definition at line 178 of file iter-chain-search.hpp.
References lib::iter::anonymous_namespace{iter-chain-search.hpp}::buildChainExplorer().
|
inline |
configure additional chained search condition.
a | manipulation functor void(Filter&) , which works on the current filter to possibly change its configuration. |
Filter&
is used for instantiation Definition at line 230 of file iter-chain-search.hpp.
|
inline |
attach additional search with the given filter predicate.
After successfully searching for all the conditions currently in the filter chain, the embedded iterator will finally be pulled until matching the given target value.
Definition at line 256 of file iter-chain-search.hpp.
References steam::mobject::session::test::anonymous_namespace{scope-query-test.cpp}::filter().
|
inline |
attach additional direct search for a given value.
After successfully searching for all the conditions currently in the filter chain, the embedded iterator will finally be pulled until matching the given target value.
Definition at line 271 of file iter-chain-search.hpp.
|
inline |
drop all search condition frames.
Definition at line 283 of file iter-chain-search.hpp.