From 58a955a879287d6f5ebfdf3173e63202da15ed57 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 6 Jul 2024 21:31:03 +0200 Subject: [PATCH] Invocation: first draft of the node builder invocation --- src/steam/engine/node-builder.hpp | 74 +++++++++++-------- src/steam/engine/proc-node.hpp | 56 +++++--------- .../core/steam/engine/feed-manifold-test.cpp | 9 +-- wiki/thinkPad.ichthyo.mm | 26 +++++++ 4 files changed, 89 insertions(+), 76 deletions(-) diff --git a/src/steam/engine/node-builder.hpp b/src/steam/engine/node-builder.hpp index 883eb916e..1f81edc89 100644 --- a/src/steam/engine/node-builder.hpp +++ b/src/steam/engine/node-builder.hpp @@ -77,9 +77,11 @@ #include "steam/engine/proc-node.hpp" +#include "lib/several-builder.hpp" #include "lib/nocopy.hpp" #include +#include namespace steam { @@ -89,8 +91,47 @@ namespace engine { /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation - class PortBuilder + class PortBuilder; + + + class NodeBuilder : util::MoveOnly + { + lib::SeveralBuilder ports_; + std::vector 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().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) */ diff --git a/src/steam/engine/proc-node.hpp b/src/steam/engine/proc-node.hpp index c449faaf7..0212ef4ff 100644 --- a/src/steam/engine/proc-node.hpp +++ b/src/steam/engine/proc-node.hpp @@ -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; /////////////////////////////////////////////////////////////////////////////////////////////////////////////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; + using Leads = lib::Several; - lib::RefArray& out; - lib::RefArray& 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& o, - lib::RefArray& 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 Param; //////TODO: just a placeholder for automation as of 6/2008 - vector 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 diff --git a/tests/core/steam/engine/feed-manifold-test.cpp b/tests/core/steam/engine/feed-manifold-test.cpp index 855c04b02..b3e730204 100644 --- a/tests/core/steam/engine/feed-manifold-test.cpp +++ b/tests/core/steam/engine/feed-manifold-test.cpp @@ -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 @@ -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 struct DummyArray : lib::RefArray @@ -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)); diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 228a4c2fe..58194df1b 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -87449,6 +87449,13 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + + @@ -87468,6 +87475,22 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + + + + + + + + + + + @@ -87581,6 +87604,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + +