Invocation: first draft of the node builder invocation

This commit is contained in:
Fischlurch 2024-07-06 21:31:03 +02:00
parent 7c554caf08
commit 58a955a879
4 changed files with 89 additions and 76 deletions

View file

@ -77,9 +77,11 @@
#include "steam/engine/proc-node.hpp"
#include "lib/several-builder.hpp"
#include "lib/nocopy.hpp"
#include <utility>
#include <vector>
namespace steam {
@ -89,8 +91,47 @@ namespace engine {
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
class PortBuilder
class PortBuilder;
class NodeBuilder
: util::MoveOnly
{
lib::SeveralBuilder<Port> ports_;
std::vector<ProcNodeRef> leads_;
public:
NodeBuilder
addLead (ProcNode const& lead)
{
UNIMPLEMENTED ("append the given predecessor node to the sequence of leads");
return move(*this);
}
void //////////////////////////////////////////////////////////OOO return type
preparePort ()
{
UNIMPLEMENTED ("recursively enter detailed setup of a single processing port");
// return move(*this);
}
/****************************************************//**
* Terminal: complete the Connectivity defined thus far.
*/
Connectivity
build()
{
/////////////////////////////////////////////////////////////////////OOO actually use the collected data to build
return Connectivity{ports_.build()
,lib::makeSeveral<ProcNodeRef>().build()
,NodeID{}};
}
};
class PortBuilder
: protected NodeBuilder
, util::MoveOnly
{
public:
@ -127,37 +168,6 @@ namespace engine {
};
class NodeBuilder
: util::MoveOnly
{
public:
NodeBuilder
addLead (ProcNode const& lead)
{
UNIMPLEMENTED ("append the given predecessor node to the sequence of leads");
return move(*this);
}
void //////////////////////////////////////////////////////////OOO return type
preparePort ()
{
UNIMPLEMENTED ("recursively enter detailed setup of a single processing port");
// return move(*this);
}
/****************************************************//**
* Terminal: complete the Connectivity defined thus far.
*/
Connectivity
build()
{
UNIMPLEMENTED("Node-Connectivity Setup");
}
};
/**
* Entrance point for building actual Render Node Connectivity (Level-2)
*/

View file

@ -61,12 +61,14 @@
namespace steam {
namespace engine {
using std::vector;
using std::move;
using std::vector; //////////////TODO;
using lumiera::NodeID;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
class ProcNode;
typedef ProcNode* PNode;
// typedef ProcNode* PNode;
using ProcNodeRef = std::reference_wrapper<ProcNode>;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
class Port
@ -94,33 +96,23 @@ namespace engine {
{
public: /* === public information record describing the node graph === */
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
uint nrO;
uint nrI;
using Ports = lib::Several<Port>;
using Leads = lib::Several<ProcNodeRef>;
lib::RefArray<ChannelDescriptor>& out;
lib::RefArray<InChanDescriptor>& in;
typedef asset::Proc::ProcFunc ProcFunc;
ProcFunc* procFunction;
Ports ports;
Leads leads;
NodeID const& nodeID;
virtual ~Connectivity() {}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
protected:
// protected:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
Connectivity (lib::RefArray<ChannelDescriptor>& o,
lib::RefArray<InChanDescriptor>& i,
ProcFunc pFunc, NodeID const& nID)
: out(o), in(i),
procFunction(pFunc),
nodeID(nID)
{
nrO = out.size();
nrI = in.size();
}
Connectivity (Ports&& pr, Leads&& lr, NodeID const& nID)
: ports(move(pr))
, leads(move(lr))
, nodeID(nID)
{ }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
@ -159,28 +151,20 @@ namespace engine {
class ProcNode
: util::NonCopyable
{
typedef mobject::Parameter<double> Param; //////TODO: just a placeholder for automation as of 6/2008
vector<Param> params;
const Connectivity& wiringConfig_;
Connectivity wiring_;
public:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
ProcNode (Connectivity const& wd)
: wiringConfig_(wd)
ProcNode (Connectivity&& con)
: wiring_(move(con))
{ }
virtual ~ProcNode() {}; /////////////////////////TODO: do we still intend to build a hierarchy below ProcNode???
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
public:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
bool isValid() const;
/** output channel count */
uint nrO() { return wiringConfig_.nrO; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
/** Engine Core operation: render and pull output from this node.
@ -208,12 +192,6 @@ namespace engine {
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
inline bool
ProcNode::isValid() const
{
UNIMPLEMENTED ("ProcNode validity self-check");
return false; //////////////////////////TODO
}
}} // namespace steam::engine

View file

@ -30,8 +30,7 @@
#include "steam/engine/proc-node.hpp"
#include "steam/engine/feed-manifold.hpp"
#include "lib/ref-array.hpp"
#include "lib/format-cout.hpp"
#include "lib/format-cout.hpp" ////////////////TODO
#include <memory>
@ -49,6 +48,7 @@ namespace test {
const uint WIDTH_MAX = 3;
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
/** just some crap to pass in as ctor argument... */
template<class E>
struct DummyArray : lib::RefArray<E>
@ -77,11 +77,10 @@ namespace test {
virtual uint getNrI() const { return ii; }
virtual uint getNrO() const { return oo; }
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
virtual BuffHandle callDown (StateClosure_OBSOLETE&, uint) const
{ throw lumiera::Error("not intended to be called"); }
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
};
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
@ -164,13 +163,13 @@ namespace test {
*/
void invocation (uint consumed, void* lastLevel)
{
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #833
MockSizeRequest numbers;
consumed += numbers.getNrI()+numbers.getNrO();
if (TABLE_SIZ <= consumed)
return; // end recursion
++counter;
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #833
BuffTableChunk thisChunk (numbers, *pStorage);
CHECK (consistencyCheck (thisChunk, numbers, lastLevel));

View file

@ -87449,6 +87449,13 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1719970214048" ID="ID_912277542" MODIFIED="1719970290253" TEXT="Builder-API">
<arrowlink COLOR="#b82d72" DESTINATION="ID_1241897346" ENDARROW="Default" ENDINCLINATION="-200;386;" ID="Arrow_ID_1194515432" STARTARROW="None" STARTINCLINATION="-600;-89;"/>
<icon BUILTIN="flag-yellow"/>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1720285198414" ID="ID_1153319941" MODIFIED="1720285456652" TEXT="Grundlagen aufbauen">
<linktarget COLOR="#de3756" DESTINATION="ID_1153319941" ENDARROW="Default" ENDINCLINATION="-322;35;" ID="Arrow_ID_619451066" SOURCE="ID_1279225641" STARTARROW="None" STARTINCLINATION="833;-72;"/>
<icon BUILTIN="flag-yellow"/>
<node CREATED="1720285508129" ID="ID_1303842344" MODIFIED="1720285515458" TEXT="Refactoring Connectivity"/>
<node CREATED="1720285518287" ID="ID_525600205" MODIFIED="1720285535616" TEXT="NodeBuilder"/>
<node CREATED="1720285544539" ID="ID_28916107" MODIFIED="1720285547718" TEXT="PortBuilder"/>
</node>
</node>
</node>
<node CREATED="1719968038589" HGAP="38" ID="ID_177982013" MODIFIED="1719968051367" TEXT="Feststellungen" VSHIFT="30">
@ -87468,6 +87475,22 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
</node>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1720285361113" ID="ID_1765678054" MODIFIED="1720285365141" TEXT="anlegen....">
<icon BUILTIN="flag-yellow"/>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1720285381774" ID="ID_1298904782" MODIFIED="1720285436982" TEXT="die Leads">
<icon BUILTIN="flag-yellow"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1720285385878" ID="ID_1429352134" MODIFIED="1720285436983" TEXT="die Ports">
<icon BUILTIN="flag-yellow"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1720285394986" ID="ID_1425096400" MODIFIED="1720285436983" TEXT="Port-Impl &#x2259; Turnout">
<icon BUILTIN="flag-yellow"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1720285429230" ID="ID_1279225641" MODIFIED="1720285461982" TEXT="Level-2-Builder">
<arrowlink COLOR="#de3756" DESTINATION="ID_1153319941" ENDARROW="Default" ENDINCLINATION="-322;35;" ID="Arrow_ID_619451066" STARTARROW="None" STARTINCLINATION="833;-72;"/>
<icon BUILTIN="flag-yellow"/>
</node>
</node>
</node>
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1718973873148" ID="ID_522658569" MODIFIED="1718978668919" TEXT="Anordnung im Code">
<icon BUILTIN="yes"/>
@ -87581,6 +87604,9 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1719186031309" ID="ID_1908240557" MODIFIED="1719186091788" TEXT="kann man die Identit&#xe4;t eines Turnout feststellen?">
<icon BUILTIN="help"/>
</node>
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1720293853511" ID="ID_812742662" MODIFIED="1720293864679" TEXT="wozu brauchen wir die NodeID?">
<icon BUILTIN="help"/>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1719186096499" ID="ID_1104635186" MODIFIED="1719186122029" TEXT="Diagnose-Setup">
<icon BUILTIN="flag-yellow"/>