diff --git a/src/lib/hetero-data.hpp b/src/lib/hetero-data.hpp index 25d273611..986360251 100644 --- a/src/lib/hetero-data.hpp +++ b/src/lib/hetero-data.hpp @@ -204,7 +204,7 @@ namespace lib { /** * Accessor-functor to get at the data residing within some tuple element * Using the enclosing typed scope to ensure safe storage access - * @tparam slot numer of the data element, counting from zero over the full chain + * @tparam slot number of the data element, counting from zero over the full chain * @note this functor holds no data, but shall be applied to some existing HeteroData. */ template diff --git a/src/steam/engine/param-weaving-pattern.hpp b/src/steam/engine/param-weaving-pattern.hpp index 8eba9b5fe..a4d97b00f 100644 --- a/src/steam/engine/param-weaving-pattern.hpp +++ b/src/steam/engine/param-weaving-pattern.hpp @@ -102,6 +102,23 @@ namespace engine { return addSlot ([paramVal](TurnoutSystem&){ return paramVal; }); } + /** @internal the _chain constructor type_ is a type rebinding meta function (nested struct), + * which extends the HeteroData chain given by \a ANK with the sequence of types derived from + * the result-values of all functors stored in the ParamBuildSpec, i.e. the resulting param tuple. + * @remark HeteroData defines a nested struct `Chain`, and with the help of `RebindVariadic`, + * the type sequence from the ParamTup can be used to instantiate this Chain context. + */ + using ChainCons = typename lib::meta::RebindVariadic::Type; + + typename ChainCons::NewFrame + buildParamDataBlock (TurnoutSystem& turnoutSys) + { + auto invoke = [&](auto& fun) { return fun(turnoutSys); }; + ParamTup params = lib::meta::mapEach(functors_, invoke); + //////////////////////////////////////////////////////////////OOO now need to extract them + } + + template class Slot : util::MoveOnly @@ -119,6 +136,17 @@ namespace engine { { return std::get (spec_.functors_) (turnoutSys); } + + /** a getter functor able to work on the full extended HeteroData-Chain + * @remark the front-end of this chain resides in TurnoutSystem */ + using Accessor = typename ChainCons::template Accessor; + static auto makeAccessor() { return Accessor{}; } + + static auto& + getParamVal (TurnoutSystem& turnoutSys) + { + return turnoutSys.get (makeAccessor()); + } }; template diff --git a/src/steam/engine/turnout-system.hpp b/src/steam/engine/turnout-system.hpp index 178b76f03..0538de8da 100644 --- a/src/steam/engine/turnout-system.hpp +++ b/src/steam/engine/turnout-system.hpp @@ -67,6 +67,10 @@ namespace engine { }; private: + template + using Accessor = typename lib::HeteroData::template Accessor; + + FrontBlock invoParam_; public: @@ -79,6 +83,26 @@ namespace engine { { return invoParam_.get(); } + + ProcessKey + getProcKey() + { + return invoParam_.get(); + } + + template + auto& + get (Accessor const& getter) + { + return getter.get (invoParam_); + } + + template + void + attachChainBlock (CHAIN& chainBlock) + { + chainBlock.linkInto (invoParam_); + } }; diff --git a/tests/core/steam/engine/node-feed-test.cpp b/tests/core/steam/engine/node-feed-test.cpp index 688589694..6ef694440 100644 --- a/tests/core/steam/engine/node-feed-test.cpp +++ b/tests/core/steam/engine/node-feed-test.cpp @@ -129,6 +129,9 @@ SHOW_TYPE(Spec::ParamTup) auto v1 = spec.slot<1>().invokeParamFun (turnoutSys); SHOW_EXPR(v0) SHOW_EXPR(v1) + + auto paramBlock = spec.buildParamDataBlock (turnoutSys); + TODO ("implement a simple Builder for ParamAgent-Node"); TODO ("then use both together to demonstrate a param data feed here"); } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index f14640f2d..b5a9ba876 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -94230,7 +94230,10 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + + + + @@ -94315,10 +94318,21 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + + + + + +