From 54dc8cc0326e3927c283a5efd231623e7d50d185 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 10 Dec 2024 01:38:00 +0100 Subject: [PATCH] Invocation: draft accessor and constructor scheme - the Accessor is pretty much obvious: it carries the type from the enclosing scope and delegates to the generic accessor there - the Constructor however is much more challenging, because it must construct the chained type ahead, and prepare a constructor functor that can be applied ''later'' to the actual data chain --- src/lib/hetero-data.hpp | 33 ++++++++-- wiki/thinkPad.ichthyo.mm | 135 ++++++++++++++++++++++++++------------- 2 files changed, 120 insertions(+), 48 deletions(-) diff --git a/src/lib/hetero-data.hpp b/src/lib/hetero-data.hpp index 8413bf183..2e4cb4817 100644 --- a/src/lib/hetero-data.hpp +++ b/src/lib/hetero-data.hpp @@ -56,6 +56,7 @@ namespace lib { struct StorageLoc + : util::NonCopyable { StorageLoc* next{nullptr}; }; @@ -64,9 +65,8 @@ namespace lib { struct StorageFrame : StorageLoc , std::tuple - , util::NonCopyable { - + using std::tuple::tuple; }; /** @@ -74,7 +74,7 @@ namespace lib { template class HeteroData { - + /////////////////////////OOO do we need this as marker for an unspecified front-end? }; template @@ -119,10 +119,22 @@ namespace lib { return accessTail().template get(); } - struct Navigator + template + struct Accessor { + using Type = Elm_t; + template + Type& + get (HeteroData& frontEnd) + { + auto& fullChain = reinterpret_cast<_Self&> (frontEnd); + return fullChain.template get(); + } }; + + template + using Constructor = typename _Tail::template Constructor; }; template<> @@ -130,6 +142,19 @@ namespace lib { { public: static size_t constexpr size() { return 0; } + + template + struct Constructor + { + using Chain = HeteroData, meta::NullType>>; + + template + typename Chain::Frame + operator() (INIT&& ...initArgs) + { + return {initArgs ...}; + } + }; }; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 1417e5252..f467d568c 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -21280,9 +21280,7 @@ - - - +

ViewHooked wird nun zum eigentlichen Front-End @@ -21876,9 +21874,7 @@ - - - +

"the children of your friends ain't necessarily your friends" @@ -22419,9 +22415,7 @@ - - - +

Weil wir die "skip"-Operation für zwei Zwecke verwenden, @@ -23043,9 +23037,7 @@ - - - +

das heißt, nur diese Lösung gründet in der Natur der behandelten Sachverhalte. @@ -24161,9 +24153,7 @@ - - - +

da links->rechts auf die Zeitachse abgebildet ist @@ -25927,9 +25917,7 @@ - - - +

"This interface is used for all single item holding containers. Multi-item containers provide their own unique interface as their items are generally more complex. The methods of the derived classes should be prefered over these..." @@ -29352,9 +29340,7 @@ - - - +

zwei verschachtelte, delegierende Konstruktoren, @@ -33268,9 +33254,7 @@ - - - +

....für den Kreis @@ -37267,9 +37251,7 @@ - - - +

Achtung: abstrakter Entwurf war Ende 2017 in eine Sackgasse geraten.... @@ -39185,9 +39167,7 @@ - - - +

...und das ist eleganter, als jede der denkbaren Alternativen @@ -39947,9 +39927,7 @@ - - - +

Gesamt-Integration der Applikation ist derzeit (2023) viel wichtiger @@ -40472,9 +40450,7 @@ - - - +

  • @@ -40787,9 +40763,7 @@ - - - +

    das ist das Kernstück @@ -40967,9 +40941,7 @@ - - - +

    es kommt eine negative Zahl heraus: IntMax * Scale ⟼ -Scale  (im Nenner) @@ -87865,13 +87837,88 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
    der Umweg über lib::LinkedElements ist überflüssig, zumal ich durch direkte rekursive Implementierung auch noch eine klare Fehlermeldung erzeugen kann, falls ein Nachfolge-Extent noch nicht alloziert wurde

    - -
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +

    + bei Aufruf wird dann der eigentliche Storage-Frame erzeugt und  registriert +

    + + +
    +
    + + + + + + +

    + das heißt, ich kann ihn nur per RVO aus einer Konstruktor-Funktion heraus „abwerfen“ +

    + +
    +
    + + + + +

    + aber danach erst ist die Speicher-Adresse bekannt +

    + +
    +
    + + + + +

    + und diese muß nun in einen Vorgänger-Frame geschrieben werden +

    + + +
    +
    + + + + + + + + + + +