82 #ifndef ENGINE_NODE_BUILDER_H 83 #define ENGINE_NODE_BUILDER_H 115 template<
class I,
class E=I>
128 template<
class POL,
class I,
class E=I>
133 template<
class POL,
class DAT>
136 template<
class POL,
class DAT>
142 template<
class POL,
class DAT = PatternDataAnchor>
155 template<
typename...INIT>
156 NodeBuilder (StrView nodeSymbol, INIT&& ...alloInit)
157 : symbol_{nodeSymbol}
158 , leads_{forward<INIT> (alloInit)...}
161 template<
class BUILD, u
int siz,
class D0>
163 : symbol_{pred.symbol_}
164 , leads_{move (pred.leads_)}
165 , patternData_{move (pred.patternData_), forward<BUILD> (entryBuilder)}
168 template<
class P,
class D0>
199 template<
template<
typename>
class ALO =std::void_t,
typename...INIT>
215 patternData_.collectEntries(ports);
223 template<
class POL,
class D0, u
int siz,
class BUILD>
229 template<
class POL,
class DAT>
237 static_assert(not
sizeof(POL),
238 "can not build a port without specifying a processing function");
243 template<
typename FUN>
244 auto invoke (StrView portSpec, FUN fun);
247 template<
class ADA,
typename...ARGS>
248 auto adaptInvocation(ARGS&& ...args);
266 template<
class POL,
class DAT>
275 template<
class POL,
class DAT,
class WAB>
286 template<
class ILA,
typename...ARGS>
288 createBuffers (ARGS&& ...args)
290 UNIMPLEMENTED (
"define builder for all buffers to use");
299 weavingBuilder_.selectResultSlot(r);
307 return connectLeadPort (idx, this->defaultPort_);
314 return connectLeadPort (leadNode, this->defaultPort_);
321 if (idx >= _Par::leads_.size())
322 throw err::Logic{
_Fmt{
"Builder refers to lead-node #%d, yet only %d are currently defined."}
323 % idx % _Par::leads_.size()
326 weavingBuilder_.attachToLeadPort (_Par::leads_[idx], port);
336 if (util::isSameObject (leadNode, lead))
340 if (knownEntry == _Par::leads_.size())
341 _Par::addLead (leadNode);
343 ENSURE (knownEntry < _Par::leads_.size());
344 weavingBuilder_.attachToLeadPort (knownEntry, port);
352 this->defaultPort_ = defaultPort;
363 weavingBuilder_.connectRemainingInputs (_Par::leads_, this->defaultPort_);
364 weavingBuilder_.fillRemainingBufferTypes();
366 ,weavingBuilder_.sizMark
367 ,weavingBuilder_.
build()};
371 template<
typename FUN>
374 , weavingBuilder_{forward<FUN> (fun), _Par::symbol_, portSpec, _Par::leads_.policyConnect()}
375 , defaultPort_{_Par::patternData_.size()}
403 template<
class POL,
class DAT>
404 template<
typename FUN>
445 UNIMPLEMENTED (
"enumerate all source feeds required");
452 UNIMPLEMENTED (
"recursively define a predecessor feed");
462 UNIMPLEMENTED(
"Level-3 build-walk");
473 from (
void* procAsset)
475 UNIMPLEMENTED (
"recursively enter definition of processor node to produce this feed link");
488 UNIMPLEMENTED(
"start a connectivity definition at Level-3");
PortBuilder conectLead(ProcNode &leadNode)
connect the next input slot to either existing or new lead-node"
auto invoke(StrView portSpec, FUN fun)
setup standard wiring to adapt the given processing function.
Several< I > build()
Terminal Builder: complete and lock the collection contents.
void build()
Terminal: trigger the Level-3 build walk to produce a ProcNode network.
PortBuilder connectLead(uint idx)
connect the next input slot to existing lead-node given by index
auto retrieve(void *streamType)
Entrance point for defining data flows and processing steps.
Types marked with this mix-in may be moved but not copied.
A low-level Builder to prepare and adapt for a specific node invocation.
Extension point: how to configure the SeveralBuilder to use an allocator ALO, initialised by ARGS...
Steam-Layer implementation namespace root.
A front-end for using printf-style formatting.
Fixed standard setup used in each Port of the Render Node to generate data.
PortBuilder connectLeadPort(ProcNode &leadNode, uint port)
connect next input to existing or new lead-node, with given port-number
PortBuilder useLeadPort(uint defaultPort)
use given port-index as default for all following connections
Derived specific exceptions within Lumiera's exception hierarchy.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Iterator-style access handle to a referred container with subscript index.
Construction kit to establish an invocation scheme for media calculations.
Subscript-index based access to a container, packaged as iterator.
Builder to create and populate a lib::Several<I>.
Interface to the processing nodes and the render nodes network.
auto completePort()
Terminal: complete the Port wiring and return to the node level.
A collection of frequently used helper functions to support unit testing.
Connectivity build()
Terminal: complete the ProcNode Connectivity defined thus far.
auto prepareNode(StrView nodeSymbol)
Entrance point for building actual Render Node Connectivity (Level-2)
Lumiera error handling (C++ interface).
PortBuilderRoot< POL, DAT > preparePort()
recursively enter detailed setup of a single processing port
Interface: Description of the input and output ports, processing function and predecessor nodes for a...
Key abstraction of the Render Engine: A Data processing Node.
auto withAllocator(INIT &&...alloInit)
cross-builder function to specify usage of a dedicated node allocator
Policy Mix-In used to adapt to the ElementFactory and Allocator.
SeveralBuilder && append(VAL &&val, VALS &&...vals)
append copies of one or several arbitrary elements
NodeBuilder(NodeBuilder< POL, D0 > &&, SizMark< siz >, BUILD &&) -> NodeBuilder< POL, PatternData< D0, BUILD, siz >>
Deduction Guide: help the compiler with deducing follow-up NodeBuilder parameters.
Builder to create and populate instances of the lib::Several container.
PortBuilder asResultSlot(uint r)
define the output slot to use as result
PortBuilder connectLeadPort(uint idx, uint port)
connect next input to lead-node, using a specific port-number