67#ifndef SRC_LIB_ITER_CHAIN_SEARCH_H
68#define SRC_LIB_ITER_CHAIN_SEARCH_H
96 return explore (forward<SRC> (dataSource))
112 .expand ([](
auto it){
return it; });
150 :
public _IterChainSetup<SRC>::Pipeline
157 using Step = _Trait::StepFunctor;
179 :
_Base{buildChainExplorer (forward<SEQ> (srcData))}
181 _Base::disableFilter();
192 _Base::__throw_if_empty();
196 and _Base::checkPoint())
198 uint depth =_Base::depth();
199 _Base::expandChildren();
200 stepChain_[depth] (_Base::accessCurrentChildIter());
201 _Base::dropExhaustedChildren();
228 template<
typename FUN>
232 if (not this->empty())
234 Step nextStep{forward<FUN> (configureSearchStep)};
236 if (_Base::isDisabled())
253 template<
typename FUN>
254 disable_if<is_convertible<FUN, Value>,
258 addStep ([predicate{forward<FUN> (filterPredicate)}]
261 filter.setNewFilter (predicate);
273 search ([target](
Value const& currVal) {
return currVal == target; });
286 _Base::rootCurrent();
287 _Base::disableFilter();
Iterator based linear search mechanism, with the ability to perform consecutive search with backtrack...
IterChainSearch && search(Value target)
attach additional direct search for a given value.
_IterChainSetup< SRC > _Trait
IterChainSearch && addStep(FUN &&configureSearchStep)
configure additional chained search condition.
std::vector< Step > stepChain_
Storage for a sequence of filter configuration functors.
disable_if< is_convertible< FUN, Value >, IterChainSearch && > search(FUN &&filterPredicate)
attach additional search with the given filter predicate.
IterChainSearch && clearFilter()
drop all search condition frames.
bool needsExpansion() const
IterChainSearch(SEQ &&srcData)
Build a chain-search mechanism based on the given source data sequence.
IterChainSearch & operator++()
Lumiera error handling (C++ interface).
Building tree expanding and backtracking evaluations within hierarchical scopes.
auto buildChainExplorer(SRC &&dataSource)
define the chained-search mechanism: invoking filter.expandChildren() adds a new layer with the copy ...
decltype(buildChainExplorer(std::declval< SRC >())) Pipeline
decltype(buildSearchFilter(std::declval< SRC >()).asIterator()) Filter
auto buildSearchFilter(SRC &&dataSource)
std::function< void(Filter &)> StepFunctor
each step in the chain is a functor to reconfigure the underlying filter
auto chainSearch(SRC &&srcData)
setup a chain search configuration by suitably wrapping the given container.
Implementation namespace for support and library code.
auto explore(IT &&srcSeq)
start building a IterExplorer by suitably wrapping the given iterable source.