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
This commit is contained in:
parent
9f171682ce
commit
95b5786798
2 changed files with 56 additions and 0 deletions
|
|
@ -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<uint> /////////////////////////////////////TODO linearised Mix-in problem
|
||||
{
|
||||
public:
|
||||
virtual PrivateSource* expandChildren() const =0;
|
||||
};
|
||||
|
||||
class VerySpecivicIter
|
||||
: public WrappedLumieraIter<NumberSequence>
|
||||
, 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
|
||||
|
|
|
|||
|
|
@ -8081,6 +8081,28 @@
|
|||
<node CREATED="1513986085162" ID="ID_1791331544" MODIFIED="1513986090214" TEXT="von außen daran kommen"/>
|
||||
<node CREATED="1513986090946" ID="ID_668980524" MODIFIED="1513986103340" TEXT="und auch noch downcasten auf TreeStructureNavigator"/>
|
||||
</node>
|
||||
<node CREATED="1513988678091" ID="ID_787175675" MODIFIED="1513988732759" TEXT="Pragmatismus-Trip">
|
||||
<icon BUILTIN="idea"/>
|
||||
<node CREATED="1513988687617" ID="ID_1652718385" MODIFIED="1513988692411" TEXT="nicht jetzt lösen">
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
<node CREATED="1513988694704" ID="ID_1570679085" MODIFIED="1513988710933" TEXT="das wäre ein Komplett-Umbau von IterSource">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
</node>
|
||||
<node COLOR="#174e54" CREATED="1513988715838" ID="ID_1398933111" MODIFIED="1513989057765" TEXT="stattdessen: Vorentwurf auf die grüne Wiese">
|
||||
<arrowlink COLOR="#1f9aa8" DESTINATION="ID_1242119956" ENDARROW="Default" ENDINCLINATION="87;-111;" ID="Arrow_ID_662359263" STARTARROW="None" STARTINCLINATION="-259;16;"/>
|
||||
<font ITALIC="true" NAME="SansSerif" SIZE="12"/>
|
||||
<icon BUILTIN="licq"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1513988744665" HGAP="27" ID="ID_1242119956" MODIFIED="1513989064956" TEXT="vorläufige IterSource-Integration" VSHIFT="12">
|
||||
<linktarget COLOR="#1f9aa8" DESTINATION="ID_1242119956" ENDARROW="Default" ENDINCLINATION="87;-111;" ID="Arrow_ID_662359263" SOURCE="ID_1398933111" STARTARROW="None" STARTINCLINATION="-259;16;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node CREATED="1513988930537" ID="ID_594152265" MODIFIED="1513988942954" TEXT="kann selbständig Iterator-Front-End bauen"/>
|
||||
<node CREATED="1513988952901" ID="ID_1668656742" MODIFIED="1513988971647" TEXT="dieses Front-End hat Zugang zum konkreten Sub-Interface"/>
|
||||
<node CREATED="1513988974179" ID="ID_900695722" MODIFIED="1513989005434" TEXT="Funktoren können dieses Sub-Interface akzeptieren und liefern"/>
|
||||
<node CREATED="1513989030587" ID="ID_1529167083" MODIFIED="1513989044189" TEXT="TreeExplorer übernimmt / wrappt / packt aus"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1513962765760" ID="ID_795911284" MODIFIED="1513963084358" TEXT="Demo-Impl mit GenNode-Tree">
|
||||
|
|
|
|||
Loading…
Reference in a new issue