Embedded Multicore Building Blocks V1.0.0
Public Types | Public Member Functions | List of all members
embb::dataflow::Network::Sink< I1, I2, I3, I4, I5 > Class Template Reference

Sink process template. More...

#include <network.h>

Public Types

typedef embb::base::Function< void, INPUT_TYPE_LIST > FunctionType
 Function type to use when processing tokens. More...
 
typedef Inputs< INPUT_TYPE_LIST > InputsType
 Input port type list. More...
 

Public Member Functions

 Sink (Network &network, FunctionType function)
 Constructs a Sink with a user specified processing function. More...
 
 Sink (Network &network, embb::mtapi::Job job)
 Constructs a Sink with a user specified embb::mtapi::Job. More...
 
 Sink (Network &network, FunctionType function, embb::mtapi::ExecutionPolicy const &policy)
 Constructs a Sink with a user specified processing function. More...
 
 Sink (Network &network, embb::mtapi::Job job, embb::mtapi::ExecutionPolicy const &policy)
 Constructs a Sink with a user specified embb::mtapi::Job. More...
 
virtual bool HasInputs () const
 
InputsTypeGetInputs ()
 
template<int Index>
InputsType::Types< Index >::Result & GetInput ()
 
virtual bool HasOutputs () const
 

Detailed Description

template<typename I1, typename I2 = embb::base::internal::Nil, typename I3 = embb::base::internal::Nil, typename I4 = embb::base::internal::Nil, typename I5 = embb::base::internal::Nil>
class embb::dataflow::Network::Sink< I1, I2, I3, I4, I5 >

Sink process template.

A sink marks the end of a particular processing chain. It can have one to five input ports and no output ports. Tokens are processed in order by the sink, regardless in which order they arrive at the input ports.

See also
Source, SerialProcess, ParallelProcess
Template Parameters
I1Type of first input port.
I2Optional type of second input port.
I3Optional type of third input port.
I4Optional type of fourth input port.
I5Optional type of fifth input port.

Member Typedef Documentation

template<typename I1 , typename I2 = embb::base::internal::Nil, typename I3 = embb::base::internal::Nil, typename I4 = embb::base::internal::Nil, typename I5 = embb::base::internal::Nil>
typedef embb::base::Function<void, INPUT_TYPE_LIST> embb::dataflow::Network::Sink< I1, I2, I3, I4, I5 >::FunctionType

Function type to use when processing tokens.

template<typename I1 , typename I2 = embb::base::internal::Nil, typename I3 = embb::base::internal::Nil, typename I4 = embb::base::internal::Nil, typename I5 = embb::base::internal::Nil>
typedef Inputs<INPUT_TYPE_LIST> embb::dataflow::Network::Sink< I1, I2, I3, I4, I5 >::InputsType

Input port type list.

Constructor & Destructor Documentation

template<typename I1 , typename I2 = embb::base::internal::Nil, typename I3 = embb::base::internal::Nil, typename I4 = embb::base::internal::Nil, typename I5 = embb::base::internal::Nil>
embb::dataflow::Network::Sink< I1, I2, I3, I4, I5 >::Sink ( Network network,
FunctionType  function 
)

Constructs a Sink with a user specified processing function.

Parameters
networkThe network this node is going to be part of.
functionThe Function to call to process a token.
template<typename I1 , typename I2 = embb::base::internal::Nil, typename I3 = embb::base::internal::Nil, typename I4 = embb::base::internal::Nil, typename I5 = embb::base::internal::Nil>
embb::dataflow::Network::Sink< I1, I2, I3, I4, I5 >::Sink ( Network network,
embb::mtapi::Job  job 
)

Constructs a Sink with a user specified embb::mtapi::Job.

The Job must be associated with an action function accepting a struct containing copies of the inputs as its argument buffer and a null pointer as its result buffer.

Parameters
networkThe network this node is going to be part of.
jobThe embb::mtapi::Job to process a token.
template<typename I1 , typename I2 = embb::base::internal::Nil, typename I3 = embb::base::internal::Nil, typename I4 = embb::base::internal::Nil, typename I5 = embb::base::internal::Nil>
embb::dataflow::Network::Sink< I1, I2, I3, I4, I5 >::Sink ( Network network,
FunctionType  function,
embb::mtapi::ExecutionPolicy const &  policy 
)

Constructs a Sink with a user specified processing function.

Parameters
networkThe network this node is going to be part of.
functionThe Function to call to process a token.
policyThe execution policy of the process.
template<typename I1 , typename I2 = embb::base::internal::Nil, typename I3 = embb::base::internal::Nil, typename I4 = embb::base::internal::Nil, typename I5 = embb::base::internal::Nil>
embb::dataflow::Network::Sink< I1, I2, I3, I4, I5 >::Sink ( Network network,
embb::mtapi::Job  job,
embb::mtapi::ExecutionPolicy const &  policy 
)

Constructs a Sink with a user specified embb::mtapi::Job.

The Job must be associated with an action function accepting a struct containing copies of the inputs as its argument buffer and a null pointer as its result buffer.

Parameters
networkThe network this node is going to be part of.
jobThe embb::mtapi::Job to process a token.
policyThe execution policy of the process.

Member Function Documentation

template<typename I1 , typename I2 = embb::base::internal::Nil, typename I3 = embb::base::internal::Nil, typename I4 = embb::base::internal::Nil, typename I5 = embb::base::internal::Nil>
virtual bool embb::dataflow::Network::Sink< I1, I2, I3, I4, I5 >::HasInputs ( ) const
virtual
Returns
Always true.
template<typename I1 , typename I2 = embb::base::internal::Nil, typename I3 = embb::base::internal::Nil, typename I4 = embb::base::internal::Nil, typename I5 = embb::base::internal::Nil>
InputsType& embb::dataflow::Network::Sink< I1, I2, I3, I4, I5 >::GetInputs ( )
Returns
Reference to a list of all input ports.
template<typename I1 , typename I2 = embb::base::internal::Nil, typename I3 = embb::base::internal::Nil, typename I4 = embb::base::internal::Nil, typename I5 = embb::base::internal::Nil>
template<int Index>
InputsType::Types<Index>::Result& embb::dataflow::Network::Sink< I1, I2, I3, I4, I5 >::GetInput ( )
Returns
Input port at Index.
template<typename I1 , typename I2 = embb::base::internal::Nil, typename I3 = embb::base::internal::Nil, typename I4 = embb::base::internal::Nil, typename I5 = embb::base::internal::Nil>
virtual bool embb::dataflow::Network::Sink< I1, I2, I3, I4, I5 >::HasOutputs ( ) const
virtual
Returns
Always false.