Embedded Multicore Building Blocks V1.0.0
Public Types | Public Member Functions | List of all members
embb::dataflow::Network::Source< O1, O2, O3, O4, O5 > Class Template Reference

Source process template. More...

#include <network.h>

Public Types

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

Public Member Functions

 Source (Network &network, FunctionType function)
 Constructs a Source with a user specified processing function. More...
 
 Source (Network &network, embb::mtapi::Job job)
 Constructs a Source with a user specified embb::mtapi::Job. More...
 
 Source (Network &network, FunctionType function, embb::mtapi::ExecutionPolicy const &policy)
 Constructs a Source with a user specified processing function. More...
 
 Source (Network &network, embb::mtapi::Job job, embb::mtapi::ExecutionPolicy const &policy)
 Constructs a Source with a user specified embb::mtapi::Job. More...
 
virtual bool HasInputs () const
 
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<typename O1, typename O2 = embb::base::internal::Nil, typename O3 = embb::base::internal::Nil, typename O4 = embb::base::internal::Nil, typename O5 = embb::base::internal::Nil>
class embb::dataflow::Network::Source< O1, O2, O3, O4, O5 >

Source process template.

A source marks the start of a processing chain. It can have one to five output ports and no input ports. Tokens are emitted in order by the source.

See also
SerialProcess, ParallelProcess, Sink
Template Parameters
O1Type of first output port.
O2Optional type of second output port.
O3Optional type of third output port.
O4Optional type of fourth output port.
O5Optional type of fifth output port.

Member Typedef Documentation

template<typename O1 , typename O2 = embb::base::internal::Nil, typename O3 = embb::base::internal::Nil, typename O4 = embb::base::internal::Nil, typename O5 = embb::base::internal::Nil>
typedef embb::base::Function<void, OUTPUT_TYPE_LIST> embb::dataflow::Network::Source< O1, O2, O3, O4, O5 >::FunctionType

Function type to use when processing tokens.

template<typename O1 , typename O2 = embb::base::internal::Nil, typename O3 = embb::base::internal::Nil, typename O4 = embb::base::internal::Nil, typename O5 = embb::base::internal::Nil>
typedef Outputs<OUTPUT_TYPE_LIST> embb::dataflow::Network::Source< O1, O2, O3, O4, O5 >::OutputsType

Output port type list.

Constructor & Destructor Documentation

template<typename O1 , typename O2 = embb::base::internal::Nil, typename O3 = embb::base::internal::Nil, typename O4 = embb::base::internal::Nil, typename O5 = embb::base::internal::Nil>
embb::dataflow::Network::Source< O1, O2, O3, O4, O5 >::Source ( Network network,
FunctionType  function 
)

Constructs a Source with a user specified processing function.

Parameters
networkThe network this node is going to be part of.
functionThe Function to call to emit a token.
template<typename O1 , typename O2 = embb::base::internal::Nil, typename O3 = embb::base::internal::Nil, typename O4 = embb::base::internal::Nil, typename O5 = embb::base::internal::Nil>
embb::dataflow::Network::Source< O1, O2, O3, O4, O5 >::Source ( Network network,
embb::mtapi::Job  job 
)

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

The Job must be associated with an action function accepting a null pointer 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<typename O1 , typename O2 = embb::base::internal::Nil, typename O3 = embb::base::internal::Nil, typename O4 = embb::base::internal::Nil, typename O5 = embb::base::internal::Nil>
embb::dataflow::Network::Source< O1, O2, O3, O4, O5 >::Source ( Network network,
FunctionType  function,
embb::mtapi::ExecutionPolicy const &  policy 
)

Constructs a Source with a user specified processing function.

Parameters
networkThe network this node is going to be part of.
functionThe Function to call to emit a token.
policyThe execution policy of the process.
template<typename O1 , typename O2 = embb::base::internal::Nil, typename O3 = embb::base::internal::Nil, typename O4 = embb::base::internal::Nil, typename O5 = embb::base::internal::Nil>
embb::dataflow::Network::Source< O1, O2, O3, O4, O5 >::Source ( Network network,
embb::mtapi::Job  job,
embb::mtapi::ExecutionPolicy const &  policy 
)

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

The Job must be associated with an action function accepting a null pointer 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<typename O1 , typename O2 = embb::base::internal::Nil, typename O3 = embb::base::internal::Nil, typename O4 = embb::base::internal::Nil, typename O5 = embb::base::internal::Nil>
virtual bool embb::dataflow::Network::Source< O1, O2, O3, O4, O5 >::HasInputs ( ) const
virtual
Returns
Always false.
template<typename O1 , typename O2 = embb::base::internal::Nil, typename O3 = embb::base::internal::Nil, typename O4 = embb::base::internal::Nil, typename O5 = embb::base::internal::Nil>
virtual bool embb::dataflow::Network::Source< O1, O2, O3, O4, O5 >::HasOutputs ( ) const
virtual
Returns
Always true.
template<typename O1 , typename O2 = embb::base::internal::Nil, typename O3 = embb::base::internal::Nil, typename O4 = embb::base::internal::Nil, typename O5 = embb::base::internal::Nil>
OutputsType& embb::dataflow::Network::Source< O1, O2, O3, O4, O5 >::GetOutputs ( )
Returns
Reference to a list of all output ports.
template<typename O1 , typename O2 = embb::base::internal::Nil, typename O3 = embb::base::internal::Nil, typename O4 = embb::base::internal::Nil, typename O5 = embb::base::internal::Nil>
template<int Index>
OutputsType::Types<Index>::Result& embb::dataflow::Network::Source< O1, O2, O3, O4, O5 >::GetOutput ( )
Returns
Output port at INDEX.
template<typename O1 , typename O2 = embb::base::internal::Nil, typename O3 = embb::base::internal::Nil, typename O4 = embb::base::internal::Nil, typename O5 = embb::base::internal::Nil>
template<typename T >
void embb::dataflow::Network::Source< O1, O2, O3, O4, O5 >::operator>> ( T &  target)

Connects output port 0 to input port 0 of target.

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