131#ifndef STEAM_ENGINE_WEAVING_PATTERN_BUILDER_H
132#define STEAM_ENGINE_WEAVING_PATTERN_BUILDER_H
158 using StrView = std::string_view;
167 template<
class POL,
class I,
class E=I>
171 using SizMark = std::integral_constant<uint,siz>;
184 template<
class PAR,
class BUILD, u
int siz>
196 PAR::collectEntries (dataBuilder, cntElm+1, max (siz,maxSiz));
202 : PAR{move (predecessor)}
219 dataBuilder.reserve (cntElm, maxSiz);
245 template<
class POL,
class PROT>
271 template<
typename...INIT>
307 static_assert (PROT::template isSuitableParamFun<PFX>()
308 ,
"suitable as param-functor for given processing-functor");
312 return AdaptedWeavingBuilder{move(*
this)
313 ,
prototype_.moveAdaptedParam (move (paramFunctor))
331 static_assert (PROT::template isSuitableParamAdaptor<DEC>()
332 ,
"suitable to adapt the processing-functor's param argument");
336 return AdaptedWeavingBuilder{move(*
this)
337 ,
prototype_.moveTransformedParam (move (decorator))
346 "but all %d »input slots« of the processing function are already connected."}
361 throw err::Logic{
_Fmt{
"Builder: attempt to auto-connect %d further »input slots«, "
362 "but this ProcNode has only %d predecessor nodes, while the "
363 "given processing function expects %d inputs."}
390 for (
auto& [i,typeConstructor] : izip(
buffTypes))
395 ENSURE (outTypes.size() ==
FAN_O);
400 ,types = move(outTypes.build())
405 (PortDataBuilder& portData)
mutable ->
void
407 portData.template emplace<TurnoutWeaving> (procID
434 template<
typename BU>
446 {
return provider.getDescriptor<BU>(); };
468 std::vector<TypeMarker> defaultBufferTypes;
469 defaultBufferTypes.reserve (std::tuple_size_v<OutDescriptorTup>);
473 defaultBufferTypes.emplace_back(
474 desc.makeBufferDescriptor());
476 return defaultBufferTypes;
Abstraction to represent buffer management and lifecycle within the render engine.
Extension to allow placing objects right into the buffers, taking ownership.
Access point to singletons and other kinds of dependencies designated by type.
Builder to create and populate a lib::Several<I>.
Policy & policyConnect()
expose policy to configure other ServeralBuilder
An opaque descriptor to identify the type and further properties of a data buffer.
Interface: a facility providing and managing working buffers for media calculations.
static ProcID & describe(StrView nodeSymb, StrView portSpec, ProcAttrib extAttrib=ProcAttrib{})
build and register a processing ID descriptor
Key abstraction of the Render Engine: A Data processing Node.
Port & getPort(uint portIdx)
Processing structure to activate a Render Node and produce result data.
Types marked with this mix-in may be moved but not copied.
A front-end for using printf-style formatting.
Dependency context to hold global parameters and services for the render engine.
Lumiera error handling (C++ interface).
Iterator builder to combine several iterables into a tuple sequence.
auto izip(ITS &&...iters)
tuple-combining iterator prefixed by index sequence
LumieraError< LERR_(LOGIC)> Logic
lib::SeveralBuilder< I, E, POL::template Policy > DataBuilder
A builder to collect working data.
std::integral_constant< uint, siz > SizMark
std::reference_wrapper< Port > PortRef
Steam-Layer implementation namespace root.
Metadata interface to generate symbolic and hash ID tags for media processing steps.
Builder to create and populate instances of the lib::Several container.
Data recursion end: prime the port data storage by reserving appropriate storage to hold all known Tu...
void collectEntries(DAB &dataBuilder, uint cntElm, uint maxSiz)
Recursive functional data structure to collect weaving pattern data and finally to emplace a Turnout ...
void collectEntries(DAB &dataBuilder, uint cntElm=0, uint maxSiz=0)
PatternData(PAR &&predecessor, BUILD &&entryBuilder)
TypeMarker makeBufferDescriptor() const
Setup the constructor function for the default BufferDescriptors.
A low-level Builder to prepare and adapt for a specific node invocation.
lib::meta::Tuple< OutTypesDescriptors > OutDescriptorTup
void maybeFillDefaultProviders(size_t maxSlots)
auto adaptProcFunParam(DEC decorator)
Adapt parameter handling by prepending the given transformer function to supply the parameter argumen...
static auto fillDefaultBufferTypes()
WeavingBuilder && selectResultSlot(uint idx)
static constexpr OutDescriptorTup outDescriptors
A tuple of BufferDescriptor instances for all output buffer types.
PROT::template OutTypesApply< BufferDescriptor > OutTypesDescriptors
WeavingBuilder(WeavingBuilder< POL, PREV > &&prevBuilder, PROT &&adaptedPrototype)
cross-ctor to switch to another prototype
WeavingBuilder< POL, AdaptedPrototype< PFX > > Adapted
DataBuilder< POL, PortRef > leadPorts
std::reference_wrapper< BufferProvider > ProviderRef
WeavingBuilder(PROT &&prototype, StrView nodeSymb, StrView portSpec, INIT &&...alloInit)
Turnout< WeavingPattern > TurnoutWeaving
std::vector< TypeMarker > buffTypes
std::function< BuffDescr(BufferProvider &)> TypeMarker
static constexpr uint FAN_I
WeavingBuilder< POL, DecoratedPrototype< DEC > > Decorated
WeavingBuilder && attachToLeadPort(ProcNode &lead, uint portNr)
WeavingBuilder && connectRemainingInputs(DataBuilder< POL, ProcNodeRef > &knownLeads, uint defaultPort)
static constexpr SizMark< sizeof(TurnoutWeaving)> sizMark
std::vector< ProviderRef > providers
auto adaptParam(PFX paramFunctor)
Adapt a parameter-functor into the Feed Prototype, so that it is invoked whenever a new FeedManifold ...
lib::meta::TupleClosureBuilder< typename PROT::Param > ParamClosure
PROT::template Decorated< DEC > DecoratedPrototype
type builder for FeedPrototype with remoulded parameter input
MediaWeavingPattern< PROT > WeavingPattern
PROT::template Adapted< PFX > AdaptedPrototype
type builder for FeedPrototype adapted to another parameter-fun
static constexpr uint FAN_O
Partial binding for construction of tuple-like records.
Metaprogramming with tuples-of-types and the std::tuple record.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...