Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
FeedManifold< FUN > Struct Template Reference

#include "steam/engine/feed-manifold.hpp"

Description

template<class FUN>
struct steam::engine::FeedManifold< FUN >

Adapter to connect input/output buffers to a processing functor backed by an external library.

Essentially, this is structured storage tailored specifically to a given functor signature. Tables of buffer handles are provided for the downstream code to store results received from preceding nodes or to pick up calculated data after invocation. From these BuffHandle entries, buffer pointers are retrieved and packaged suitably for use by the wrapped invocation functor. This setup is intended for use by a »weaving pattern« within the invocation of a processing node for the purpose of media processing or data calculation.

Interface exposed to down-stream code

Data fields are typed to suit the given functor FUN, and are present only when needed

  • param holds a parameter value or tuple of values, as passed to the constructor
  • inBuff and outBuff are chunks of UninitialisedStorage with suitable dimension to hold an array of BuffHandle to organise input- and output-buffers
  • the constants FAN_P, FAN_I and FAN_O reflect the number of individual elements connected for parameters, inputs and outputs respectively.
  • inBuff.array() and outBuff.array() expose the storage for handles as std::array, with suitable dimension, subscript-operator and iteration. Note however that the storage itself is uninitialised and existing handles must be emplaced by invoking copy-construction e.g. outBuff.createAt (idx, givenHandle)
  • after completely populating all BuffHandle slots this way, FeedManifold::connect() will pick up buffer pointers and transfer them into the associated locations in the input and output arguments inArgs and outArgs
  • finally, FeedManifold::invoke() will trigger the stored processing functor, passing param, inArgs and outArgs as appropriate. The constexpr functions hasInput() and hasParam() can be used to find out if the functor was classified to take inputs and / or parameters.
    Note
    destructors of parameter values will be invoked, but nothing will be done for the BuffHandle elements; the caller is responsible to perform the buffer management protocol, i.e. invoke BuffHandle::emit() and BuffHandle::release()

Definition at line 443 of file feed-manifold.hpp.

Public Types

enum  {
  FAN_I = _S::FAN_I ,
  FAN_O = _S::FAN_O ,
  FAN_P = _S::FAN_P
}
 
using _T = _ProcFun< FUN >
 
using _S = _StorageSetup< FUN >
 
using _F = _S::Storage
 
using ArgI = _S::ArgI
 
using ArgO = _S::ArgO
 
using Param = _S::Param
 
using Prototype = FeedPrototype< FUN >
 cross-builder: Prototype can be used to attach parameter-provider-functors and then to create several further FeedManifold instances.
 
using TupI = _T::ElmsI::Tup
 
using TupO = _T::ElmsO::Tup
 

Static Public Member Functions

static constexpr bool hasInput ()
 
static constexpr bool hasParam ()
 

Public Member Functions

template<size_t i, class ARG >
auto & accessArg (ARG &arg)
 
void connect ()
 
void invoke ()
 
- Public Member Functions inherited from _StorageSetup< FUN >::Storage
template<typename F >
 Storage (F &&fun)
 
template<typename F , typename = enable_if_hasParam<F>>
 Storage (Param p, F &&fun)
 

Additional Inherited Members

- Public Attributes inherited from _StorageSetup< FUN >::Storage
FUN process
 
- Public Attributes inherited from _StorageSetup< FUN >::BufferSlot_Output
BuffO outBuff
 
ArgO outArgs {}
 
- Protected Member Functions inherited from NonCopyable
 ~NonCopyable ()=default
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Member Typedef Documentation

◆ _T

template<class FUN >
using _T = _ProcFun<FUN>

Definition at line 446 of file feed-manifold.hpp.

◆ _S

template<class FUN >
using _S = _StorageSetup<FUN>

Definition at line 447 of file feed-manifold.hpp.

◆ _F

template<class FUN >
using _F = _S::Storage

Definition at line 448 of file feed-manifold.hpp.

◆ ArgI

template<class FUN >
using ArgI = _S::ArgI

Definition at line 453 of file feed-manifold.hpp.

◆ ArgO

template<class FUN >
using ArgO = _S::ArgO

Definition at line 454 of file feed-manifold.hpp.

◆ Param

template<class FUN >
using Param = _S::Param

Definition at line 455 of file feed-manifold.hpp.

◆ Prototype

template<class FUN >
using Prototype = FeedPrototype<FUN>

cross-builder: Prototype can be used to attach parameter-provider-functors and then to create several further FeedManifold instances.

Definition at line 469 of file feed-manifold.hpp.

◆ TupI

template<class FUN >
using TupI = _T::ElmsI::Tup

Definition at line 483 of file feed-manifold.hpp.

◆ TupO

template<class FUN >
using TupO = _T::ElmsO::Tup

Definition at line 484 of file feed-manifold.hpp.

Member Enumeration Documentation

◆ anonymous enum

template<class FUN >
anonymous enum
Enumerator
FAN_I 
FAN_O 
FAN_P 

Definition at line 456 of file feed-manifold.hpp.

Member Function Documentation

◆ hasInput()

template<class FUN >
static constexpr bool hasInput ( )
inlinestaticconstexpr

Definition at line 461 of file feed-manifold.hpp.

References _StorageSetup< FUN >::hasInput().

Referenced by FeedManifold< FUN >::connect(), and FeedManifold< FUN >::invoke().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasParam()

template<class FUN >
static constexpr bool hasParam ( )
inlinestaticconstexpr

Definition at line 462 of file feed-manifold.hpp.

References _StorageSetup< FUN >::hasParam().

Referenced by FeedManifold< FUN >::invoke().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accessArg()

template<class FUN >
template<size_t i, class ARG >
auto & accessArg ( ARG &  arg)
inline

Definition at line 475 of file feed-manifold.hpp.

◆ connect()

template<class FUN >
void connect ( )
inline

Definition at line 488 of file feed-manifold.hpp.

References FeedManifold< FUN >::hasInput(), _StorageSetup< FUN >::BufferSlot_Output::outArgs, and _StorageSetup< FUN >::BufferSlot_Output::outBuff.

+ Here is the call graph for this function:

◆ invoke()

template<class FUN >
void invoke ( )
inline

Definition at line 509 of file feed-manifold.hpp.

References FeedManifold< FUN >::hasInput(), FeedManifold< FUN >::hasParam(), _StorageSetup< FUN >::BufferSlot_Output::outArgs, and _StorageSetup< FUN >::Storage::process.

+ Here is the call graph for this function:
+ Inheritance diagram for FeedManifold< FUN >:
+ Collaboration diagram for FeedManifold< FUN >:

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