![]() |
Lumiera 0.pre.04
»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. | |
| void | iterNext () |
| IterChainSearch & | operator++ () |
| template<typename FUN > | |
| IterChainSearch && | addStep (FUN &&configureSearchStep) |
| configure additional chained search condition. | |
| template<typename FUN > | |
| disable_if< is_convertible< FUN, Value >, IterChainSearch && > | search (FUN &&filterPredicate) |
| attach additional search with the given filter predicate. | |
| IterChainSearch && | search (Value target) |
| attach additional direct search for a given value. | |
| IterChainSearch && | clearFilter () |
| drop all search condition frames. | |
Private Types | |
| using | _Trait = _IterChainSetup< SRC > |
| using | _Base = _Trait::Pipeline |
| using | Value = _Base::value_type |
| using | Filter = _Trait::Filter |
| using | Step = _Trait::StepFunctor |
Private Member Functions | |
| bool | needsExpansion () const |
Private Attributes | |
| std::vector< Step > | stepChain_ |
| Storage for a sequence of filter configuration functors. | |
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.
|
private |
Definition at line 152 of file iter-chain-search.hpp.
|
private |
Definition at line 153 of file iter-chain-search.hpp.
|
private |
Definition at line 155 of file iter-chain-search.hpp.
|
private |
Definition at line 156 of file iter-chain-search.hpp.
|
private |
Definition at line 157 of file iter-chain-search.hpp.
|
inlineprivate |
Definition at line 164 of file iter-chain-search.hpp.
References IterChainSearch< SRC >::stepChain_.
Referenced by IterChainSearch< SRC >::iterNext().
Here is the caller graph for this function:
|
inline |
Definition at line 190 of file iter-chain-search.hpp.
References IterChainSearch< SRC >::needsExpansion(), and IterChainSearch< SRC >::stepChain_.
Referenced by IterChainSearch< SRC >::addStep(), and IterChainSearch< SRC >::operator++().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 206 of file iter-chain-search.hpp.
References IterChainSearch< SRC >::iterNext().
Here is the call graph for this function:
|
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.
References IterChainSearch< SRC >::iterNext(), and IterChainSearch< SRC >::stepChain_.
Referenced by IterChainSearch< SRC >::search().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 IterChainSearch< SRC >::addStep().
Referenced by IterChainSearch< SRC >::search().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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.
References IterChainSearch< SRC >::search().
Here is the call graph for this function:
|
inline |
drop all search condition frames.
Definition at line 283 of file iter-chain-search.hpp.
References IterChainSearch< SRC >::stepChain_.
|
private |
Storage for a sequence of filter configuration functors.
Definition at line 160 of file iter-chain-search.hpp.
Referenced by IterChainSearch< SRC >::addStep(), IterChainSearch< SRC >::clearFilter(), IterChainSearch< SRC >::iterNext(), and IterChainSearch< SRC >::needsExpansion().
Inheritance diagram for IterChainSearch< SRC >:
Collaboration diagram for IterChainSearch< SRC >: