From 95b5786798d7b57d841f11e3d74a859d5076d009 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 23 Dec 2017 01:59:31 +0100 Subject: [PATCH] Navigator: consider to work around problems with adapting IterSource - as it stands currently, IterSource has a design problem, (see #1125) - and due to common problems in C++ with mix-ins and extended super interfaces, it is surprisingly tricky to build on an extension of IterSource - thus the idea is to draft a new solution "in green field" by allowing TreeExplorer to adapt IterSource automatically - the new sholution should be templated on the concrete sub interface and ideally even resolve the mix-in-problem by re-linearising the inheritance line, i.e. replace WrappedLumieraIter by something able to wrap its source, in a similar vein as TreeExplorer does --- tests/library/iter-tree-explorer-test.cpp | 34 +++++++++++++++++++++++ wiki/thinkPad.ichthyo.mm | 22 +++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/tests/library/iter-tree-explorer-test.cpp b/tests/library/iter-tree-explorer-test.cpp index eb76ccd59..d12cf70d5 100644 --- a/tests/library/iter-tree-explorer-test.cpp +++ b/tests/library/iter-tree-explorer-test.cpp @@ -272,6 +272,7 @@ namespace test{ verify_combinedExpandTransform(); verify_FilterIterator(); verify_asIterSource(); + verify_IterSource(); verify_depthFirstExploration(); demonstrate_LayeredEvaluation(); @@ -848,6 +849,39 @@ namespace test{ + /** @test ability to wrap and handle IterSource based iteration + * + */ + void + verify_IterSource() + { + class PrivateSource +// : public IterSource /////////////////////////////////////TODO linearised Mix-in problem + { + public: + virtual PrivateSource* expandChildren() const =0; + }; + + class VerySpecivicIter + : public WrappedLumieraIter + , public PrivateSource + { + public: + VerySpecivicIter(uint start) + : WrappedLumieraIter(NumberSequence{start}) + { } + + virtual PrivateSource* + expandChildren() const override + { + return new VerySpecivicIter{*wrappedIter() - 1}; + } + }; + UNIMPLEMENTED ("directly wrap and handle IterSource sub-interfaces"); + } + + + /** @test use a preconfigured exploration scheme to expand depth-first until exhaustion. * This is a simple extension where all elements are expanded automatically. In fact, the * `expandChildren()` operation implies already an iteration step, namely to dispose of the diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index b92f0c85e..bf5984bdb 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -8081,6 +8081,28 @@ + + + + + + + + + + + + + + + + + + + + + +