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

Select process template. More...

#include <network.h>

Public Types

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

Public Member Functions

 Select (Network &network)
 Constructs a Select process. More...
 
 Select (Network &network, embb::mtapi::ExecutionPolicy const &policy)
 Constructs a Select process. 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<typename Type>
class embb::dataflow::Network::Select< Type >

Select process template.

A select has 3 inputs and 1 output. Input port 0 is of type boolean and selects which of input port 1 or 2 (of type Type) is sent to output port 0 (of type Type). If input port 0 is set to true the value of input port 1 is selected, otherwise the value of input port 2 is taken. Tokens are processed as soon as all inputs for that token are complete.

See also
Switch
Template Parameters
TypeThe type of input port 1 and 2 and output port 0.

Member Typedef Documentation

template<typename Type >
typedef embb::base::Function<void, bool, Type, Type, Type &> embb::dataflow::Network::Select< Type >::FunctionType

Function type to use when processing tokens.

template<typename Type >
typedef Inputs<bool, Type, Type> embb::dataflow::Network::Select< Type >::InputsType

Input port type list.

template<typename Type >
typedef Outputs<Type> embb::dataflow::Network::Select< Type >::OutputsType

Output port type list.

Constructor & Destructor Documentation

template<typename Type >
embb::dataflow::Network::Select< Type >::Select ( Network network)
explicit

Constructs a Select process.

Parameters
networkThe network this node is going to be part of.
template<typename Type >
embb::dataflow::Network::Select< Type >::Select ( Network network,
embb::mtapi::ExecutionPolicy const &  policy 
)

Constructs a Select process.

Parameters
networkThe network this node is going to be part of.
policyThe execution policy of the process.

Member Function Documentation

template<typename Type >
virtual bool embb::dataflow::Network::Select< Type >::HasInputs ( ) const
virtual
Returns
Always true.
template<typename Type >
InputsType& embb::dataflow::Network::Select< Type >::GetInputs ( )
Returns
Reference to a list of all input ports.
template<typename Type >
template<int Index>
InputsType::Types<Index>::Result& embb::dataflow::Network::Select< Type >::GetInput ( )
Returns
Input port at Index.
template<typename Type >
virtual bool embb::dataflow::Network::Select< Type >::HasOutputs ( ) const
virtual
Returns
Always true.
template<typename Type >
OutputsType& embb::dataflow::Network::Select< Type >::GetOutputs ( )
Returns
Reference to a list of all output ports.
template<typename Type >
template<int Index>
OutputsType::Types<Index>::Result& embb::dataflow::Network::Select< Type >::GetOutput ( )
Returns
Output port at Index.
template<typename Type >
template<typename T >
void embb::dataflow::Network::Select< Type >::operator>> ( T &  target)

Connects output port 0 to input port 0 of target.

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