CCA
|
#include <Collector.h>
Public Member Functions | |
Collector (std::string nodename, unsigned int number) | |
Constructor of a collector component. | |
Collector (std::string nodename, nemo::IntVector config) | |
Creates a collector with specific collecting configuration. | |
~Collector () | |
void | onProcess () |
Processing. | |
virtual void | configureInputPortByIndex (unsigned int index, PortConfigurationPtr portcfg) |
Configure input port by number. | |
virtual void | configureInputPortByIndex (unsigned int index, const std::string &scope) |
Configure input port by number. | |
Static Public Member Functions | |
static NodePtr | create (std::string nodename, unsigned int number) |
Constructing a splitter for the given data-type and a given number of outputs. | |
static NodePtr | create (std::string nodename, nemo::IntVector config) |
Creates a collector shared pointer with specific collecting configuration. | |
static NodePtr | create (std::string nodename, int first, int second) |
Creates a collector shared pointer with specific collecting configuration. | |
static NodePtr | create (std::string nodename, int first, int second, int third) |
Creates a collector shared pointer with specific collecting configuration. | |
static NodePtr | create (unsigned int number) |
Constructing a splitter for the given data-type and a given number of outputs. | |
Private Attributes | |
unsigned int | dim |
nemo::IntVector | collectConfig |
std::vector< typename InputPort< DTOTYPE >::Ptr > | ips |
OutputPort< DTOTYPE >::Ptr | op |
rsc::logging::LoggerPtr | logger |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Collector< DTOTYPE > &node) |
Stream operator. |
Detailed Description
template<class DTOTYPE>
class cca::Collector< DTOTYPE >
DTO Collector.
Collects one-dimensional DTOs of same type from all the input ports and sending them over the output port. Works for any DataTransferObject and any dimensionalities. Recommended processing strategy is ModerateProcessing, so that processing is only triggered, if there are new inputs on every input port. Input ports should be configured to always keep the latest item.
- Todo:
- Test if template type is a DataTransferObject
Definition at line 54 of file Collector.h.
Constructor & Destructor Documentation
cca::Collector< DTOTYPE >::Collector | ( | std::string | nodename, |
unsigned int | number | ||
) | [inline] |
Constructor of a collector component.
- Parameters:
-
nodename Name of the component. number Number of input potrs to listen to
Definition at line 65 of file Collector.h.
References cca::Node::create(), cca::Collector< DTOTYPE >::dim, cca::Collector< DTOTYPE >::ips, cca::Collector< DTOTYPE >::op, cca::Node::registerPort(), cca::Node::setProcessingStrategy(), and cca::Moderate::timeout().
cca::Collector< DTOTYPE >::Collector | ( | std::string | nodename, |
nemo::IntVector | config | ||
) | [inline] |
Creates a collector with specific collecting configuration.
An integer vector specifies the dimensions of the incoming DTOs. E.g. {1, 2} to merge an incoming 1-dimensional and 2-dimensional DTO into a 3-dimensional DTO.
- Parameters:
-
nodename Name of this splitter node config Configuration of splitting.
Definition at line 95 of file Collector.h.
References cca::Collector< DTOTYPE >::collectConfig, cca::Node::create(), cca::Collector< DTOTYPE >::dim, cca::Collector< DTOTYPE >::ips, cca::Collector< DTOTYPE >::op, cca::Node::registerPort(), cca::Node::setProcessingStrategy(), and cca::Moderate::timeout().
cca::Collector< DTOTYPE >::~Collector | ( | ) | [inline] |
Definition at line 117 of file Collector.h.
Member Function Documentation
virtual void cca::Collector< DTOTYPE >::configureInputPortByIndex | ( | unsigned int | index, |
PortConfigurationPtr | portcfg | ||
) | [inline, virtual] |
Configure input port by number.
- Parameters:
-
index Number of the input port to configure portcfg PortConfiguration, either PortConfiguration::LOCAL() or PortConfiguration::REMOTE() with given Scope, default is the local port.
Definition at line 248 of file Collector.h.
References cca::Node::configureInputPort().
virtual void cca::Collector< DTOTYPE >::configureInputPortByIndex | ( | unsigned int | index, |
const std::string & | scope | ||
) | [inline, virtual] |
Configure input port by number.
- Parameters:
-
index Number of the input port to configure scope Connecting scope
Definition at line 263 of file Collector.h.
References cca::Node::configureInputPort().
static NodePtr cca::Collector< DTOTYPE >::create | ( | std::string | nodename, |
unsigned int | number | ||
) | [inline, static] |
Constructing a splitter for the given data-type and a given number of outputs.
- Parameters:
-
nodename number
- Returns:
Definition at line 154 of file Collector.h.
static NodePtr cca::Collector< DTOTYPE >::create | ( | std::string | nodename, |
nemo::IntVector | config | ||
) | [inline, static] |
Creates a collector shared pointer with specific collecting configuration.
An integer vector specifies dimensions of the incoming DTOs. E.g. {1, 2} to merge an incoming 1-dimensional and 2-dimensional DTO into a 3-dimensional DTO.
- Parameters:
-
nodename Name of this splitter node config Configuration of splitting.
Definition at line 168 of file Collector.h.
static NodePtr cca::Collector< DTOTYPE >::create | ( | std::string | nodename, |
int | first, | ||
int | second | ||
) | [inline, static] |
Creates a collector shared pointer with specific collecting configuration.
Two integer arguments specify dimensions of the incoming dto. E.g. first=1, second=2 to merge an incoming 1-dimensional and 2-dimensional DTO in a 3-dimensional DTO.
- Parameters:
-
nodename Name of this splitter node first Size of first split second Size of second split
Definition at line 185 of file Collector.h.
static NodePtr cca::Collector< DTOTYPE >::create | ( | std::string | nodename, |
int | first, | ||
int | second, | ||
int | third | ||
) | [inline, static] |
Creates a collector shared pointer with specific collecting configuration.
Three integer arguments specify dimensions of the incoming dto. E.g. first=1, second=2, third=1 to merge an incoming 1-dimensional, 2-dimensional and another 1-dimensional DTO in a 4-dimensional DTO.
- Parameters:
-
nodename Name of this splitter node first Size of first split second Size of second split third Size of third split
Definition at line 206 of file Collector.h.
static NodePtr cca::Collector< DTOTYPE >::create | ( | unsigned int | number | ) | [inline, static] |
Constructing a splitter for the given data-type and a given number of outputs.
- Parameters:
-
number
- Returns:
Definition at line 220 of file Collector.h.
void cca::Collector< DTOTYPE >::onProcess | ( | ) | [inline, virtual] |
Processing.
Takes the incoming data item, splits it up into one-dimensionsal items and sends them over the output port.
Implements cca::Node.
Definition at line 124 of file Collector.h.
References cca::Collector< DTOTYPE >::collectConfig, cca::Node::create(), cca::Collector< DTOTYPE >::dim, cca::Node::getName(), cca::Collector< DTOTYPE >::ips, cca::Collector< DTOTYPE >::logger, cca::Collector< DTOTYPE >::op, and cca::OutputPort< DATATYPE >::publish().
Friends And Related Function Documentation
std::ostream& operator<< | ( | std::ostream & | os, |
const Collector< DTOTYPE > & | node | ||
) | [friend] |
Member Data Documentation
nemo::IntVector cca::Collector< DTOTYPE >::collectConfig [private] |
Definition at line 272 of file Collector.h.
Referenced by cca::Collector< DTOTYPE >::Collector(), and cca::Collector< DTOTYPE >::onProcess().
unsigned int cca::Collector< DTOTYPE >::dim [private] |
Definition at line 271 of file Collector.h.
Referenced by cca::Collector< DTOTYPE >::Collector(), and cca::Collector< DTOTYPE >::onProcess().
std::vector<typename InputPort<DTOTYPE>::Ptr> cca::Collector< DTOTYPE >::ips [private] |
Definition at line 273 of file Collector.h.
Referenced by cca::Collector< DTOTYPE >::Collector(), and cca::Collector< DTOTYPE >::onProcess().
rsc::logging::LoggerPtr cca::Collector< DTOTYPE >::logger [private] |
Reimplemented from cca::Node.
Definition at line 275 of file Collector.h.
Referenced by cca::Collector< DTOTYPE >::onProcess().
OutputPort<DTOTYPE>::Ptr cca::Collector< DTOTYPE >::op [private] |
Definition at line 274 of file Collector.h.
Referenced by cca::Collector< DTOTYPE >::Collector(), and cca::Collector< DTOTYPE >::onProcess().
The documentation for this class was generated from the following file:
- cca/nodes/Collector.h