From 38a1aad897a2eed750f2ee7eb9431b78393e1c7d Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 15 Sep 2018 04:19:08 +0200 Subject: [PATCH] ChainSearch: bugfixes on reworked construction ...seems basically sane now. Just we still need to wrap it one more time into IterableDecorator; which means the overall scheme how to build and package the whole pipeline is not correct yet. Maybe it is not possible to get it packaged all into one single class? --- src/lib/iter-chain-search.hpp | 5 +- tests/library/iter-chain-search-test.cpp | 2 +- wiki/thinkPad.ichthyo.mm | 61 +++++++++++++++++++----- 3 files changed, 53 insertions(+), 15 deletions(-) diff --git a/src/lib/iter-chain-search.hpp b/src/lib/iter-chain-search.hpp index 0c58798ce..6332fa2b2 100644 --- a/src/lib/iter-chain-search.hpp +++ b/src/lib/iter-chain-search.hpp @@ -153,11 +153,12 @@ namespace iter { iterNext() { _Base::__throw_if_empty(); - while (_Base::depth() < stepChain_.size() // Backtracking loop: attempt to establish all conditions + uint depth; + while (stepChain_.size() > (depth=_Base::depth()) // Backtracking loop: attempt to establish all conditions and _Base::checkPoint()) // possibly trying further combinations until success: { _Base::expandChildren(); // create copy of current filter embedded into child level - stepChain_[_Base::depth()] (_Base::accessCurrentChildIter()); // invoke step functor to reconfigure this filter... + stepChain_[depth] (_Base::accessCurrentChildIter()); // invoke step functor to reconfigure this filter... _Base::dropExhaustedChildren(); // which thereby might become empty } } diff --git a/tests/library/iter-chain-search-test.cpp b/tests/library/iter-chain-search-test.cpp index bfd03e752..8d30fed75 100644 --- a/tests/library/iter-chain-search-test.cpp +++ b/tests/library/iter-chain-search-test.cpp @@ -155,7 +155,7 @@ namespace test{ ///////////////////////////////////////////////////TODO WIP CHECK (search); - search.addStep([](auto filter) + search.addStep([](auto& filter) { string currVal = *filter; filter.setNewFilter ([=](string const& val){ diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index e5b65fe5a..3e5a22242 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -32333,22 +32333,22 @@ - - + + - - - - + + + + - - + + @@ -32372,8 +32372,45 @@ + + + + + + +

+ denn: TreeExplorer == IterableDecorator< Pipeline > +

+ + +
+ + + + + + + +

+ der oberste Layer, also hier IterChainSearch +

+

+ ist selbst ein StateCore. Also brauche ich noch einen Dekocator +

+

+ Wenn der fehlt, wird der nächste darunterliegende Decorator gepullt, +

+

+ und der wickellt direkt den Expander ein +

+ + +
+
- + +
+ @@ -32385,9 +32422,9 @@ - - - + + +