Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
PortBuilderRoot< POL, DAT > Class Template Reference

#include "steam/engine/node-builder.hpp"

Description

template<class POL, class DAT>
class steam::engine::PortBuilderRoot< POL, DAT >

Nested DSL builder scope to define a single Port for the enclosing Node.

Note
inherits from NodeBuilder and slices away the subclass when done.

Definition at line 280 of file node-builder.hpp.

Public Member Functions

NodeBuilder< POL, DAT > completePort ()
 
template<typename FUN >
auto invoke (StrView portSpec, FUN fun)
 setup standard wiring to adapt the given processing function.
 
template<class SPEC >
auto computeParam (SPEC &&)
 setup a »ParamAgentNode« to compute additional parameters and then delegate into an existing node invocation.
 

Friends

PortBuilderRoot NodeBuilder ()
 

Private Member Functions

 PortBuilderRoot (NodeBuilder< POL, DAT > &&anchor)
 

Additional Inherited Members

- Protected Member Functions inherited from NodeBuilder< POL, DAT >
 NodeBuilder (StrView nodeSymbol, INIT &&...alloInit)
 
 NodeBuilder (NodeBuilder< POL, D0 > &&pred, SizMark< siz >, BUILD &&entryBuilder)
 
NodeBuilder && addLead (ProcNode const &lead)
 
PortBuilderRoot< POL, DAT > preparePort ()
 recursively enter detailed setup of a single processing port
 
auto withAllocator (INIT &&...alloInit)
 cross-builder function to specify usage of a dedicated node allocator
 
Connectivity build ()
 Terminal: complete the ProcNode Connectivity defined thus far.
 
- Protected Attributes inherited from NodeBuilder< POL, DAT >
StrView symbol_
 
LeadRefs leads_
 
DAT patternData_
 

Constructor & Destructor Documentation

◆ PortBuilderRoot()

template<class POL , class DAT >
PortBuilderRoot ( NodeBuilder< POL, DAT > &&  anchor)
inlineprivate

Definition at line 303 of file node-builder.hpp.

Member Function Documentation

◆ completePort()

template<class POL , class DAT >
NodeBuilder< POL, DAT > completePort ( )
inline

Definition at line 285 of file node-builder.hpp.

◆ invoke()

template<class POL , class DAT >
template<typename FUN >
auto invoke ( StrView  portSpec,
FUN  fun 
)

setup standard wiring to adapt the given processing function.

Returns
a PortBuilder specialised to wrap the given FUN
Parameters
qualifiera semantic distinction of the implementation function
funinvocation 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 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.

Definition at line 599 of file node-builder.hpp.

◆ computeParam()

template<class POL , class DAT >
template<class SPEC >
auto computeParam ( SPEC &&  ref)

setup a »ParamAgentNode« to compute additional parameters and then delegate into an existing node invocation.

Remarks
  • this is an advanced setup for generating a complex set of derived parameters, which can then be used by all nodes within a complete subtree of the node-graph.
  • such a setup is not necessary for simple parameters based on nominal timeline time.
  • the purpose is either to avoid redundancy or to draw from additional contextual parameter sources (which must be accessible with the help of the processKey or some global service or plug-in)
  • another special scenario could be to synthesise further data based on the consolidated set of current automation values, possibly together with contextual data; basically some kind of parameter fusion that can not reasonably be pre-defined in the High-level-Model, but must really be computed late, directly from the render process.
  • this function enters a nested port-builder, which will setup a »Param Weaving Pattern«
  • at Node invocation time, this Weaving Pattern will first evaluate all parameter-funcors, then consolidate the generated parameters into a local data block on the stack and link this data block into the TurnoutSystem of this invocation; after establishing this quite tricky and fragile setup, the invocation will recursively delegate to another Node-Port, which thus performs in this extended scope and can refer to all the additional parameters.
  • To define the set of parameter-functors, you need to use a helper-builder based on steam::engine::ParamBuildSpec, starting with steam::engine::buildParamSpec().
  • this generates a Param Spec, which especially provides accessor functors for each of the additional parameters; you need to bind these accessor functors into the parameter-functors of nested nodes which want to access the additional parameters.
  • it is thus necessary first to build the Param Spec, then to build the complete subtree of processing nodes for the actual processing (aka the delegate tree), and then finally create a Param Agent Node with this builder, referring to the entry point into the processing tree as delegate lead (see ParamAgentBuilder)
Returns
a nested ParamAgentBuilder to set up the desired wiring and delegate
See also
NodeFeed_test::feedParamNode()

Definition at line 785 of file node-builder.hpp.

Friends And Related Symbol Documentation

◆ NodeBuilder

template<class POL , class DAT >
PortBuilderRoot NodeBuilder ( )
friend
+ Inheritance diagram for PortBuilderRoot< POL, DAT >:
+ Collaboration diagram for PortBuilderRoot< POL, DAT >:

The documentation for this class was generated from the following file: