CCA
cca::Collector< DTOTYPE > Class Template Reference

DTO Collector. More...

#include <Collector.h>

Inheritance diagram for cca::Collector< DTOTYPE >:
Collaboration diagram for cca::Collector< DTOTYPE >:

List of all members.

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

template<class DTOTYPE>
cca::Collector< DTOTYPE >::Collector ( std::string  nodename,
unsigned int  number 
) [inline]

Constructor of a collector component.

Parameters:
nodenameName of the component.
numberNumber 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().

Here is the call graph for this function:

template<class DTOTYPE>
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:
nodenameName of this splitter node
configConfiguration 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().

Here is the call graph for this function:

template<class DTOTYPE>
cca::Collector< DTOTYPE >::~Collector ( ) [inline]

Definition at line 117 of file Collector.h.


Member Function Documentation

template<class DTOTYPE>
virtual void cca::Collector< DTOTYPE >::configureInputPortByIndex ( unsigned int  index,
PortConfigurationPtr  portcfg 
) [inline, virtual]

Configure input port by number.

Parameters:
indexNumber of the input port to configure
portcfgPortConfiguration, 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().

Here is the call graph for this function:

template<class DTOTYPE>
virtual void cca::Collector< DTOTYPE >::configureInputPortByIndex ( unsigned int  index,
const std::string &  scope 
) [inline, virtual]

Configure input port by number.

Parameters:
indexNumber of the input port to configure
scopeConnecting scope

Definition at line 263 of file Collector.h.

References cca::Node::configureInputPort().

Here is the call graph for this function:

template<class DTOTYPE>
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.

template<class DTOTYPE>
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:
nodenameName of this splitter node
configConfiguration of splitting.

Definition at line 168 of file Collector.h.

template<class DTOTYPE>
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:
nodenameName of this splitter node
firstSize of first split
secondSize of second split

Definition at line 185 of file Collector.h.

template<class DTOTYPE>
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:
nodenameName of this splitter node
firstSize of first split
secondSize of second split
thirdSize of third split

Definition at line 206 of file Collector.h.

template<class DTOTYPE>
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.

template<class DTOTYPE>
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().

Here is the call graph for this function:


Friends And Related Function Documentation

template<class DTOTYPE>
std::ostream& operator<< ( std::ostream &  os,
const Collector< DTOTYPE > &  node 
) [friend]

Stream operator.

Parameters:
os
node
Returns:

Definition at line 230 of file Collector.h.


Member Data Documentation

template<class DTOTYPE>
nemo::IntVector cca::Collector< DTOTYPE >::collectConfig [private]
template<class DTOTYPE>
unsigned int cca::Collector< DTOTYPE >::dim [private]
template<class DTOTYPE>
std::vector<typename InputPort<DTOTYPE>::Ptr> cca::Collector< DTOTYPE >::ips [private]
template<class DTOTYPE>
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().

template<class DTOTYPE>
OutputPort<DTOTYPE>::Ptr cca::Collector< DTOTYPE >::op [private]

The documentation for this class was generated from the following file: