Invocation: introduce optional output buffer

Doing so directly seems to be a better solution than to inject an OutputBufferProvider;
the latter will still be needed, yet will not be part of the regular weaving pattern,
but used directly at top-level to obtain the output `BuffHandle`, which is then
passed to the `Port::weave()` call
This commit is contained in:
Fischlurch 2024-07-31 19:20:44 +02:00
parent 4bda550f68
commit 38dd3a738e
4 changed files with 71 additions and 78 deletions

View file

@ -55,6 +55,7 @@
#include "lib/several.hpp"
#include <vector>
#include <optional>
@ -69,6 +70,7 @@ namespace engine {
class ProcNode;
// typedef ProcNode* PNode;
using ProcNodeRef = std::reference_wrapper<ProcNode>;
using OptionalBuff = std::optional<BuffHandle>;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
class Port
@ -76,7 +78,7 @@ namespace engine {
public:
virtual ~Port(); ///< this is an interface
virtual BuffHandle weave (TurnoutSystem&) =0;
virtual BuffHandle weave (TurnoutSystem&, OptionalBuff =std::nullopt) =0;
};
using PortRef = std::reference_wrapper<Port>;

View file

@ -442,11 +442,13 @@ namespace engine {
}
void
shed (Feed& feed)
shed (Feed& feed, OptionalBuff outBuff)
{
for (uint i=0; i<outTypes.size(); ++i)
{
BuffHandle resultData = outTypes[i].lockBuffer(); //////////////////////////OOO LocalTag for output must be injected here -- just HOW???
BuffHandle resultData =
i == resultSlot and outBuff? *outBuff
: outTypes[i].lockBuffer();
feed.outBuff.createAt(i, move(resultData));
}
feed.connect (leadPort.size(),outTypes.size());
@ -468,7 +470,7 @@ namespace engine {
for (uint i=0; i<outTypes.size(); ++i)
{
feed.outBuff[i].emit();
if (i != feed.resultSlot)
if (i != resultSlot)
feed.outBuff[i].release();
}
ENSURE (resultSlot < CONF::MAX_SIZ, "invalid result buffer configured.");
@ -502,11 +504,11 @@ namespace engine {
* @return a BuffHandle exposing the generated result data
*/
BuffHandle
weave (TurnoutSystem& turnoutSys) override
weave (TurnoutSystem& turnoutSys, OptionalBuff outBuff =std::nullopt) override
{
Feed feed = PAT::mount();
PAT::pull(feed, turnoutSys);
PAT::shed(feed);
PAT::shed(feed, outBuff);
PAT::weft(feed);
return PAT::fix (feed);
}

View file

@ -82,7 +82,6 @@ namespace engine {
std::vector<ProviderRef> providers;
uint resultSlot{0};
bool isOutput{false};
struct ServiceCtx
{
@ -119,16 +118,6 @@ namespace engine {
return move(*this);
}
SimpleWeavingBuilder
markAsOutputNode()
{
maybeFillDefaultProviders (resultSlot+1);
ENSURE (providers.size() > resultSlot);
providers[resultSlot] = ctx.output;
this->isOutput = true;
return move(*this);
}
auto
build()

View file

@ -5609,9 +5609,7 @@
</node>
<node CREATED="1537659527741" ID="ID_856745741" MODIFIED="1679362063141" TEXT="building blocks">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
<b>Definition</b>: speziell konfigurierte und verdrahtete Teil-Komponenten,
@ -5651,9 +5649,7 @@
</node>
<node CREATED="1537961656982" ID="ID_1251358269" MODIFIED="1576282358140" TEXT="frameworks">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
vorbereitete Grundstrukturen f&#252;r immer wiederkehrende Setups
@ -5680,9 +5676,7 @@
</node>
<node CREATED="1537961950003" ID="ID_1083792924" MODIFIED="1576282358140" TEXT="Schema &quot;managing container&quot;">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
...denn das erscheint mir bodenst&#228;ndiger.
@ -6014,9 +6008,7 @@
</node>
<node COLOR="#338800" CREATED="1538696720743" ID="ID_50558236" MODIFIED="1576282358138" TEXT="ersatzlos entfernt">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
CSS gen&#252;gt
@ -6484,9 +6476,7 @@
</node>
<node CREATED="1485902945474" HGAP="-2" ID="ID_269152626" MODIFIED="1576282358134" TEXT="L&#xf6;sungs-Detail: dynamisch koppeln" VSHIFT="19">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
...meint:
@ -7150,9 +7140,7 @@
</node>
<node CREATED="1506180752098" ID="ID_1971122985" MODIFIED="1576282358130" TEXT="can be a anchored">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
...by interpolation of some wildcards
@ -8516,9 +8504,7 @@
<node CREATED="1510365961732" ID="ID_1589378310" MODIFIED="1510365980084" TEXT="return x = \s -&gt; (x, s) "/>
<node CREATED="1510365961733" FOLDED="true" ID="ID_188006936" MODIFIED="1512926191735">
<richcontent TYPE="NODE"><html>
<head>
</head>
<head/>
<body>
<p>
m &gt;&gt;= f = \r -&gt; let (x, s) = m r
@ -11623,9 +11609,7 @@
</node>
<node CREATED="1513961838174" ID="ID_579783999" MODIFIED="1513962463112" TEXT="Verh&#xe4;ltnis der VTable-APIs noch unklar">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
Was ist <b>Nav</b>&#160;und was ist <b>Iteration-control</b>?
@ -16197,9 +16181,7 @@
<node CREATED="1504834569831" ID="ID_1909335075" MODIFIED="1518487921074" TEXT="maximal 2 Viewer Panel"/>
<node CREATED="1504883107916" ID="ID_1351734300" MODIFIED="1518487921074">
<richcontent TYPE="NODE"><html>
<head>
</head>
<head/>
<body>
<p>
alloc = limitPerWindow(2)
@ -16223,9 +16205,7 @@
<node CREATED="1504833572687" ID="ID_715257949" MODIFIED="1533608413811" TEXT="(Asset)Bin">
<node CREATED="1504834228100" ID="ID_189081279" MODIFIED="1518487921074">
<richcontent TYPE="NODE"><html>
<head>
</head>
<head/>
<body>
<p>
im Asset-Panel der <i>jeweiligen</i>&#160;Gruppe hinzuf&#252;gen
@ -16235,9 +16215,7 @@
</node>
<node CREATED="1504883110076" ID="ID_199732103" MODIFIED="1518487921074">
<richcontent TYPE="NODE"><html>
<head>
</head>
<head/>
<body>
<p>
alloc = unlimited
@ -16259,9 +16237,7 @@
<node CREATED="1504834859584" ID="ID_693499241" MODIFIED="1518487921074" TEXT="im aktuellen Infobox-Panel"/>
<node CREATED="1504883112068" ID="ID_308640581" MODIFIED="1518487921074">
<richcontent TYPE="NODE"><html>
<head>
</head>
<head/>
<body>
<p>
alloc = limitPerWindow(1)
@ -16289,9 +16265,7 @@
<node CREATED="1504880685783" ID="ID_1363213536" MODIFIED="1518487921075" TEXT="vom Speziellsten zum Allgemeinen"/>
<node CREATED="1504880722394" ID="ID_1620814124" MODIFIED="1561827465196">
<richcontent TYPE="NODE"><html>
<head>
</head>
<head/>
<body>
<p>
Voraussetzung: <i>Anwendbarkeit</i>&#160;erkennen
@ -51653,9 +51627,7 @@
<icon BUILTIN="button_ok"/>
<node COLOR="#338800" CREATED="1491008088699" ID="ID_1501876595" MODIFIED="1576282357991" TEXT="Basisfall l&#xe4;uft noch nicht">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
die Instanz kommt nicht in der Fixture-Queue an
@ -51668,9 +51640,7 @@
<icon BUILTIN="button_ok"/>
<node CREATED="1491498978878" ID="ID_1001760576" MODIFIED="1576282357991" TEXT="nicht direkt">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
der Umstand, da&#223; Commands auch ausgef&#252;hrt werdern k&#246;nnen,
@ -51683,9 +51653,7 @@
</node>
<node CREATED="1491499005954" ID="ID_1944400975" MODIFIED="1576282357990" TEXT="aber im Hinblick auf den Lebenszyklus">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
...denn ein Command geht dann in die Queue
@ -51719,9 +51687,7 @@
</node>
<node CREATED="1491753170924" ID="ID_1947747818" MODIFIED="1576282357989" TEXT="Command-Zugriff ist by value">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
...aus gutem Grund
@ -51759,9 +51725,7 @@
</node>
<node CREATED="1491753354116" ID="ID_1070880433" MODIFIED="1576282357989" TEXT="Bus + CommandHandler + GenNode">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
aber sich mit einem Refcount verr&#252;ckt machen.....
@ -51781,9 +51745,7 @@
<node CREATED="1491659224630" ID="ID_837055372" MODIFIED="1491659238608" TEXT="Entscheidung anhand der Command-ID"/>
<node CREATED="1491694300867" ID="ID_1838809343" MODIFIED="1576282357988" TEXT="Festlegung: CommandID wird als Symbol entgegengenommen">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
....k&#252;nftige Weiterung:
@ -51799,9 +51761,7 @@
</node>
<node CREATED="1491659382161" ID="ID_948768193" MODIFIED="1576282357988" TEXT="Performance: maybeGet">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<head/>
<body>
<p>
da dieser Zugriff wirklich f&#252;r jedes Command passiert,
@ -88916,10 +88876,36 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
</html></richcontent>
<arrowlink COLOR="#ff2d7f" DESTINATION="ID_327945127" ENDARROW="Default" ENDINCLINATION="3056;127;" ID="Arrow_ID_824161116" STARTARROW="None" STARTINCLINATION="309;-17;"/>
</node>
<node CREATED="1722444761326" ID="ID_1520971495" MODIFIED="1722445151092" TEXT="man k&#xf6;nnte tats&#xe4;chlich den Aufruf mit zus&#xe4;tzlichem Argument erm&#xf6;glichen">
<richcontent TYPE="NOTE"><html>
<head/>
<body>
<p>
dieser w&#252;rde dann nur von top-Level aus so erfolgen, womit der Spezialfall ganz nat&#252;rlich ausgew&#228;hlt w&#228;re
</p>
</body>
</html>
</richcontent>
</node>
</node>
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1722393034722" ID="ID_1964241515" MODIFIED="1722393053508" TEXT="Eine Nacht dar&#xfc;ber schlafen!">
<icon BUILTIN="yes"/>
</node>
<node CREATED="1722444566657" ID="ID_901551782" MODIFIED="1722444590633" TEXT="Es gen&#xfc;gt, den OutputBufferProvider anders einzubinden">
<node CREATED="1722444599708" ID="ID_502437622" MODIFIED="1722444698749" TEXT="das Konzept als Solches ist in Ordnung">
<richcontent TYPE="NOTE"><html>
<head/>
<body>
<p>
...d.h. da&#223; man das Output-Protokoll hinter einem BufferProvider versteckt, um einen uniformen Zugriff zu erm&#246;glichen.
</p>
</body>
</html>
</richcontent>
</node>
<node CREATED="1722444704965" ID="ID_329807269" MODIFIED="1722444730742" TEXT="Aber: nicht den BufferProvider austauschen, sondern blo&#xdf; das BuffHandle"/>
<node CREATED="1722445156984" ID="ID_204443476" MODIFIED="1722445177473" TEXT="der spezielle BufferProvider w&#xfc;rde au&#xdf;erhalb, im Top-Level verwendet"/>
</node>
</node>
</node>
<node COLOR="#5b280f" CREATED="1722379006311" ID="ID_665293589" MODIFIED="1722380080995" TEXT="M&#xf6;glichkeit-4 ist oberfl&#xe4;chlich clever &#x2014; aber inhaltlich inkonsequent">
@ -88999,9 +88985,10 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
<arrowlink COLOR="#3159bc" DESTINATION="ID_1809654586" ENDARROW="Default" ENDINCLINATION="151;-415;" ID="Arrow_ID_946061354" STARTARROW="None" STARTINCLINATION="-305;0;"/>
<font BOLD="true" NAME="SansSerif" SIZE="12"/>
<node CREATED="1722384774724" ID="ID_231403168" MODIFIED="1722384802636" TEXT="das bestehende API f&#xfc;r Output-Management deckt diesen Fall bereits komplett ab"/>
<node CREATED="1722384803792" ID="ID_450967698" MODIFIED="1722384876816" TEXT="es gen&#xfc;gt, ein zus&#xe4;tzliches LocalTag beim Belegen des speziellen Output-&#xbb;Slot&#xab; mit zugeben">
<node CREATED="1722384803792" ID="ID_450967698" MODIFIED="1722445233553" TEXT="es gen&#xfc;gt, ein zus&#xe4;tzliches LocalTag in das Typ-Feld f&#xfc;r das BuffHandle einzubauen">
<linktarget COLOR="#8c1444" DESTINATION="ID_450967698" ENDARROW="Default" ENDINCLINATION="-313;-10;" ID="Arrow_ID_414353144" SOURCE="ID_128884200" STARTARROW="None" STARTINCLINATION="-367;0;"/>
</node>
<node CREATED="1722445242908" ID="ID_1389873312" MODIFIED="1722445279859" TEXT="allerdings wird dieses speziell pr&#xe4;parierte BuffHandle besser direkt eingef&#xfc;gt"/>
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1722384890441" ID="ID_438526459" MODIFIED="1722385120612" TEXT="zu kl&#xe4;ren bleibt: wie wird diese Info genau eingebunden?">
<arrowlink COLOR="#932840" DESTINATION="ID_657216791" ENDARROW="Default" ENDINCLINATION="103;-2;" ID="Arrow_ID_1546346335" STARTARROW="None" STARTINCLINATION="-431;18;"/>
<icon BUILTIN="help"/>
@ -89083,6 +89070,19 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
</node>
</node>
</node>
<node CREATED="1722445295029" ID="ID_1963170563" MODIFIED="1722445346948" TEXT="also: gar nicht markieren &#x2014; sondern &#xfc;bersteuern">
<richcontent TYPE="NOTE"><html>
<head/>
<body>
<p>
die Ausnahme &#252;berhaupt gar nicht &#252;ber die Konfiguration/Verdrahtung einf&#252;hren, sondern direkt in den Aufruf
</p>
</body>
</html></richcontent>
<node CREATED="1722445348793" ID="ID_1622065787" MODIFIED="1722445364447" TEXT="zus&#xe4;tzliches Argument: optional&lt;BuffHandle&gt;"/>
<node CREATED="1722445366619" ID="ID_1805188384" MODIFIED="1722445398466" TEXT="wenn gegeben &#x27f9; der f&#xfc;r den Slot konfigurierte BufferProvider wird &#xfc;berhaupt nicht verwendet"/>
<node CREATED="1722445400526" ID="ID_270562222" MODIFIED="1722445411968" TEXT="daf&#xfc;r ist nur ein einziger Eingriff in shed() notwendig"/>
</node>
</node>
</node>
</node>