Embedded Multicore Building Blocks V1.0.0
Public Types | Public Member Functions | List of all members
embb::dataflow::Network::SerialProcess< Inputs, Outputs > Class Template Reference

Generic serial process template. More...

#include <network.h>

Public Types

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

Public Member Functions

 SerialProcess (Network &network, FunctionType function)
 Constructs a SerialProcess with a user specified processing function. More...
 
 SerialProcess (Network &network, embb::mtapi::Job job)
 Constructs a SerialProcess with a user specified embb::mtapi::Job. More...
 
 SerialProcess (Network &network, FunctionType function, embb::mtapi::ExecutionPolicy const &policy)
 Constructs a SerialProcess with a user specified processing function. More...
 
 SerialProcess (Network &network, embb::mtapi::Job job, embb::mtapi::ExecutionPolicy const &policy)
 Constructs a SerialProcess 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
 
OutputsTypeGetOutputs ()
 
template<int Index>
OutputsType::Types< Index >::Result & GetOutput ()
 
template<typename T >
void operator>> (T &target)
 Connects output port 0 to input port 0 of target. More...
 

Detailed Description

template<class Inputs, class Outputs>
class embb::dataflow::Network::SerialProcess< Inputs, Outputs >

Generic serial process template.

Implements a generic serial process in the network that may have one to four input ports and one to four output ports but no more that five total ports. Tokens are processed in order.

See also
Source, ParallelProcess, Sink, Switch, Select
Template Parameters
InputsInputs of the process.
OutputsOutputs of the process.

Member Typedef Documentation

template<class Inputs , class Outputs >
typedef embb::base::Function<void, INPUT_TYPE_LIST, OUTPUT_TYPE_LIST> embb::dataflow::Network::SerialProcess< Inputs, Outputs >::FunctionType

Function type to use when processing tokens.

template<class Inputs , class Outputs >
typedef Inputs<INPUT_TYPE_LIST> embb::dataflow::Network::SerialProcess< Inputs, Outputs >::InputsType

Input port type list.

template<class Inputs , class Outputs >
typedef Outputs<OUTPUT_TYPE_LIST> embb::dataflow::Network::SerialProcess< Inputs, Outputs >::OutputsType

Output port type list.

Constructor & Destructor Documentation

template<class Inputs , class Outputs >
embb::dataflow::Network::SerialProcess< Inputs, Outputs >::SerialProcess ( Network network,
FunctionType  function 
)

Constructs a SerialProcess 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<class Inputs , class Outputs >
embb::dataflow::Network::SerialProcess< Inputs, Outputs >::SerialProcess ( Network network,
embb::mtapi::Job  job 
)

Constructs a SerialProcess 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 struct containing the outputs as its result buffer.

Parameters
networkThe network this node is going to be part of.
jobThe embb::mtapi::Job to process a token.
template<class Inputs , class Outputs >
embb::dataflow::Network::SerialProcess< Inputs, Outputs >::SerialProcess ( Network network,
FunctionType  function,
embb::mtapi::ExecutionPolicy const &  policy 
)

Constructs a SerialProcess 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<class Inputs , class Outputs >
embb::dataflow::Network::SerialProcess< Inputs, Outputs >::SerialProcess ( Network network,
embb::mtapi::Job  job,
embb::mtapi::ExecutionPolicy const &  policy 
)

Constructs a SerialProcess 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 struct containing the outputs 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<class Inputs , class Outputs >
virtual bool embb::dataflow::Network::SerialProcess< Inputs, Outputs >::HasInputs ( ) const
virtual
Returns
true if the SerialProcess has any inputs, false otherwise.
template<class Inputs , class Outputs >
InputsType& embb::dataflow::Network::SerialProcess< Inputs, Outputs >::GetInputs ( )
Returns
Reference to a list of all input ports.
template<class Inputs , class Outputs >
template<int Index>
InputsType::Types<Index>::Result& embb::dataflow::Network::SerialProcess< Inputs, Outputs >::GetInput ( )
Returns
Input port at Index.
template<class Inputs , class Outputs >
virtual bool embb::dataflow::Network::SerialProcess< Inputs, Outputs >::HasOutputs ( ) const
virtual
Returns
true if the SerialProcess has any outputs, false otherwise.
template<class Inputs , class Outputs >
OutputsType& embb::dataflow::Network::SerialProcess< Inputs, Outputs >::GetOutputs ( )
Returns
Reference to a list of all output ports.
template<class Inputs , class Outputs >
template<int Index>
OutputsType::Types<Index>::Result& embb::dataflow::Network::SerialProcess< Inputs, Outputs >::GetOutput ( )
Returns
Output port at Index.
template<class Inputs , class Outputs >
template<typename T >
void embb::dataflow::Network::SerialProcess< Inputs, Outputs >::operator>> ( T &  target)

Connects output port 0 to input port 0 of target.

Parameters
targetProcess to connect to.
Template Parameters
TType of target process.