Embedded Multicore Building Blocks V1.0.0
Classes | Public Member Functions | List of all members
embb::dataflow::Network Class Reference

Represents a set of processes that are connected by communication channels. More...

#include <network.h>

Classes

class  ConstantSource
 Constant source process template. More...
 
class  In
 Input port class. More...
 
struct  Inputs
 Provides the input port types for a process. More...
 
class  Out
 Output port class. More...
 
struct  Outputs
 Provides the output port types for a process. More...
 
class  ParallelProcess
 Generic parallel process template. More...
 
class  Select
 Select process template. More...
 
class  SerialProcess
 Generic serial process template. More...
 
class  Sink
 Sink process template. More...
 
class  Source
 Source process template. More...
 
class  Switch
 Switch process template. More...
 

Public Member Functions

 Network ()
 Constructs an empty network. More...
 
 Network (int slices)
 Constructs an empty network. More...
 
 Network (embb::mtapi::ExecutionPolicy const &policy)
 Constructs an empty network. More...
 
 Network (int slices, embb::mtapi::ExecutionPolicy const &policy)
 Constructs an empty network. More...
 
bool IsValid ()
 Checks whether the network is completely connected and free of cycles. More...
 
void operator() ()
 Executes the network until one of the the sources returns false. More...
 

Detailed Description

Represents a set of processes that are connected by communication channels.

Constructor & Destructor Documentation

embb::dataflow::Network::Network ( )

Constructs an empty network.

Note
The number of concurrent tokens will automatically be derived from the structure of the network on the first call to operator(), and the corresponding resources will be allocated then.
When using parallel algorithms inside a dataflow network, the task limit may be exceeded. In that case, increase the task limit of the MTAPI node.
embb::dataflow::Network::Network ( int  slices)
explicit

Constructs an empty network.

Parameters
slicesNumber of concurrent tokens allowed in the network.
Note
The number of slices might be reduced internally if the task limit of the underlying MTAPI node would be exceeded.
When using parallel algorithms inside a dataflow network, the task limit may be exceeded. In that case, increase the task limit of the MTAPI node.
embb::dataflow::Network::Network ( embb::mtapi::ExecutionPolicy const &  policy)
explicit

Constructs an empty network.

Parameters
policyDefault execution policy of the processes in the network.
Note
The number of concurrent tokens will automatically be derived from the structure of the network on the first call to operator(), and the corresponding resources will be allocated then.
When using parallel algorithms inside a dataflow network, the task limit may be exceeded. In that case, increase the task limit of the MTAPI node.
embb::dataflow::Network::Network ( int  slices,
embb::mtapi::ExecutionPolicy const &  policy 
)

Constructs an empty network.

Parameters
slicesNumber of concurrent tokens allowed in the network.
policyDefault execution policy of the processes in the network.
Note
The number of slices might be reduced internally if the task limit of the underlying MTAPI node would be exceeded.
When using parallel algorithms inside a dataflow network, the task limit may be exceeded. In that case, increase the task limit of the MTAPI node.

Member Function Documentation

bool embb::dataflow::Network::IsValid ( )

Checks whether the network is completely connected and free of cycles.

Returns
true if everything is in order, false if not.
Note
Executing an invalid network results in an exception. For this reason, it is recommended to first check the network using IsValid().
void embb::dataflow::Network::operator() ( )

Executes the network until one of the the sources returns false.

Note
If the network was default constructed, the number of concurrent tokens will automatically be derived from the structure of the network on the first call of the operator, and the corresponding resources will be allocated then.
Note
Executing an invalid network results in an exception. For this reason, it is recommended to first check the network using IsValid().