Invocation: invoke the param-functors and build extension block
Relying basically on the trick to invoke std::apply with a generic variadic Lambda onto the tuple of functors; within the lambda we can use variadic expansion to pass the results directly into the builder and so construct the param-tuple in-place. Oh well. 2024 is almost gone by now. Had to endure yet another performance of Beethoven's 9th symphony...
This commit is contained in:
parent
ee59162418
commit
107d03f6ef
3 changed files with 30 additions and 7 deletions
|
|
@ -113,9 +113,11 @@ namespace engine {
|
|||
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
|
||||
return std::apply ([&](auto&&... paramFun)
|
||||
{ // invoke parameter-functors and build NewFrame from results
|
||||
return ChainCons::build (paramFun (turnoutSys) ...);
|
||||
}
|
||||
,functors_);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -131,6 +131,9 @@ SHOW_EXPR(v0)
|
|||
SHOW_EXPR(v1)
|
||||
|
||||
auto paramBlock = spec.buildParamDataBlock (turnoutSys);
|
||||
SHOW_EXPR(paramBlock)
|
||||
SHOW_EXPR(paramBlock.get<0>())
|
||||
SHOW_EXPR(paramBlock.get<1>())
|
||||
|
||||
TODO ("implement a simple Builder for ParamAgent-Node");
|
||||
TODO ("then use both together to demonstrate a param data feed here");
|
||||
|
|
|
|||
|
|
@ -94325,13 +94325,31 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1735438743590" ID="ID_973914193" MODIFIED="1735438756220" TEXT="Storage-Tupel erzeugen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#f8f1cb" COLOR="#a50125" CREATED="1735492888686" ID="ID_810676585" MODIFIED="1735492933273" TEXT="Problem: Storage-Block is non-copyable">
|
||||
<node COLOR="#338800" CREATED="1735438743590" ID="ID_973914193" MODIFIED="1735512420087" TEXT="Storage-Tupel erzeugen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#435e98" CREATED="1735492888686" ID="ID_810676585" MODIFIED="1735512377642" TEXT="Problem: Storage-Block is non-copyable">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node CREATED="1735512018597" ID="ID_1684262838" MODIFIED="1735512083855" TEXT="Konsequenz: können ihn nicht aus dem Builder in das Turnout-System linken"/>
|
||||
<node CREATED="1735512085990" ID="ID_1280269467" MODIFIED="1735512398065" TEXT="das war aber so zu erwarten (und ich habe das auch akzeptiert)"/>
|
||||
<node CREATED="1735512107979" ID="ID_824666743" MODIFIED="1735512122317" TEXT="ohnehin passiert dieser Schritt im ParamWeavingPattern"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#f8f1cb" COLOR="#a50125" CREATED="1735492909340" ID="ID_1181823322" MODIFIED="1735492933273" TEXT="erzeugen / befüllen ist auch tricky">
|
||||
<node COLOR="#435e98" CREATED="1735492909340" ID="ID_1181823322" MODIFIED="1735512377642" TEXT="erzeugen / befüllen ist auch tricky">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node CREATED="1735512137910" ID="ID_1638187110" MODIFIED="1735512154561" TEXT="deshalb gibt es aber auch diese Cons::build(elms...)-Funktion"/>
|
||||
<node CREATED="1735512156404" ID="ID_1834538695" MODIFIED="1735512274921" TEXT="Lösung: die tuple-Apply-Technik direkt anwenden">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
also den gleichen Kniff, auf dem auch lib::meta::forEach und lib::meta::mapEach beruhen: man wendet per std::apply ein generisches variadisches Lambda auf die Tupel-Elemente an
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
<node CREATED="1735512277618" ID="ID_207555501" MODIFIED="1735512290335" TEXT="spezieller Twist: hier liegen die Param-Funktoren im Tupel"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1735512457951" ID="ID_895202142" MODIFIED="1735512478967" TEXT="im Test bestätigt: funktioniert ☻">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
|
|||
Loading…
Reference in a new issue