Lumiera  0.pre.03
»edit your freedom«
IterChainSearch_test Class Reference

Description

Test:
verify a setup for consecutive searches with backtracking.
  • demonstrate simple consecutive matches and iterator behaviour
  • clear the filter underway and thus return to simple iteration
  • set up two conditions, the second one capturing state at the point where the first one matches
  • wrap a lib::IterCursor, which allows to toggle the search direction underway; this creates a situation where the first options picked do not lead to a successful solution, so the search has to track back, try further options and in each case re-apply all the following consecutive search conditions.
See also
iter-chain-search.hpp
iter-cursor.hpp
usage example

Definition at line 95 of file iter-chain-search-test.cpp.

Private Member Functions

void backtracking ()
 
void chainedIteration ()
 
virtual void run (Arg)
 
void simpleSearch ()
 

Member Function Documentation

◆ simpleSearch()

void simpleSearch ( )
inlineprivate
Test:
simple basic use case.

Definition at line 109 of file iter-chain-search-test.cpp.

References lib::iter::chainSearch().

+ Here is the call graph for this function:

◆ chainedIteration()

void chainedIteration ( )
inlineprivate
Test:
verify consecutive application of several functors on the underlying filter.

In the general case, each step in the chain is a function working on a copy of the current filter state. Since each such step configures its own copy of the complete pipeline, it may reconfigure this filter pipeline in arbitrary ways. After exhausting the last layer, the evaluation returns to the previous layer, but immediately re-applies the configuration step on the then next element.

Definition at line 144 of file iter-chain-search-test.cpp.

References lib::iter::chainSearch().

+ Here is the call graph for this function:

◆ backtracking()

void backtracking ( )
inlineprivate
Test:
verify a complex search with backtracking.

This becomes relevant when a given search condition can be "too greedy" for the complete chain to succeed. Most notably this is the case when the search is fundamentally reconfigured in some steps, e.g. by switching the search orientation. To demonstrate this, we use a "gear switching" iterator, which allows us to reverse the direction and to search backwards from the current position. We configure the second condition in the chain such that it can not succeed when starting from the first match on the first condition

Definition at line 182 of file iter-chain-search-test.cpp.

+ Inheritance diagram for IterChainSearch_test:
+ Collaboration diagram for IterChainSearch_test:

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