Invocation: rearrange code and cut ties to obsolete implementation draft
The latest phase of conception and planning moved this integration effort a big step ahead. It is now **basically settled how the invocation works** from top-down. Thus a lot of ties to ''obsoleted pieces of implementation code'' from the first draft from 2009 / 2012 can be severed now. * instead of a `StateProxy` most state management has been broken down into implementation parts * instead of orchestrating generic invocation building blocks we will parametrise »weaving-patterns«
This commit is contained in:
parent
fea2bfde7a
commit
42af5bc4e7
16 changed files with 501 additions and 370 deletions
|
|
@ -11,13 +11,15 @@
|
|||
|
||||
*/
|
||||
|
||||
/** @file channel-descriptor.hpp
|
||||
/** @file channel-descriptor-obsolete.hpp
|
||||
** Representation of the Media type of a data channel used within the engine.
|
||||
**
|
||||
** @todo as it stands (11/2011) this file is obsoleted and needs to be refactored,
|
||||
** alongside with adapting the node invocation to the new BufferProvider interface.
|
||||
** @todo as of 5/2024, this will be retained as part of the `FeedManifold`,
|
||||
** which in turn takes on some aspects of the old buffer table draft.
|
||||
** @deprecated 12/2024 it is now clear that the low-level-Model will be really low-level,
|
||||
** implying that any connection to the usage domain will be completely resolved in the builder
|
||||
**
|
||||
** @see nodewiring-def.hpp
|
||||
** @see nodeoperation.hpp
|
||||
|
|
@ -46,8 +48,8 @@ namespace engine {
|
|||
|
||||
|
||||
|
||||
class ProcNode;
|
||||
typedef ProcNode* PNode;
|
||||
class ProcNode_Obsolete;
|
||||
typedef ProcNode_Obsolete* PNode;
|
||||
|
||||
|
||||
struct ChannelDescriptor ///////TODO really need to define that here? it is needed for node wiring only
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
#include "steam/asset/proc.hpp"
|
||||
#include "steam/mobject/parameter.hpp"
|
||||
#include "steam/engine/state-closure-obsolete.hpp" /////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
#include "steam/engine/channel-descriptor.hpp"
|
||||
#include "steam/engine/channel-descriptor-obsolete.hpp"
|
||||
#include "lib/frameid.hpp"
|
||||
#include "lib/ref-array.hpp"
|
||||
|
||||
|
|
@ -57,8 +57,8 @@ namespace engine {
|
|||
using lumiera::NodeID;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
class ProcNode;
|
||||
typedef ProcNode* PNode;
|
||||
class ProcNode_Obsolete;
|
||||
typedef ProcNode_Obsolete* PNode;
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ namespace engine {
|
|||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
/* ==== strategy API for configuring the node operation ==== */
|
||||
|
||||
friend class ProcNode; /////////////////////////////////TODO 1/12 : wouldn't it be better to extract that API into a distinct strategy?
|
||||
friend class ProcNode_Obsolete; /////////////////////////////////TODO 1/12 : wouldn't it be better to extract that API into a distinct strategy?
|
||||
|
||||
/** the wiring-dependent part of the node operation.
|
||||
* Includes the creation of a one-way state object on the stack
|
||||
|
|
@ -139,7 +139,7 @@ namespace engine {
|
|||
* ProcNode as a frontend entirely.
|
||||
* @todo WIP-WIP-WIP 2024 Node-Invocation is reworked from ground up for the »Playback Vertical Slice«
|
||||
*/
|
||||
class ProcNode
|
||||
class ProcNode_Obsolete
|
||||
: util::NonCopyable
|
||||
{
|
||||
typedef mobject::Parameter<double> Param; //////TODO: just a placeholder for automation as of 6/2008
|
||||
|
|
@ -149,11 +149,11 @@ namespace engine {
|
|||
|
||||
public:
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
ProcNode (Connectivity const& wd)
|
||||
ProcNode_Obsolete (Connectivity const& wd)
|
||||
: wiringConfig_(wd)
|
||||
{ }
|
||||
|
||||
virtual ~ProcNode() {}; /////////////////////////TODO: do we still intend to build a hierarchy below ProcNode???
|
||||
virtual ~ProcNode_Obsolete() {}; /////////////////////////TODO: do we still intend to build a hierarchy below ProcNode???
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ namespace engine {
|
|||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
inline bool
|
||||
ProcNode::isValid() const
|
||||
ProcNode_Obsolete::isValid() const
|
||||
{
|
||||
UNIMPLEMENTED ("ProcNode validity self-check");
|
||||
return false; //////////////////////////TODO
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include "lib/error.hpp"
|
||||
#include "lib/nocopy.hpp"
|
||||
#include "steam/engine/channel-descriptor.hpp"
|
||||
#include "steam/engine/channel-descriptor-obsolete.hpp"
|
||||
//#include "steam/engine/proc-node.hpp" ///////////////////////////////TODO this is a dead end
|
||||
#include "steam/engine/connectivity-obsolete.hpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ namespace engine {
|
|||
patternData_.collectEntries(ports);
|
||||
return Connectivity{ports.build()
|
||||
,leads_.build()
|
||||
,NodeID{}}; //////////////////////////////////////OOO what's the purpose of the NodeID??
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -50,19 +50,19 @@ namespace engine {
|
|||
* @todo as of 2016 this is the only (placeholder) implementation
|
||||
* to indicate how building and wiring of nodes was meant to happen
|
||||
*/
|
||||
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
|
||||
PNode
|
||||
NodeFactory::operator() (Placement<Effect> const& effect, WiringSituation& intendedWiring)
|
||||
{
|
||||
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
|
||||
intendedWiring.resolveProcessor(effect->getProcAsset());
|
||||
Connectivity& wiring = wiringFac_(intendedWiring);
|
||||
|
||||
ProcNode& newNode = alloc_.create<ProcNode> (wiring);
|
||||
ENSURE (newNode.isValid());
|
||||
return &newNode;
|
||||
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
|
||||
UNIMPLEMENTED ("Node Factory for reworked Render Node Connectivity");
|
||||
}
|
||||
UNIMPLEMENTED ("Node Factory for reworked Render Node Connectivity");
|
||||
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
|
||||
|
||||
|
||||
}} // namespace engine
|
||||
|
|
|
|||
|
|
@ -50,11 +50,7 @@ namespace engine {
|
|||
using std::vector;
|
||||
using lib::AllocationCluster;
|
||||
|
||||
///////////////////////////// TODO: as of 9/09, it seems no longer necessary to use any subclasses of ProcNode
|
||||
class Trafo;
|
||||
typedef Trafo* PTrafo; ///< @note ProcNode is handled by pointer and bulk allocated/deallocated
|
||||
|
||||
class WiringSituation;
|
||||
// class WiringSituation;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -76,7 +72,10 @@ namespace engine {
|
|||
{ }
|
||||
|
||||
|
||||
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
|
||||
PNode operator() (mobject::session::PEffect const&, WiringSituation&);
|
||||
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
*/
|
||||
|
||||
/** @file nodeinvocation.hpp
|
||||
/** @file nodeinvocation-obsolete.hpp
|
||||
** Organise the state related to the invocation of s single ProcNode::pull() call
|
||||
** This header defines part of the "glue" which holds together the render node network
|
||||
** and enables to pull result frames from the nodes. Doing so requires some invocation
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
** in the actual StateAdapter type known to the NodeWiring (WiringAdapter) instance. All of these actual
|
||||
** StateAdapter types are built as implementing the engine::StateClosure interface.
|
||||
**
|
||||
** @deprecated 12/2024 the internal systematic within the Render Engine has been re-arranged altogether
|
||||
**
|
||||
** @todo relies still on an [obsoleted implementation draft](\ref bufftable-obsolete.hpp)
|
||||
** @see engine::ProcNode
|
||||
** @see engine::StateProxy
|
||||
|
|
@ -49,7 +51,7 @@
|
|||
//#include "steam/engine/proc-node.hpp" ///////////////////////////////TODO clarify if required further on
|
||||
#include "steam/engine/connectivity-obsolete.hpp"
|
||||
#include "steam/engine/state-closure-obsolete.hpp"
|
||||
#include "steam/engine/channel-descriptor.hpp"
|
||||
#include "steam/engine/channel-descriptor-obsolete.hpp"
|
||||
#include "steam/engine/feed-manifold-obsolete.hpp"
|
||||
|
||||
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
*/
|
||||
|
||||
/** @file nodeoperation.hpp
|
||||
/** @file nodeoperation-obsolete.hpp
|
||||
** Chunks of operation for invoking the rendernodes.
|
||||
** This header defines part of the "glue" which holds together the render node network
|
||||
** and enables to pull a result frames from the nodes. Especially, the aspect of
|
||||
|
|
@ -35,6 +35,11 @@
|
|||
** nodewiring-config.hpp). which is actually instantiated and used in nodewiring.cpp, which is the object
|
||||
** file holding all those instantiations.
|
||||
**
|
||||
**
|
||||
** @deprecated 12/2024 the internal systematic within the Render Engine has been re-arranged altogether.
|
||||
** The general operation scheme is now conceptualised as a weaving-pattern
|
||||
**
|
||||
**
|
||||
** @see engine::ProcNode
|
||||
** @see engine::Invocation
|
||||
** @see engine::StateClosure
|
||||
|
|
@ -51,8 +56,8 @@
|
|||
//#include "steam/engine/proc-node.hpp" ///////////////////////////////TODO clarify if required further on
|
||||
#include "steam/engine/connectivity-obsolete.hpp"
|
||||
#include "steam/engine/state-closure-obsolete.hpp"
|
||||
#include "steam/engine/channel-descriptor.hpp"
|
||||
#include "steam/engine/nodeinvocation.hpp"
|
||||
#include "steam/engine/channel-descriptor-obsolete.hpp"
|
||||
#include "steam/engine/nodeinvocation-obsolete.hpp"
|
||||
#include "steam/engine/feed-manifold-obsolete.hpp"
|
||||
|
||||
#include "lib/meta/util.hpp"
|
||||
|
|
@ -12,16 +12,20 @@
|
|||
* *****************************************************************/
|
||||
|
||||
|
||||
/** @file nodewiring.cpp
|
||||
/** @file nodewiring-obsolete.cpp
|
||||
** Implementation of node wiring to build a render node network
|
||||
** @todo unfinished draft from 2009 regarding the render process
|
||||
**
|
||||
** @deprecated 12/2024 the internal systematic within the Render Engine has been re-arranged altogether;
|
||||
** instead of orchestrating generic invocation building-blocks, a collection of generic
|
||||
** _weaving-patterns_ will be instantiated directly in the library-adapter plug-ins
|
||||
*/
|
||||
|
||||
|
||||
//#include "steam/engine/proc-node.hpp" ///////////////////////////////TODO clarify if required further on
|
||||
#include "steam/engine/connectivity-obsolete.hpp"
|
||||
#include "steam/engine/nodewiring-obsolete.hpp"
|
||||
#include "steam/engine/nodeoperation.hpp"
|
||||
#include "steam/engine/nodeoperation-obsolete.hpp"
|
||||
#include "steam/engine/nodewiring-config.hpp"
|
||||
|
||||
#include "lib/meta/typelist-manip.hpp"
|
||||
|
|
@ -36,13 +36,10 @@
|
|||
#include "lib/error.hpp"
|
||||
#include "lib/nocopy.hpp"
|
||||
#include "lib/hash-value.h"
|
||||
#include "steam/asset/proc.hpp"
|
||||
#include "steam/mobject/parameter.hpp"
|
||||
//#include "steam/engine/state-closure-obsolete.hpp" ///////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
#include "steam/engine/state-closure.hpp" /////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
#include "steam/engine/channel-descriptor.hpp"
|
||||
//#include "steam/asset/proc.hpp"
|
||||
//#include "steam/mobject/parameter.hpp"
|
||||
#include "steam/engine/buffhandle.hpp"
|
||||
#include "steam/engine/turnout-system.hpp"
|
||||
#include "lib/frameid.hpp"
|
||||
#include "lib/ref-array.hpp" /////////////////////OOO phase out
|
||||
#include "lib/format-string.hpp"
|
||||
#include "lib/several.hpp"
|
||||
|
|
@ -59,20 +56,16 @@ namespace engine {
|
|||
|
||||
using std::move;
|
||||
using std::string;
|
||||
using std::vector; //////////////TODO;
|
||||
using lib::HashVal;
|
||||
using lumiera::NodeID; ///////////////////////TODO likely to be removed
|
||||
using util::_Fmt;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
class ProcID;
|
||||
class ProcNode;
|
||||
class ProcNodeDiagnostic;
|
||||
|
||||
// typedef ProcNode* PNode;
|
||||
using ProcNodeRef = std::reference_wrapper<ProcNode>;
|
||||
using OptionalBuff = std::optional<BuffHandle>;
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
|
||||
|
||||
class Port
|
||||
// : util::MoveOnly //////////////////////////////////////////////////OOO not clear if necessary here, and requires us to declare the ctors!!! See Turnout
|
||||
|
|
@ -115,16 +108,13 @@ namespace engine {
|
|||
Ports ports;
|
||||
Leads leads;
|
||||
|
||||
NodeID const& nodeID; /////////////////////////////////OOO seems to belong rather into the ProcNode
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
|
||||
// protected:
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
Connectivity (Ports&& pr, Leads&& lr, NodeID const& nID)
|
||||
Connectivity (Ports&& pr, Leads&& lr)
|
||||
: ports(move(pr))
|
||||
, leads(move(lr))
|
||||
, nodeID(nID)
|
||||
{ }
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
|
||||
|
|
|
|||
|
|
@ -1,113 +0,0 @@
|
|||
/*
|
||||
STATE-CLOSURE.hpp - Key Interface representing a render process and encapsulating state
|
||||
|
||||
Copyright (C)
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
**Lumiera** is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version. See the file COPYING for further details.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/** @file state-closure.hpp
|
||||
** Access point to an ongoing render's processing state.
|
||||
**
|
||||
** @todo WIP-WIP-WIP 2024 Node-Invocation is reworked from ground up for the »Playback Vertical Slice«
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifndef STEAM_ENGINE_STATE_CLOSURE_H
|
||||
#define STEAM_ENGINE_STATE_CLOSURE_H
|
||||
|
||||
|
||||
#include "lib/error.hpp"
|
||||
#include "lib/frameid.hpp"
|
||||
#include "steam/engine/buffhandle.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
namespace steam {
|
||||
namespace engine {
|
||||
|
||||
using lumiera::FrameID;
|
||||
using lumiera::NodeID;
|
||||
|
||||
class StateAdapter;
|
||||
class BuffTableStorage;
|
||||
|
||||
|
||||
/**
|
||||
* Abstraction to access the state of a currently ongoing render/calculation process,
|
||||
* as it is tied to the supporting facilities of the vault layer. An StateClosure (subclass) instance
|
||||
* is the sole connection for the render node to invoke services of the vault needed
|
||||
* to carry out the calculations.
|
||||
*
|
||||
* @see engine::RenderInvocation top-level entrance point
|
||||
* @see nodeinvocation.hpp impl. used from \em within the nodes
|
||||
*/
|
||||
class StateClosure
|
||||
{
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : to be Reworked for »Playback Vertical Slice«
|
||||
public:
|
||||
/** allocate a new writable buffer with type and size according to
|
||||
* the BuffDescr. The actual provider of this buffer depends
|
||||
* on the StateClosure implementation; it could be a temporary, located in
|
||||
* the cache, used for feeding calculated frames over a network, etc.
|
||||
* @return a BuffHandle encapsulating the information necessary to get
|
||||
* at the actual buffer address and for releasing the buffer.
|
||||
*/
|
||||
virtual BuffHandle allocateBuffer (const lumiera::StreamType*) =0;
|
||||
|
||||
/** resign control of the buffer denoted by the handle */
|
||||
virtual void releaseBuffer (BuffHandle&) =0;
|
||||
|
||||
/** declare the data contained in the Buffer to be ready.
|
||||
* The caller is required to restrain itself from modifying the data
|
||||
* afterwards, as this buffer now can be used (readonly) by other
|
||||
* calculation processes in parallel.
|
||||
*/
|
||||
virtual void is_calculated (BuffHandle const&) =0;
|
||||
|
||||
/** generate (or calculate) an ID denoting a media data frame
|
||||
* appearing at the given position in the render network,
|
||||
* for the time point this rendering process is currently
|
||||
* calculating data for.
|
||||
* @param NodeID the unique identification of a specific node
|
||||
* @param chanNo the number of the output channel of this node
|
||||
* @return a complete FrameID which unambiguously denotes this
|
||||
* specific frame and can be used for caching
|
||||
*/
|
||||
virtual FrameID const& genFrameID (NodeID const&, uint chanNo) =0;
|
||||
|
||||
/** try to fetch an existing buffer containing the denoted frame
|
||||
* from a cache or similar backing system (e.g. network peer).
|
||||
* @return either a handle to a readonly buffer, or a null handle
|
||||
* @note the client is responsible for not modifying the provided data
|
||||
*/
|
||||
virtual BuffHandle fetch (FrameID const&) =0;
|
||||
|
||||
/** necessary for creating a local BuffTableChunk */
|
||||
virtual BuffTableStorage& getBuffTableStorage() =0;
|
||||
|
||||
|
||||
protected:
|
||||
virtual ~StateClosure() {};
|
||||
|
||||
/** resolves to the StateClosure object currently "in charge".
|
||||
* Intended as a performance shortcut to avoid calling
|
||||
* up through a chain of virtual functions when deep down
|
||||
* in chained ProcNode::pull() calls. This allows derived
|
||||
* classes to proxy the state interface.
|
||||
*/
|
||||
virtual StateClosure& getCurrentImplementation () =0;
|
||||
|
||||
friend class engine::StateAdapter;
|
||||
};
|
||||
|
||||
}} // namespace steam::engine
|
||||
#endif /*STEAM_ENGINE_STATE_CLOSURE_H*/
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
TURNOUT-SYSTEM.hpp - Encapsulation of the state corresponding to a render calculation
|
||||
|
||||
Copyright (C)
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
2024, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
**Lumiera** is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
|
|
@ -37,8 +37,6 @@
|
|||
#define STEAM_ENGINE_TURNOUT_SYSTEM_H
|
||||
|
||||
|
||||
#include "steam/engine/state-closure.hpp" /////////////////////OOO will take on a different role (if any)
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
#include "lib/nocopy.hpp"
|
||||
#include "lib/time/timevalue.hpp"
|
||||
#include "lib/hetero-data.hpp"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
TURNOUT.hpp - Organise the invocation state within a single pull() call
|
||||
TURNOUT.hpp - Fixed standard scheme to generate data within a Render Node
|
||||
|
||||
Copyright (C)
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
|
||||
/** @file turnout.hpp
|
||||
** Fixed standard setup used in each Port of the Render Node to generate data.
|
||||
** Organise the state related to the invocation of s single ProcNode::pull() call
|
||||
** This header defines part of the "glue" which holds together the render node network
|
||||
** and enables to pull result frames from the nodes. Doing so requires some invocation
|
||||
|
|
@ -54,9 +55,7 @@
|
|||
#include "steam/engine/proc-node.hpp"
|
||||
#include "steam/engine/turnout-system.hpp"
|
||||
#include "steam/engine/feed-manifold.hpp"
|
||||
#include "steam/engine/state-closure.hpp"
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
#include "steam/engine/channel-descriptor.hpp"
|
||||
//#include "vault/gear/job.h"
|
||||
//#include "steam/engine/exit-node.hpp"
|
||||
//#include "lib/time/timevalue.hpp"
|
||||
|
|
@ -79,206 +78,38 @@ namespace engine {
|
|||
using std::forward;
|
||||
using lib::Several;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
|
||||
/**
|
||||
* Adapter to shield the ProcNode from the actual buffer management,
|
||||
* allowing the processing function within ProcNode to use logical
|
||||
* buffer IDs. StateAdapter is created on the stack for each pull()
|
||||
* call, using setup/wiring data preconfigured by the builder.
|
||||
* Its job is to provide the actual implementation of the Cache
|
||||
* push / fetch and recursive downcall to render the source frames.
|
||||
* Definition to emulate a _Concept_ for the *Invocation Adapter*.
|
||||
* For each Proc-Asset, the corresponding Library Adapter must provide
|
||||
* such adapters to access the input and result buffers and finally to
|
||||
* invoke the processing functions from this library.
|
||||
* - `connect(fanIn,fanOut)` access the _Feed Manifold_ and link the buffers
|
||||
* - `invoke()` invoke the processing function, passing the connected buffers
|
||||
*/
|
||||
class StateAdapter
|
||||
: public StateClosure
|
||||
{
|
||||
protected:
|
||||
StateClosure& parent_;
|
||||
StateClosure& current_;
|
||||
|
||||
StateAdapter (StateClosure& callingProcess)
|
||||
: parent_ (callingProcess),
|
||||
current_(callingProcess.getCurrentImplementation())
|
||||
{ }
|
||||
|
||||
virtual StateClosure& getCurrentImplementation () { return current_; }
|
||||
|
||||
|
||||
|
||||
public: /* === proxying the StateClosure interface === */
|
||||
|
||||
virtual void releaseBuffer (BuffHandle& bh) { current_.releaseBuffer (bh); }
|
||||
|
||||
virtual void is_calculated (BuffHandle const& bh) { current_.is_calculated (bh); }
|
||||
|
||||
virtual BuffHandle fetch (FrameID const& fID) { return current_.fetch (fID); }
|
||||
|
||||
virtual BuffTableStorage& getBuffTableStorage() { return current_.getBuffTableStorage(); }
|
||||
|
||||
// note: allocateBuffer() is chosen specifically based on the actual node wiring
|
||||
|
||||
};
|
||||
|
||||
|
||||
template<class ADA>
|
||||
constexpr bool
|
||||
_verify_usable_as_InvocationAdapter()
|
||||
{
|
||||
ASSERT_MEMBER_FUNCTOR (&ADA::connect, void(uint, uint));
|
||||
ASSERT_MEMBER_FUNCTOR (&ADA::invoke, void());
|
||||
return sizeof(ADA);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Invocation context state.
|
||||
* A ref to this type is carried through the chain of NEXT::step() functions
|
||||
* which form the actual invocation sequence. The various operations in this sequence
|
||||
* access the context via the references in this struct, while also using the inherited
|
||||
* public State interface. The object instance actually used as Invocation is created
|
||||
* on the stack and parametrised according to the necessities of the invocation sequence
|
||||
* actually configured. Initially, this real instance is configured without FeedManifold,
|
||||
* because the invocation may be short-circuited due to Cache hit. Otherwise, when
|
||||
* the invocation sequence actually prepares to call the process function of this
|
||||
* ProcNode, a buffer table chunk is allocated by the StateProxy and wired in.
|
||||
* Standard implementation for a _Weaving Pattern_ to connect
|
||||
* the input and output data feeds (buffers) into a processing function.
|
||||
* @tparam INVO a configuration / policy base class to _adapt for invocation_
|
||||
* @note assumptions made regarding the overall structure
|
||||
* - `INVO::Feed` defines an _invocation adapter_ for the processing function
|
||||
* - `INVO::buildFeed()` is a functor to (repeatedly) build `Feed` instances
|
||||
* - the _invocation adapter_ in turn embeds a `FeedManifold<N>` to hold
|
||||
* + an array of input buffer pointers
|
||||
* + an array of output buffer pointers
|
||||
* + `INVO::MAX_SIZ` limits both arrays
|
||||
*/
|
||||
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
|
||||
struct Invocation
|
||||
: StateAdapter
|
||||
{
|
||||
Connectivity const& wiring;
|
||||
const uint outNr;
|
||||
|
||||
FeedManifold* feedManifold;
|
||||
|
||||
protected:
|
||||
/** creates a new invocation context state, without FeedManifold */
|
||||
Invocation (StateClosure& callingProcess, Connectivity const& w, uint o)
|
||||
: StateAdapter(callingProcess),
|
||||
wiring(w), outNr(o),
|
||||
feedManifold(0)
|
||||
{ }
|
||||
|
||||
public:
|
||||
uint nrO() const { return wiring.nrO; }
|
||||
uint nrI() const { return wiring.nrI; }
|
||||
uint buffTabSize() const { return nrO()+nrI(); }
|
||||
|
||||
/** setup the link to an externally allocated buffer table */
|
||||
void setBuffTab (FeedManifold* b) { this->feedManifold = b; }
|
||||
|
||||
bool
|
||||
buffTab_isConsistent ()
|
||||
{
|
||||
return (feedManifold)
|
||||
&& (0 < buffTabSize())
|
||||
&& (nrO()+nrI() <= buffTabSize())
|
||||
&& (feedManifold->inBuff == &feedManifold->outBuff[nrO()] )
|
||||
&& (feedManifold->inHandle == &feedManifold->outHandle[nrO()])
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
/** specialised version filling in the additional information, i.e
|
||||
* the concrete node id and the channel number in question */
|
||||
virtual FrameID const&
|
||||
genFrameID ()
|
||||
{
|
||||
return current_.genFrameID(wiring.nodeID, outNr);
|
||||
}
|
||||
|
||||
virtual FrameID const&
|
||||
genFrameID (NodeID const& nID, uint chanNo)
|
||||
{
|
||||
return current_.genFrameID (nID,chanNo);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
////////////TICKET #249 this strategy should better be hidden within the BuffHandle ctor (and type-erased after creation)
|
||||
struct AllocBufferFromParent ///< using the parent StateAdapter for buffer allocations
|
||||
: Invocation
|
||||
{
|
||||
AllocBufferFromParent (StateClosure& sta, Connectivity const& w, const uint outCh)
|
||||
: Invocation(sta, w, outCh) {}
|
||||
|
||||
virtual BuffHandle
|
||||
allocateBuffer (const lumiera::StreamType* ty) { return parent_.allocateBuffer(ty); } ////////////TODO: actually implement the "allocate from parent" logic!
|
||||
};
|
||||
|
||||
struct AllocBufferFromCache ///< using the global current StateClosure, which will delegate to Cache
|
||||
: Invocation
|
||||
{
|
||||
AllocBufferFromCache (StateClosure& sta, Connectivity const& w, const uint outCh)
|
||||
: Invocation(sta, w, outCh) {}
|
||||
|
||||
virtual BuffHandle
|
||||
allocateBuffer (const lumiera::StreamType* ty) { return current_.allocateBuffer(ty); }
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* The real invocation context state implementation. It is created
|
||||
* by the NodeWiring (Connectivity) of the processing node which
|
||||
* is pulled by this invocation, hereby using the internal configuration
|
||||
* information to guide the selection of the real call sequence
|
||||
*
|
||||
* \par assembling the call sequence implementation
|
||||
* Each ProcNode#pull() call creates such a StateAdapter subclass on the stack,
|
||||
* with a concrete type according to the Connectivity of the node to pull.
|
||||
* This concrete type encodes a calculation Strategy, which is assembled
|
||||
* as a chain of policy templates on top of OperationBase. For each of the
|
||||
* possible configurations we define such a chain (see bottom of nodeoperation.hpp).
|
||||
* The WiringFactory defined in nodewiring.cpp actually drives the instantiation
|
||||
* of all those possible combinations.
|
||||
*/
|
||||
template<class Strategy, class BufferProvider>
|
||||
class ActualInvocationProcess
|
||||
: public BufferProvider
|
||||
, private Strategy
|
||||
{
|
||||
public:
|
||||
ActualInvocationProcess (StateClosure& callingProcess, Connectivity const& w, const uint outCh)
|
||||
: BufferProvider(callingProcess, w, outCh)
|
||||
{ }
|
||||
|
||||
/** contains the details of Cache query and recursive calls
|
||||
* to the predecessor node(s), eventually followed by the
|
||||
* ProcNode::process() callback
|
||||
*/
|
||||
BuffHandle retrieve ()
|
||||
{
|
||||
return Strategy::step (*this);
|
||||
}
|
||||
};
|
||||
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
|
||||
/**
|
||||
* Definition to emulate a _Concept_ for the *Invocation Adapter*.
|
||||
* For each Proc-Asset, the corresponding Library Adapter must provide
|
||||
* such adapters to access the input and result buffers and finally to
|
||||
* invoke the processing functions from this library.
|
||||
* - `connect(fanIn,fanOut)` access the _Feed Manifold_ and link the buffers
|
||||
* - `invoke()` invoke the processing function, passing the connected buffers
|
||||
*/
|
||||
template<class ADA>
|
||||
constexpr bool
|
||||
_verify_usable_as_InvocationAdapter()
|
||||
{
|
||||
ASSERT_MEMBER_FUNCTOR (&ADA::connect, void(uint, uint));
|
||||
ASSERT_MEMBER_FUNCTOR (&ADA::invoke, void());
|
||||
return sizeof(ADA);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Standard implementation for a _Weaving Pattern_ to connect
|
||||
* the input and output data feeds (buffers) into a processing function.
|
||||
* @tparam INVO a configuration / policy base class to _adapt for invocation_
|
||||
* @note assumptions made regarding the overall structure
|
||||
* - `INVO::Feed` defines an _invocation adapter_ for the processing function
|
||||
* - `INVO::buildFeed()` is a functor to (repeatedly) build `Feed` instances
|
||||
* - the _invocation adapter_ in turn embeds a `FeedManifold<N>` to hold
|
||||
* + an array of input buffer pointers
|
||||
* + an array of output buffer pointers
|
||||
* + `INVO::MAX_SIZ` limits both arrays
|
||||
*/
|
||||
template<class INVO>
|
||||
struct SimpleWeavingPattern
|
||||
: INVO
|
||||
|
|
@ -381,10 +212,6 @@ namespace engine {
|
|||
: Port{id}
|
||||
, PAT{forward<INIT> (init)...}
|
||||
{ }
|
||||
// Turnout(Turnout&& rr) ////////////////////////////////////////////OOO investigation of MoveOnly and problems with the builder logic
|
||||
// : Port(static_cast<Port&&>(rr))
|
||||
// , PAT(static_cast<PAT&&>(rr))
|
||||
// { }
|
||||
|
||||
/**
|
||||
* Entrance point to the next recursive step of media processing.
|
||||
|
|
|
|||
384
src/steam/engine/weaving-pattern.hpp
Normal file
384
src/steam/engine/weaving-pattern.hpp
Normal file
|
|
@ -0,0 +1,384 @@
|
|||
/*
|
||||
WEAVING-PATTERN.hpp - Base patterns to organise data connections and render processing invocation
|
||||
|
||||
Copyright (C)
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
2024, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
**Lumiera** is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version. See the file COPYING for further details.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/** @file weaving-pattern.hpp
|
||||
** Construction set to assemble and operate a data processing scheme within a Render Node.
|
||||
** This header defines part of the "glue" which holds together the render node network
|
||||
** and enables to pull result frames from the nodes. Doing so requires some invocation
|
||||
** local state to be maintained, especially a table of buffers used to carry out the
|
||||
** calculations. Further, getting the input buffers filled requires to issue recursive
|
||||
** \c pull() calls, which on the whole creates a stack-like assembly of local invocation
|
||||
** state.
|
||||
** The actual steps to be carried out for a \c pull() call are dependent on the configuration
|
||||
** of the node to pull. Each node has been preconfigured by the builder with a Connectivity
|
||||
** descriptor and a concrete type of a StateAdapter. The actual sequence of steps is defined
|
||||
** in the header nodeoperation.hpp out of a set of basic operation steps. These steps all use
|
||||
** the passed in Invocation object (a sub-interface of StateAdapter) to access the various
|
||||
** aspects of the invocation state.
|
||||
**
|
||||
** # composition of the Invocation State
|
||||
**
|
||||
** For each individual ProcNode#pull() call, the WiringAdapter#callDown() builds an StateAdapter
|
||||
** instance directly on the stack, managing the actual buffer pointers and state references. Using this
|
||||
** StateAdapter, the predecessor nodes are pulled. The way these operations are carried out is encoded
|
||||
** in the actual StateAdapter type known to the NodeWiring (WiringAdapter) instance. All of these actual
|
||||
** StateAdapter types are built as implementing the engine::StateClosure interface.
|
||||
**
|
||||
** @todo relies still on an [obsoleted implementation draft](\ref bufftable-obsolete.hpp)
|
||||
** @see engine::ProcNode
|
||||
** @see engine::StateProxy
|
||||
** @see engine::FeedManifold
|
||||
** @see nodewiring.hpp interface for building/wiring the nodes
|
||||
**
|
||||
** @warning as of 12/2024 first complete integration round of the Render engine ////////////////////////////TICKET #1367
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifndef STEAM_ENGINE_WEAVING_PATTERN_H
|
||||
#define STEAM_ENGINE_WEAVING_PATTERN_H
|
||||
|
||||
#include "steam/common.hpp"
|
||||
#include "steam/engine/proc-node.hpp"
|
||||
#include "steam/engine/turnout-system.hpp"
|
||||
#include "steam/engine/feed-manifold.hpp"
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
//#include "vault/gear/job.h"
|
||||
//#include "steam/engine/exit-node.hpp"
|
||||
//#include "lib/time/timevalue.hpp"
|
||||
//#include "lib/linked-elements.hpp"
|
||||
#include "lib/several.hpp"
|
||||
//#include "lib/util-foreach.hpp"
|
||||
//#include "lib/iter-adapter.hpp"
|
||||
#include "lib/meta/function.hpp"
|
||||
//#include "lib/itertools.hpp"
|
||||
//#include "lib/util.hpp" ////////OOO wegen manifoldSiz<FUN>()
|
||||
|
||||
#include <utility>
|
||||
#include <array>
|
||||
//#include <stack>
|
||||
|
||||
|
||||
namespace steam {
|
||||
namespace engine {
|
||||
|
||||
using std::forward;
|
||||
using lib::Several;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
|
||||
/**
|
||||
* Adapter to shield the ProcNode from the actual buffer management,
|
||||
* allowing the processing function within ProcNode to use logical
|
||||
* buffer IDs. StateAdapter is created on the stack for each pull()
|
||||
* call, using setup/wiring data preconfigured by the builder.
|
||||
* Its job is to provide the actual implementation of the Cache
|
||||
* push / fetch and recursive downcall to render the source frames.
|
||||
*/
|
||||
class StateAdapter
|
||||
: public StateClosure
|
||||
{
|
||||
protected:
|
||||
StateClosure& parent_;
|
||||
StateClosure& current_;
|
||||
|
||||
StateAdapter (StateClosure& callingProcess)
|
||||
: parent_ (callingProcess),
|
||||
current_(callingProcess.getCurrentImplementation())
|
||||
{ }
|
||||
|
||||
virtual StateClosure& getCurrentImplementation () { return current_; }
|
||||
|
||||
|
||||
|
||||
public: /* === proxying the StateClosure interface === */
|
||||
|
||||
virtual void releaseBuffer (BuffHandle& bh) { current_.releaseBuffer (bh); }
|
||||
|
||||
virtual void is_calculated (BuffHandle const& bh) { current_.is_calculated (bh); }
|
||||
|
||||
virtual BuffHandle fetch (FrameID const& fID) { return current_.fetch (fID); }
|
||||
|
||||
virtual BuffTableStorage& getBuffTableStorage() { return current_.getBuffTableStorage(); }
|
||||
|
||||
// note: allocateBuffer() is chosen specifically based on the actual node wiring
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Invocation context state.
|
||||
* A ref to this type is carried through the chain of NEXT::step() functions
|
||||
* which form the actual invocation sequence. The various operations in this sequence
|
||||
* access the context via the references in this struct, while also using the inherited
|
||||
* public State interface. The object instance actually used as Invocation is created
|
||||
* on the stack and parametrised according to the necessities of the invocation sequence
|
||||
* actually configured. Initially, this real instance is configured without FeedManifold,
|
||||
* because the invocation may be short-circuited due to Cache hit. Otherwise, when
|
||||
* the invocation sequence actually prepares to call the process function of this
|
||||
* ProcNode, a buffer table chunk is allocated by the StateProxy and wired in.
|
||||
*/
|
||||
struct Invocation
|
||||
: StateAdapter
|
||||
{
|
||||
Connectivity const& wiring;
|
||||
const uint outNr;
|
||||
|
||||
FeedManifold* feedManifold;
|
||||
|
||||
protected:
|
||||
/** creates a new invocation context state, without FeedManifold */
|
||||
Invocation (StateClosure& callingProcess, Connectivity const& w, uint o)
|
||||
: StateAdapter(callingProcess),
|
||||
wiring(w), outNr(o),
|
||||
feedManifold(0)
|
||||
{ }
|
||||
|
||||
public:
|
||||
uint nrO() const { return wiring.nrO; }
|
||||
uint nrI() const { return wiring.nrI; }
|
||||
uint buffTabSize() const { return nrO()+nrI(); }
|
||||
|
||||
/** setup the link to an externally allocated buffer table */
|
||||
void setBuffTab (FeedManifold* b) { this->feedManifold = b; }
|
||||
|
||||
bool
|
||||
buffTab_isConsistent ()
|
||||
{
|
||||
return (feedManifold)
|
||||
&& (0 < buffTabSize())
|
||||
&& (nrO()+nrI() <= buffTabSize())
|
||||
&& (feedManifold->inBuff == &feedManifold->outBuff[nrO()] )
|
||||
&& (feedManifold->inHandle == &feedManifold->outHandle[nrO()])
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
/** specialised version filling in the additional information, i.e
|
||||
* the concrete node id and the channel number in question */
|
||||
virtual FrameID const&
|
||||
genFrameID ()
|
||||
{
|
||||
return current_.genFrameID(wiring.nodeID, outNr);
|
||||
}
|
||||
|
||||
virtual FrameID const&
|
||||
genFrameID (NodeID const& nID, uint chanNo)
|
||||
{
|
||||
return current_.genFrameID (nID,chanNo);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
////////////TICKET #249 this strategy should better be hidden within the BuffHandle ctor (and type-erased after creation)
|
||||
struct AllocBufferFromParent ///< using the parent StateAdapter for buffer allocations
|
||||
: Invocation
|
||||
{
|
||||
AllocBufferFromParent (StateClosure& sta, Connectivity const& w, const uint outCh)
|
||||
: Invocation(sta, w, outCh) {}
|
||||
|
||||
virtual BuffHandle
|
||||
allocateBuffer (const lumiera::StreamType* ty) { return parent_.allocateBuffer(ty); } ////////////TODO: actually implement the "allocate from parent" logic!
|
||||
};
|
||||
|
||||
struct AllocBufferFromCache ///< using the global current StateClosure, which will delegate to Cache
|
||||
: Invocation
|
||||
{
|
||||
AllocBufferFromCache (StateClosure& sta, Connectivity const& w, const uint outCh)
|
||||
: Invocation(sta, w, outCh) {}
|
||||
|
||||
virtual BuffHandle
|
||||
allocateBuffer (const lumiera::StreamType* ty) { return current_.allocateBuffer(ty); }
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* The real invocation context state implementation. It is created
|
||||
* by the NodeWiring (Connectivity) of the processing node which
|
||||
* is pulled by this invocation, hereby using the internal configuration
|
||||
* information to guide the selection of the real call sequence
|
||||
*
|
||||
* \par assembling the call sequence implementation
|
||||
* Each ProcNode#pull() call creates such a StateAdapter subclass on the stack,
|
||||
* with a concrete type according to the Connectivity of the node to pull.
|
||||
* This concrete type encodes a calculation Strategy, which is assembled
|
||||
* as a chain of policy templates on top of OperationBase. For each of the
|
||||
* possible configurations we define such a chain (see bottom of nodeoperation.hpp).
|
||||
* The WiringFactory defined in nodewiring.cpp actually drives the instantiation
|
||||
* of all those possible combinations.
|
||||
*/
|
||||
template<class Strategy, class BufferProvider>
|
||||
class ActualInvocationProcess
|
||||
: public BufferProvider
|
||||
, private Strategy
|
||||
{
|
||||
public:
|
||||
ActualInvocationProcess (StateClosure& callingProcess, Connectivity const& w, const uint outCh)
|
||||
: BufferProvider(callingProcess, w, outCh)
|
||||
{ }
|
||||
|
||||
/** contains the details of Cache query and recursive calls
|
||||
* to the predecessor node(s), eventually followed by the
|
||||
* ProcNode::process() callback
|
||||
*/
|
||||
BuffHandle retrieve ()
|
||||
{
|
||||
return Strategy::step (*this);
|
||||
}
|
||||
};
|
||||
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1367 : Rebuild the Node Invocation
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
||||
|
||||
/**
|
||||
* Standard implementation for a _Weaving Pattern_ to connect
|
||||
* the input and output data feeds (buffers) into a processing function.
|
||||
* @tparam INVO a configuration / policy base class to _adapt for invocation_
|
||||
* @note assumptions made regarding the overall structure
|
||||
* - `INVO::Feed` defines an _invocation adapter_ for the processing function
|
||||
* - `INVO::buildFeed()` is a functor to (repeatedly) build `Feed` instances
|
||||
* - the _invocation adapter_ in turn embeds a `FeedManifold<N>` to hold
|
||||
* + an array of input buffer pointers
|
||||
* + an array of output buffer pointers
|
||||
* + `INVO::MAX_SIZ` limits both arrays
|
||||
*/
|
||||
template<class INVO>
|
||||
struct SimpleWeavingPattern
|
||||
: INVO
|
||||
{
|
||||
using Feed = typename INVO::Feed;
|
||||
|
||||
static_assert (_verify_usable_as_InvocationAdapter<Feed>());
|
||||
|
||||
Several<PortRef> leadPort;
|
||||
Several<BuffDescr> outTypes;
|
||||
|
||||
uint resultSlot{0};
|
||||
|
||||
/** forwarding-ctor to provide the detailed input/output connections */
|
||||
template<typename...ARGS>
|
||||
SimpleWeavingPattern (Several<PortRef>&& pr
|
||||
,Several<BuffDescr>&& dr
|
||||
,uint resultIdx
|
||||
,ARGS&& ...args)
|
||||
: INVO{forward<ARGS>(args)...}
|
||||
, leadPort{move(pr)}
|
||||
, outTypes{move(dr)}
|
||||
, resultSlot{resultIdx}
|
||||
{ }
|
||||
|
||||
|
||||
Feed
|
||||
mount()
|
||||
{
|
||||
return INVO::buildFeed();
|
||||
}
|
||||
|
||||
void
|
||||
pull (Feed& feed, TurnoutSystem& turnoutSys)
|
||||
{
|
||||
for (uint i=0; i<leadPort.size(); ++i)
|
||||
{
|
||||
BuffHandle inputData = leadPort[i].get().weave (turnoutSys);
|
||||
feed.inBuff.createAt(i, move(inputData));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
shed (Feed& feed, OptionalBuff outBuff)
|
||||
{
|
||||
for (uint i=0; i<outTypes.size(); ++i)
|
||||
{
|
||||
BuffHandle resultData =
|
||||
i == resultSlot and outBuff? *outBuff
|
||||
: outTypes[i].lockBuffer();
|
||||
feed.outBuff.createAt(i, move(resultData));
|
||||
}
|
||||
feed.connect (leadPort.size(),outTypes.size());
|
||||
}
|
||||
|
||||
void
|
||||
weft (Feed& feed)
|
||||
{
|
||||
feed.invoke(); // process data
|
||||
}
|
||||
|
||||
BuffHandle
|
||||
fix (Feed& feed)
|
||||
{
|
||||
for (uint i=0; i<leadPort.size(); ++i)
|
||||
{
|
||||
feed.inBuff[i].release();
|
||||
}
|
||||
for (uint i=0; i<outTypes.size(); ++i)
|
||||
{
|
||||
feed.outBuff[i].emit(); // state transition: data ready
|
||||
if (i != resultSlot)
|
||||
feed.outBuff[i].release();
|
||||
}
|
||||
ENSURE (resultSlot < INVO::MAX_SIZ, "invalid result buffer configured.");
|
||||
return feed.outBuff[resultSlot];
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Processing structure to activate a Render Node and produce result data.
|
||||
* @tparam PAT a _Weaving Pattern,_ which defines in detail how data is retrieved,
|
||||
* combined and processed to yield the results; actually this implementation
|
||||
* is assembled from several building blocks, in accordance to the specific
|
||||
* situation as established by the _Builder_ for a given render node.
|
||||
*/
|
||||
template<class PAT>
|
||||
class Turnout
|
||||
: public Port
|
||||
, public PAT
|
||||
// , util::MoveOnly
|
||||
{
|
||||
using Feed = typename PAT::Feed;
|
||||
|
||||
public:
|
||||
template<typename...INIT>
|
||||
Turnout (ProcID& id, INIT&& ...init)
|
||||
: Port{id}
|
||||
, PAT{forward<INIT> (init)...}
|
||||
{ }
|
||||
|
||||
/**
|
||||
* Entrance point to the next recursive step of media processing.
|
||||
* @param turnoutSys anchor context with parameters and services
|
||||
* @return a BuffHandle exposing the generated result data
|
||||
*/
|
||||
BuffHandle
|
||||
weave (TurnoutSystem& turnoutSys, OptionalBuff outBuff =std::nullopt) override
|
||||
{
|
||||
Feed feed = PAT::mount();
|
||||
PAT::pull(feed, turnoutSys);
|
||||
PAT::shed(feed, outBuff);
|
||||
PAT::weft(feed);
|
||||
return PAT::fix (feed);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
}}// namespace steam::engine
|
||||
#endif /*STEAM_ENGINE_WEAVING_PATTERN_H*/
|
||||
|
|
@ -15,11 +15,13 @@
|
|||
/** @file operationpoint.cpp
|
||||
** Implementation of primitive builder operations on at the _current point of operation_.
|
||||
** @todo stalled design draft from 2008 -- basically still considered relevant as of 2016
|
||||
** @todo confirmed 12/2024 : the ideas drafted here are considered relevant,
|
||||
** yet it is clear meanwhile that the Build will work on meta-descriptors,
|
||||
** and not the actual Render Nodes
|
||||
*/
|
||||
|
||||
|
||||
#include "steam/mobject/builder/operationpoint.hpp"
|
||||
#include "steam/engine/proc-node.hpp"
|
||||
#include "steam/asset/media.hpp"
|
||||
#include "steam/asset/proc.hpp"
|
||||
#include "steam/engine/node-factory.hpp"
|
||||
|
|
@ -35,7 +37,11 @@ namespace builder {
|
|||
// using util::isnil;
|
||||
using engine::NodeFactory;
|
||||
|
||||
using engine::PNode;
|
||||
/** @todo placeholder introduced 12/2024 to abstract from the actual Render Nodes */
|
||||
struct PNode
|
||||
{
|
||||
;
|
||||
};
|
||||
|
||||
|
||||
struct RefPoint
|
||||
|
|
|
|||
|
|
@ -82040,8 +82040,8 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1713819879109" ID="ID_943908122" MODIFIED="1720997843192" TEXT="Entwurf und Aufbau">
|
||||
<arrowlink COLOR="#c80a37" DESTINATION="ID_845562088" ENDARROW="Default" ENDINCLINATION="-130;10;" ID="Arrow_ID_66382855" STARTARROW="None" STARTINCLINATION="42;-31;"/>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1713819879109" ID="ID_943908122" MODIFIED="1734059460519" TEXT="Entwurf und Aufbau">
|
||||
<arrowlink COLOR="#c80a37" DESTINATION="ID_845562088" ENDARROW="Default" ENDINCLINATION="-381;28;" ID="Arrow_ID_66382855" STARTARROW="None" STARTINCLINATION="42;-31;"/>
|
||||
<arrowlink COLOR="#fdd3b6" DESTINATION="ID_1102491970" ENDARROW="Default" ENDINCLINATION="-366;-51;" ID="Arrow_ID_1227159439" STARTARROW="None" STARTINCLINATION="30;255;"/>
|
||||
<linktarget COLOR="#fde0ca" DESTINATION="ID_943908122" ENDARROW="Default" ENDINCLINATION="-1682;204;" ID="Arrow_ID_1115019309" SOURCE="ID_1278689110" STARTARROW="None" STARTINCLINATION="-1643;116;"/>
|
||||
<icon BUILTIN="pencil"/>
|
||||
|
|
@ -87158,6 +87158,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node CREATED="1733588482254" ID="ID_1143369961" MODIFIED="1733588491229" TEXT="direkt im Stack-Frame: das TurnoutSystem">
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1733588262543" ID="ID_855223653" MODIFIED="1733588650882" TEXT="Entwurf Storage-Layout für Turnout-System">
|
||||
<linktarget COLOR="#482eb7" DESTINATION="ID_855223653" ENDARROW="Default" ENDINCLINATION="-595;39;" ID="Arrow_ID_342943763" SOURCE="ID_1698079544" STARTARROW="None" STARTINCLINATION="-57;-58;"/>
|
||||
<linktarget COLOR="#5d3c71" DESTINATION="ID_855223653" ENDARROW="Default" ENDINCLINATION="-921;1508;" ID="Arrow_ID_642394255" SOURCE="ID_603334752" STARTARROW="None" STARTINCLINATION="-1356;-81;"/>
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node BACKGROUND_COLOR="#f8f1cb" COLOR="#a50125" CREATED="1733589576707" ID="ID_1093208209" MODIFIED="1733589591873" TEXT="Design-Problem: variable Storage-Größe">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
|
|
@ -87532,6 +87533,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#fefc4e" COLOR="#351d75" CREATED="1733704272454" ID="ID_927225402" MODIFIED="1733755186758" TEXT="damit zeichnet sich ein vielversprechendes Misch-Modell ab">
|
||||
<linktarget COLOR="#314dba" DESTINATION="ID_927225402" ENDARROW="Default" ENDINCLINATION="536;1135;" ID="Arrow_ID_352726523" SOURCE="ID_64712491" STARTARROW="None" STARTINCLINATION="-380;-913;"/>
|
||||
<font BOLD="true" NAME="SansSerif" SIZE="12"/>
|
||||
<icon BUILTIN="forward"/>
|
||||
<node CREATED="1733704318588" ID="ID_1636257155" MODIFIED="1733704334288">
|
||||
|
|
@ -88552,7 +88554,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1714181482947" ID="ID_845562088" LINK="https://issues.lumiera.org/ticket/905" MODIFIED="1728656690658" TEXT="Ticket #905 als Anker verwenden">
|
||||
<linktarget COLOR="#c80a37" DESTINATION="ID_845562088" ENDARROW="Default" ENDINCLINATION="-130;10;" ID="Arrow_ID_66382855" SOURCE="ID_943908122" STARTARROW="None" STARTINCLINATION="42;-31;"/>
|
||||
<linktarget COLOR="#c80a37" DESTINATION="ID_845562088" ENDARROW="Default" ENDINCLINATION="-381;28;" ID="Arrow_ID_66382855" SOURCE="ID_943908122" STARTARROW="None" STARTINCLINATION="42;-31;"/>
|
||||
<icon BUILTIN="yes"/>
|
||||
<node COLOR="#435e98" CREATED="1714181927456" ID="ID_7655935" LINK="https://issues.lumiera.org/ticket/1364" MODIFIED="1728656675946" TEXT="Tracking-Ticket #1364 »Render Node Network«">
|
||||
<icon BUILTIN="info"/>
|
||||
|
|
@ -88652,8 +88654,8 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1733525831136" ID="ID_1553180375" MODIFIED="1733527489987" TEXT="NodeBuilder_test">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node CREATED="1733525872194" ID="ID_1854723929" MODIFIED="1733525888068" TEXT="Erzeugen einzelner Nodes durch den Node-Builder"/>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1733531449614" ID="ID_481525559" MODIFIED="1733577896049" TEXT="speziell auch Anlegen eines ParamAgent">
|
||||
<linktarget COLOR="#406cd3" DESTINATION="ID_481525559" ENDARROW="Default" ENDINCLINATION="-129;9;" ID="Arrow_ID_667421116" SOURCE="ID_664954545" STARTARROW="None" STARTINCLINATION="-358;-24;"/>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1733531449614" ID="ID_481525559" MODIFIED="1734059241149" TEXT="speziell auch Anlegen einer Parameter-Node">
|
||||
<linktarget COLOR="#406cd3" DESTINATION="ID_481525559" ENDARROW="Default" ENDINCLINATION="-140;9;" ID="Arrow_ID_667421116" SOURCE="ID_664954545" STARTARROW="None" STARTINCLINATION="-358;-24;"/>
|
||||
<linktarget COLOR="#fe433f" DESTINATION="ID_481525559" ENDARROW="Default" ENDINCLINATION="1490;75;" ID="Arrow_ID_570772162" SOURCE="ID_1587342377" STARTARROW="None" STARTINCLINATION="-530;-37;"/>
|
||||
<icon BUILTIN="pencil"/>
|
||||
</node>
|
||||
|
|
@ -88797,7 +88799,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<arrowlink COLOR="#406cd3" DESTINATION="ID_932666491" ENDARROW="Default" ENDINCLINATION="-128;9;" ID="Arrow_ID_16658347" STARTARROW="None" STARTINCLINATION="-353;-26;"/>
|
||||
</node>
|
||||
<node CREATED="1733577653926" ID="ID_664954545" MODIFIED="1733577896049" TEXT="ParamAgent zum Einspeisen der Parameter-Daten">
|
||||
<arrowlink COLOR="#406cd3" DESTINATION="ID_481525559" ENDARROW="Default" ENDINCLINATION="-129;9;" ID="Arrow_ID_667421116" STARTARROW="None" STARTINCLINATION="-358;-24;"/>
|
||||
<arrowlink COLOR="#406cd3" DESTINATION="ID_481525559" ENDARROW="Default" ENDINCLINATION="-140;9;" ID="Arrow_ID_667421116" STARTARROW="None" STARTINCLINATION="-358;-24;"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -91322,6 +91324,17 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1734060125195" ID="ID_1347066000" MODIFIED="1734060532007" TEXT="Entwurf um Storage + Funktor für Parameter ergänzen">
|
||||
<linktarget COLOR="#b02152" DESTINATION="ID_1347066000" ENDARROW="Default" ENDINCLINATION="-739;36;" ID="Arrow_ID_1367798112" SOURCE="ID_1795912761" STARTARROW="None" STARTINCLINATION="532;31;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#c8c0b6" COLOR="#435e98" CREATED="1734060219654" ID="ID_64712491" MODIFIED="1734060380089" TEXT="Konzeption der Nutz-Muster">
|
||||
<arrowlink COLOR="#314dba" DESTINATION="ID_927225402" ENDARROW="Default" ENDINCLINATION="536;1135;" ID="Arrow_ID_352726523" STARTARROW="None" STARTINCLINATION="-380;-913;"/>
|
||||
<icon BUILTIN="info"/>
|
||||
<node CREATED="1734060389519" ID="ID_1944279376" LINK="#ID_51687123" MODIFIED="1734060422155" TEXT="hatte zunächst ein allgemeines Konzept für die Parameter entwickelt"/>
|
||||
<node CREATED="1734060427954" ID="ID_714381100" MODIFIED="1734060440806" TEXT="draus dann ein Storage-Layout in der Render-Engine entwickelt"/>
|
||||
<node CREATED="1734060460509" ID="ID_1434138828" LINK="#ID_532258033" MODIFIED="1734060510084" TEXT="HetroData : Hilfskomponente zur Implementierung des Turnout-Systems"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1720620607691" ID="ID_1114186515" MODIFIED="1720620622602" TEXT="diese Invocation nun konfigurierbar machen">
|
||||
|
|
@ -91359,7 +91372,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
<node CREATED="1721003586265" ID="ID_833935002" MODIFIED="1721003607658" TEXT="und obendrauf kommen nochmal jeweils spezielle Konfigurations-APIs"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1721000066150" ID="ID_1111138525" MODIFIED="1729962104565" TEXT="auch dieses per Prototyping ausarbeiten">
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1721000066150" ID="ID_1111138525" MODIFIED="1734059986870" TEXT="auch dieses per Prototyping ausarbeiten">
|
||||
<linktarget COLOR="#b90172" DESTINATION="ID_1111138525" ENDARROW="Default" ENDINCLINATION="2;-47;" ID="Arrow_ID_248579830" SOURCE="ID_1888404885" STARTARROW="None" STARTINCLINATION="-4;46;"/>
|
||||
<linktarget COLOR="#ff6936" DESTINATION="ID_1111138525" ENDARROW="Default" ENDINCLINATION="-884;1900;" ID="Arrow_ID_456241753" SOURCE="ID_1138984645" STARTARROW="None" STARTINCLINATION="692;47;"/>
|
||||
<icon BUILTIN="yes"/>
|
||||
|
|
@ -94196,6 +94209,11 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1734059951987" ID="ID_1795912761" MODIFIED="1734060532006" TEXT="bestehenden Entwurf um Parameter ergänzen">
|
||||
<arrowlink COLOR="#b02152" DESTINATION="ID_1347066000" ENDARROW="Default" ENDINCLINATION="-739;36;" ID="Arrow_ID_1367798112" STARTARROW="None" STARTINCLINATION="532;31;"/>
|
||||
<linktarget COLOR="#da1877" DESTINATION="ID_1795912761" ENDARROW="Default" ENDINCLINATION="-997;61;" ID="Arrow_ID_1582668720" SOURCE="ID_1344849864" STARTARROW="None" STARTINCLINATION="-507;-39;"/>
|
||||
<icon BUILTIN="pencil"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1733428913753" ID="ID_1660514427" MODIFIED="1733428922824" TEXT="zugehörige ParamAgent-Nodes">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
|
|
@ -95046,7 +95064,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<icon BUILTIN="hourglass"/>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1728786069167" ID="ID_1584473368" MODIFIED="1728786088974" TEXT="Aufruf-Pfad durchimplementieren">
|
||||
<icon BUILTIN="flag-pink"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1733531749477" ID="ID_1587342377" MODIFIED="1733577719352" TEXT="ParamAgent im NodeBuilder_test anlegen">
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1733531749477" ID="ID_1587342377" MODIFIED="1734059374412" TEXT="Param-Functor im NodeBuilder_test anlegen">
|
||||
<arrowlink COLOR="#fe433f" DESTINATION="ID_481525559" ENDARROW="Default" ENDINCLINATION="1490;75;" ID="Arrow_ID_570772162" STARTARROW="None" STARTINCLINATION="-530;-37;"/>
|
||||
<linktarget COLOR="#f9407e" DESTINATION="ID_1587342377" ENDARROW="Default" ENDINCLINATION="330;471;" ID="Arrow_ID_316456085" SOURCE="ID_635342516" STARTARROW="None" STARTINCLINATION="667;53;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
|
|
@ -95054,6 +95072,15 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<linktarget COLOR="#d20e48" DESTINATION="ID_1860532476" ENDARROW="Default" ENDINCLINATION="169;-7;" ID="Arrow_ID_1150766303" SOURCE="ID_1712932544" STARTARROW="None" STARTINCLINATION="117;6;"/>
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1734059376947" ID="ID_603334752" MODIFIED="1734059596013" TEXT="muß Storage-Layout für das Turnout-System festlegen">
|
||||
<arrowlink COLOR="#5d3c71" DESTINATION="ID_855223653" ENDARROW="Default" ENDINCLINATION="-921;1508;" ID="Arrow_ID_642394255" STARTARROW="None" STARTINCLINATION="-1356;-81;"/>
|
||||
<icon BUILTIN="yes"/>
|
||||
<icon BUILTIN="pencil"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1734059643300" ID="ID_1344849864" MODIFIED="1734060101312" TEXT="Param-Storage in Weaving-Pattern einführen">
|
||||
<arrowlink COLOR="#da1877" DESTINATION="ID_1795912761" ENDARROW="Default" ENDINCLINATION="-997;61;" ID="Arrow_ID_1582668720" STARTARROW="None" STARTINCLINATION="-507;-39;"/>
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1731890254602" ID="ID_447051297" MODIFIED="1731890346832" TEXT="brauche Buffer">
|
||||
<arrowlink COLOR="#bb4c6b" DESTINATION="ID_1319945622" ENDARROW="Default" ENDINCLINATION="-663;35;" ID="Arrow_ID_542692149" STARTARROW="None" STARTINCLINATION="745;112;"/>
|
||||
|
|
@ -96831,7 +96858,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<arrowlink COLOR="#ff6936" DESTINATION="ID_1680202759" ENDARROW="Default" ENDINCLINATION="-884;1900;" ID="Arrow_ID_1934503032" STARTARROW="None" STARTINCLINATION="789;48;"/>
|
||||
<icon BUILTIN="xmag"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1721000066150" ID="ID_1138984645" MODIFIED="1729962104565" TEXT="einen Weaving-Pattern-Builder entwerfen">
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1721000066150" ID="ID_1138984645" MODIFIED="1734059986870" TEXT="einen Weaving-Pattern-Builder entwerfen">
|
||||
<arrowlink COLOR="#ff6936" DESTINATION="ID_1111138525" ENDARROW="Default" ENDINCLINATION="-884;1900;" ID="Arrow_ID_456241753" STARTARROW="None" STARTINCLINATION="692;47;"/>
|
||||
<icon BUILTIN="xmag"/>
|
||||
</node>
|
||||
|
|
|
|||
Loading…
Reference in a new issue