Invocation: prepare mechanism for default input wiring
The intention is to offer an automatic 1:1 association between the »input parameter slots« of the processing function and the ''lead nodes,'' thereby always using the same default port, corresponding to the current port number under construction. Unfortunately, the preceding refactoring removed the information necessary for a simple implementation, as the port array is now built up late, in the final build() function...
This commit is contained in:
parent
0144049f9d
commit
43373e11e7
3 changed files with 138 additions and 39 deletions
|
|
@ -278,6 +278,7 @@ namespace engine {
|
|||
using _Par = PortBuilderRoot<POL,DAT>;
|
||||
|
||||
WAB weavingBuilder_;
|
||||
uint defaultPort_;
|
||||
|
||||
public:
|
||||
|
||||
|
|
@ -352,12 +353,33 @@ namespace engine {
|
|||
PortBuilder(_Par&& base, FUN&& fun)
|
||||
: _Par{move(base)}
|
||||
, weavingBuilder_{forward<FUN> (fun), _Par::leads_.policyConnect()}
|
||||
, defaultPort_{0} ////////////////////////////////////////////////////////////////OOO brauche separaten Zähler! wo?
|
||||
{ }
|
||||
|
||||
friend class PortBuilderRoot<POL,DAT>;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param fun invocation of the actual _data processing operation._
|
||||
* @remarks
|
||||
* - a _»weaving pattern«_ is applied for the actual implementation, which amounts
|
||||
* to a specific style how to route data input and output and how to actually integrate
|
||||
* with the underlying media handling library, which exposes the processing functionality.
|
||||
* - the standard case of this connectivity is to associate input and output connections
|
||||
* directly with the »parameter slots« of the processing function; a function suitable
|
||||
* for this pattern takes two arguments (input, output) — each of which is a std::array
|
||||
* of buffer pointers, corresponding to the »parameter slots«
|
||||
* - what is bound as \a FUN here thus typically is either an adapter function provided by
|
||||
* the media-library plug-in, or it is a lambda directly invoking implementation functions
|
||||
* of the underlying library, using a buffer type (size) suitable for this library and for
|
||||
* the actual media frame data to be processed.
|
||||
* - the `fun` is deliberately _taken by-value_ and then moved into a »prototype copy« within
|
||||
* the generated `Turnout`, from which an actual copy is drawn anew for each node invocation.
|
||||
* - notably this implies that the implementation code of a lambda will be _inlined_ into the
|
||||
* actual invocation call, while possibly _creating a copy_ of value-captured closure data;
|
||||
* this arrangement aims at exposing the actual invocation for the optimiser.
|
||||
*/
|
||||
template<class POL, class DAT>
|
||||
template<typename FUN>
|
||||
auto
|
||||
|
|
|
|||
|
|
@ -350,6 +350,7 @@ namespace engine {
|
|||
struct WeavingBuilder
|
||||
: util::MoveOnly
|
||||
{
|
||||
using FunSpec = _ProcFun<FUN>;
|
||||
using TurnoutWeaving = Turnout<SimpleDirectInvoke<N,FUN>>;
|
||||
static constexpr SizMark<sizeof(TurnoutWeaving)> sizMark{};
|
||||
|
||||
|
|
@ -395,7 +396,6 @@ namespace engine {
|
|||
WeavingBuilder
|
||||
fillRemainingBufferTypes()
|
||||
{
|
||||
using FunSpec = _ProcFun<FUN>;
|
||||
auto constexpr FAN_O = FunSpec::FAN_O;
|
||||
using BuffO = typename FunSpec::BuffO;
|
||||
uint cnt = FAN_O - buffTypes.size();
|
||||
|
|
@ -426,7 +426,9 @@ namespace engine {
|
|||
typeConstructor (providers[i++]));
|
||||
|
||||
ENSURE (leadPorts.size() <= N);
|
||||
ENSURE (leadPorts.size() == FunSpec::FAN_I);
|
||||
ENSURE (outTypes.size() <= N);
|
||||
ENSURE (outTypes.size() == FunSpec::FAN_O);
|
||||
|
||||
using PortDataBuilder = DataBuilder<POL, Port>;
|
||||
// provide a free-standing functor to build a suitable Port impl (≙Turnout)
|
||||
|
|
|
|||
|
|
@ -9308,9 +9308,7 @@
|
|||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1512844658352" ID="ID_1411659026" MODIFIED="1512844688077" TEXT="einfache Ausprägung">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
...nur was billig ist,
|
||||
|
|
@ -9744,9 +9742,7 @@
|
|||
</node>
|
||||
<node CREATED="1513395781003" ID="ID_1245121355" MODIFIED="1513395835329" TEXT="Problem: wie anschließen?">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
an welcher Stelle wird diese Mechanik
|
||||
|
|
@ -10754,9 +10750,7 @@
|
|||
<node CREATED="1513476644949" ID="ID_1188646042" MODIFIED="1513476648032" TEXT="ich denke schon"/>
|
||||
<node CREATED="1513476649092" ID="ID_1643873286" MODIFIED="1513476698904">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
man kann move(iter) verwenden,
|
||||
|
|
@ -12294,9 +12288,7 @@
|
|||
</node>
|
||||
<node COLOR="#338800" CREATED="1514748505488" ID="ID_947047856" MODIFIED="1576282358120" TEXT="TODO: API umstellen">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
neue Einsicht 31.12.17
|
||||
|
|
@ -14517,9 +14509,7 @@
|
|||
</node>
|
||||
<node CREATED="1515726644600" ID="ID_1701085444" MODIFIED="1576282358115" TEXT="C++14">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
// generic lambda, operator() is a template with one parameter
|
||||
|
|
@ -48885,9 +48875,7 @@
|
|||
</node>
|
||||
<node COLOR="#338800" CREATED="1576201938680" HGAP="146" ID="ID_486184645" MODIFIED="1576202931124" VSHIFT="62">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
<font size="4">Implementierung: <b>Diff-Bindung</b></font> -> Diff-System
|
||||
|
|
@ -49575,9 +49563,7 @@
|
|||
<icon BUILTIN="forward"/>
|
||||
<node CREATED="1618496774556" ID="ID_1999438460" MODIFIED="1618496815452" TEXT="paßt gut in bestehende UI-Toolkits">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
GTK macht das auch in der Tat genau so
|
||||
|
|
@ -50062,9 +50048,7 @@
|
|||
<node CREATED="1481415996732" ID="ID_98181285" MODIFIED="1518487921090" TEXT="ein "circuit breaker""/>
|
||||
<node CREATED="1481416013842" ID="ID_1905276259" MODIFIED="1518487921090">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
beendet Deregistrierung,
|
||||
|
|
@ -50342,9 +50326,7 @@
|
|||
<node CREATED="1453639033250" ID="ID_1669831951" LINK="http://stackoverflow.com/questions/26705199/how-can-i-write-a-type-trait-to-check-if-a-type-is-convertible-to-another-by-a-n" MODIFIED="1453639049952" TEXT="s.a. Stackoverflow"/>
|
||||
<node CREATED="1453639055478" ID="ID_1560466275" MODIFIED="1453639078468">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
gelöst in GCC-5 -- <i>backport unwahrscheinlich</i>
|
||||
|
|
@ -50504,9 +50486,7 @@
|
|||
</node>
|
||||
<node CREATED="1455290833048" ID="ID_1650274766" MODIFIED="1518487921091">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
nach <b>work site</b>
|
||||
|
|
@ -88398,7 +88378,8 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node CREATED="1729690434609" ID="ID_471228411" MODIFIED="1729690449358" TEXT="schon beim lib::SeveralBuilder erfolgreich angewandt"/>
|
||||
<node CREATED="1729690497225" ID="ID_250896902" MODIFIED="1729690506851" TEXT="analog hier für den NodeBuilder übernommen"/>
|
||||
</node>
|
||||
<node CREATED="1729690511015" ID="ID_1345744881" MODIFIED="1729690525113" TEXT="brauche Möglichkeit zur Weitergabe per Verdrahtung">
|
||||
<node COLOR="#338800" CREATED="1729690511015" ID="ID_1345744881" MODIFIED="1729819086114" TEXT="brauche Möglichkeit zur Weitergabe per Verdrahtung">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1729690643848" ID="ID_1393862688" MODIFIED="1729690650184" TEXT="kann hier formal argumentieren">
|
||||
<node CREATED="1729690652137" ID="ID_707766560" MODIFIED="1729690668783" TEXT="der Policy-Typ muß zur Compilezeit weitergereicht werden"/>
|
||||
<node CREATED="1729690678125" ID="ID_94473929" MODIFIED="1729690847382" TEXT="alle Policies erben vom Allokator und sind somit kopierbar">
|
||||
|
|
@ -88411,12 +88392,24 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</body>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
<node CREATED="1729816861877" ID="ID_393354855" MODIFIED="1729817375218" TEXT="das ist aber nur die Theorie">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
...denn es sind noch die flexiblen Strategy-Templates darüber gelegt, und außerdem hatte ich den eigentlichen Allocator nur als protected-Mix-in eingebettet — und deshalb wird der für einen normalen (generierten) copy-Konstruktor nicht in sichtbar; kopiert würde ja auf dem gesamten (zusammengesetzten) Strategy-Template, und das hängt nominell durchaus vom Element-Typ ab, der aber in diesem Fall, beim Weitergeben einer Initialisierung, durchaus variabel sein kann (nur der Basis-Allokator ist stets kompatibel)
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<arrowlink COLOR="#835537" DESTINATION="ID_771040034" ENDARROW="Default" ENDINCLINATION="14;-51;" ID="Arrow_ID_53225453" STARTARROW="None" STARTINCLINATION="-75;7;"/>
|
||||
<icon BUILTIN="stop-sign"/>
|
||||
</node>
|
||||
<node CREATED="1729693488842" ID="ID_771040034" MODIFIED="1729693495886" TEXT="ist aber etwas grenzwertig....">
|
||||
<node CREATED="1729693497185" ID="ID_1296261127" MODIFIED="1729693511053" TEXT="eigentlich brauche ich wieder so eine Art cross-Builder">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
</node>
|
||||
<node CREATED="1729693529381" ID="ID_243390572" MODIFIED="1729693629731" TEXT="nur für Allocation-Cluster wäre Initialisierung mit dem eingebetteten Basis-Allokator möglich">
|
||||
<node BACKGROUND_COLOR="#e0ceaa" COLOR="#690f14" CREATED="1729693488842" ID="ID_771040034" MODIFIED="1729816925159" TEXT="ist aber etwas grenzwertig....">
|
||||
<linktarget COLOR="#835537" DESTINATION="ID_771040034" ENDARROW="Default" ENDINCLINATION="14;-51;" ID="Arrow_ID_53225453" SOURCE="ID_393354855" STARTARROW="None" STARTINCLINATION="-75;7;"/>
|
||||
<icon BUILTIN="smiley-neutral"/>
|
||||
<node CREATED="1729693529381" ID="ID_243390572" MODIFIED="1729816810228" TEXT="nur für Allocation-Cluster wäre Initialisierung mit dem eingebetteten Basis-Allokator möglich">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
|
|
@ -88424,10 +88417,39 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
denn das Standard-C++-Front-end für Allocation-Cluster ist ein std::allocator<byte>, und deshalb sind alle Varianten untereinander kompatibel (und das einzige verbleibende Problem wäre, daß der Allokator eine protected-Basisklasse ist)
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
<node CREATED="1729693512727" ID="ID_119687582" MODIFIED="1729693527657" TEXT="denn die konkrete Policy ist auch an den Element-Typ gebunden"/>
|
||||
<node BACKGROUND_COLOR="#c8c0b6" COLOR="#435e98" CREATED="1729693497185" ID="ID_1296261127" MODIFIED="1729817519405" TEXT="brauche wieder eine Art cross-Builder">
|
||||
<icon BUILTIN="yes"/>
|
||||
<node COLOR="#338800" CREATED="1729817393870" ID="ID_1797226800" MODIFIED="1729817447875" TEXT="muß also die eingebettete Policy zugreifbar machen">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
damit man von einem existierenden SeveralBuilder ausgehend weiter verdrahten kann
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1729817449159" ID="ID_1426982286" MODIFIED="1729817506616" TEXT="muß den durchgereichten ctor von der ElementFactory flexibel machen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node CREATED="1729817529910" ID="ID_1957805007" MODIFIED="1729817849042" TEXT="Einschätzung: ist vertretbar">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
<i>Konzeptionell </i>ist das Strategy-Template offen angelegt, aber <i>in der tatsächlichen Implementierung</i> dürfte seine Rolle inzwischen weitgehend festgelegt sein. Und in diesem aktuellen Gebrauch spielt der Element-Typ nur eine Rolle zur Ansteuerung des Allocators, und auch die Konstruktor-Argumente werden komplett von oben bis auf die Basis-Ebene durchgereicht. Da zudem der Basis-Allocator an den C++-Standard angelehnt ist, kann man unterstellen, daß sich praktisch immer ein passender Alocator für einen anderen als den gegebenen Element-Typ konstruieren läßt.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -89439,7 +89461,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
<node CREATED="1728858668070" ID="ID_1431639114" MODIFIED="1728858931894" TEXT="kann nur noch Anzahl prüfen und fehlende Slots per Lead/default-Port befriedigen">
|
||||
<node CREATED="1728860974222" ID="ID_1130205156" MODIFIED="1728860983031" TEXT="Ports werden der Reihe nach eingefüllt"/>
|
||||
<node CREATED="1728860984062" ID="ID_322570697" MODIFIED="1728861006719" TEXT="⟹ PortBuilder kann seine eigene Port-Nummer erschließen"/>
|
||||
<node CREATED="1728860984062" ID="ID_322570697" MODIFIED="1729824572439" TEXT="⟹ PortBuilder kann seine eigene Port-Nummer erschließen">
|
||||
<arrowlink COLOR="#636e77" DESTINATION="ID_1876187632" ENDARROW="Default" ENDINCLINATION="95;-2208;" ID="Arrow_ID_508627026" STARTARROW="None" STARTINCLINATION="-946;47;"/>
|
||||
</node>
|
||||
<node CREATED="1728861007944" ID="ID_1830241208" MODIFIED="1728861032180" TEXT="muß aber gespeichert werden, da konfigurierbar"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1728858747160" ID="ID_1825558530" MODIFIED="1728858939877" TEXT="Konsequenz ⟹ zu wenig Leads bedeutet error::Logic">
|
||||
|
|
@ -89518,6 +89542,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<arrowlink COLOR="#3d2f67" DESTINATION="ID_1595587422" ENDARROW="Default" ENDINCLINATION="-1475;-107;" ID="Arrow_ID_1028125005" STARTARROW="None" STARTINCLINATION="2920;124;"/>
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
</node>
|
||||
<node COLOR="#435e98" CREATED="1728870377629" ID="ID_616326824" MODIFIED="1728914206823" TEXT="Irgendetwas mit der move/realloc-Funktion in lib::SeveralBuilder ist nicht in Ordnung">
|
||||
|
|
@ -90386,6 +90411,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
<node COLOR="#435e98" CREATED="1729525573004" ID="ID_1595587422" MODIFIED="1729564371805" TEXT="Problem: direct Funktion-ref decays">
|
||||
<linktarget COLOR="#3d2f67" DESTINATION="ID_1595587422" ENDARROW="Default" ENDINCLINATION="-1475;-107;" ID="Arrow_ID_1028125005" SOURCE="ID_695992250" STARTARROW="None" STARTINCLINATION="2920;124;"/>
|
||||
<icon BUILTIN="broken-line"/>
|
||||
<node CREATED="1729551646837" ID="ID_797477885" MODIFIED="1729551707565" TEXT="OH-Mann!!!">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
|
|
@ -90468,6 +90494,55 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1729824226571" ID="ID_1548990852" MODIFIED="1729824234251" TEXT="Verdrahtung vervollständigen">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node CREATED="1729824237682" ID="ID_636711160" MODIFIED="1729824246476" TEXT="Eingangsseitig">
|
||||
<node COLOR="#5b280f" CREATED="1729824384286" ID="ID_1876187632" MODIFIED="1729824783905" TEXT="Steuerung muß im PortBuilder liegen">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
weil nur der PortBuilder seine eigene Position erschließen kann (weil er auf den geerbten DataBuilder zugreifen kann)
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<linktarget COLOR="#636e77" DESTINATION="ID_1876187632" ENDARROW="Default" ENDINCLINATION="95;-2208;" ID="Arrow_ID_508627026" SOURCE="ID_322570697" STARTARROW="None" STARTINCLINATION="-946;47;"/>
|
||||
<icon BUILTIN="button_cancel"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1729824794902" ID="ID_773941137" MODIFIED="1729824924642" TEXT="nein: sogar eine Ebene höher?">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node CREATED="1729824942675" ID="ID_1214779054" LINK="#ID_1804465000" MODIFIED="1729825085282" TEXT="der DataBuilder für die Ports ist nun transient">
|
||||
<icon BUILTIN="broken-line"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1729825097094" ID="ID_675110705" MODIFIED="1729825121710" TEXT="nochmal eine weitere temporäre Variable einführen??">
|
||||
<icon BUILTIN="help"/>
|
||||
<node CREATED="1729825128179" ID="ID_26277636" MODIFIED="1729825177117" TEXT="man könnte das default-Setting mißbrauchen">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
d.h. der Default würde mit hochgezählt, kann aber per Setter auf andere Werte gesetzt werden
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1729824247416" ID="ID_967491409" MODIFIED="1729824250860" TEXT="Ausgangsseitig">
|
||||
<node COLOR="#338800" CREATED="1729824254831" ID="ID_1308386017" MODIFIED="1729824373104" TEXT="naheliegend (und bereits implementiert)">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node CREATED="1729824270757" ID="ID_65211202" MODIFIED="1729824376899" TEXT="direkt getrieben von der (bekannten) Anzahl an »Ausgabe-Slots« der Funktion">
|
||||
<icon BUILTIN="info"/>
|
||||
</node>
|
||||
<node CREATED="1729824307712" ID="ID_1207542097" MODIFIED="1729824376899" TEXT="Simple-Weaving-Pattern: verwendet durchgehend einen einzigen Buffer-Typ">
|
||||
<icon BUILTIN="info"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#f8f1cb" COLOR="#a50125" CREATED="1728870929451" ID="ID_1740846481" MODIFIED="1728870951984" TEXT="der Gebrauch des BuffHandle::accessAs<TY>() ist zweifelhaft">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node CREATED="1728870953831" ID="ID_1005617048" MODIFIED="1728870963978" TEXT="ich bekomme einen LInker-Fehler"/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue