CCA
cca::Splitter< DTOTYPE > Class Template Reference

DTO Splitter. More...

#include <Splitter.h>

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

List of all members.

Public Member Functions

 Splitter (std::string nodename, unsigned int dimensionality)
 Splitter (std::string nodename, nemo::IntVector config)
 Creates a splitter with specific splitting configuration.
 ~Splitter ()
void onProcess ()
 Processing.
virtual void configureOutputPortByIndex (unsigned int index, PortConfigurationPtr portcfg)
 Configure output port by number.
virtual void configureOutputPortByIndex (unsigned int index, const std::string &scope)
 Configure output 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 splitter shared pointer with specific splitting configuration.
static NodePtr create (std::string nodename, int first, int second)
 Creates a splitter shared pointer with specific splitting configuration.
static NodePtr create (std::string nodename, int first, int second, int third)
 Creates a splitter shared pointer with specific splitting 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 splitConfig
InputPort< DTOTYPE >::Ptr ip
std::vector< typename
OutputPort< DTOTYPE >::Ptr > 
ops

Friends

std::ostream & operator<< (std::ostream &os, const Splitter< DTOTYPE > &node)
 Stream operator.

Detailed Description

template<class DTOTYPE>
class cca::Splitter< DTOTYPE >

DTO Splitter.

Splitting up multi-dimensional DTOs and sending one-dimensional items of same type over the output ports. Works for any DataTransferObject and any dimension.

Definition at line 45 of file Splitter.h.


Constructor & Destructor Documentation

template<class DTOTYPE>
cca::Splitter< DTOTYPE >::Splitter ( std::string  nodename,
unsigned int  dimensionality 
) [inline]
Parameters:
nodenameName of this splitter node
dimensionalityDimensionality (corresponds to dimensionality of incoming DTO, as well as to the number of output ports)

Definition at line 56 of file Splitter.h.

References cca::Node::create(), cca::Splitter< DTOTYPE >::dim, cca::Splitter< DTOTYPE >::ip, cca::Splitter< DTOTYPE >::ops, cca::PortTriggered::port(), cca::Node::registerPort(), and cca::Node::setProcessingStrategy().

Here is the call graph for this function:

template<class DTOTYPE>
cca::Splitter< DTOTYPE >::Splitter ( std::string  nodename,
nemo::IntVector  config 
) [inline]

Creates a splitter with specific splitting configuration.

An integer vector specifies, how to split up the incoming dto. E.g. {1, 2} to split an incoming 3-dimensional DTO into an 1-dimensional and 2-dimensional DTO.

Parameters:
nodenameName of this splitter node
configConfiguration of splitting.

Definition at line 85 of file Splitter.h.

References cca::Node::create(), cca::Splitter< DTOTYPE >::dim, cca::Splitter< DTOTYPE >::ip, cca::Splitter< DTOTYPE >::ops, cca::PortTriggered::port(), cca::Node::registerPort(), cca::Node::setProcessingStrategy(), and cca::Splitter< DTOTYPE >::splitConfig.

Here is the call graph for this function:

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

Definition at line 105 of file Splitter.h.


Member Function Documentation

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

Configure output port by number.

Parameters:
indexNumber of the output port to configure
portcfgPortConfiguration, either PortConfiguration::LOCAL() or PortConfiguration::REMOTE() with given Scope, default is the local port.

Definition at line 232 of file Splitter.h.

References cca::Node::configureOutputPort().

Here is the call graph for this function:

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

Configure output port by number.

Parameters:
indexNumber of the output port to configure
scopeConnecting scope

Definition at line 247 of file Splitter.h.

References cca::Node::configureOutputPort().

Here is the call graph for this function:

template<class DTOTYPE>
static NodePtr cca::Splitter< 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 139 of file Splitter.h.

template<class DTOTYPE>
static NodePtr cca::Splitter< DTOTYPE >::create ( std::string  nodename,
nemo::IntVector  config 
) [inline, static]

Creates a splitter shared pointer with specific splitting configuration.

An integer vector specifies, how to split up the incoming dto. E.g. {1, 2} to split an incoming 3-dimensional DTO into an 1-dimensional and 2-dimensional DTO.

Parameters:
nodenameName of this splitter node
configConfiguration of splitting.

Definition at line 153 of file Splitter.h.

template<class DTOTYPE>
static NodePtr cca::Splitter< DTOTYPE >::create ( std::string  nodename,
int  first,
int  second 
) [inline, static]

Creates a splitter shared pointer with specific splitting configuration.

Two integer arguments specify, how to split up the incoming dto. E.g. first=1, second=2 to split an incoming 3-dimensional DTO into an 1-dimensional and 2-dimensional DTO.

Parameters:
nodenameName of this splitter node
firstSize of first split
secondSize of second split

Definition at line 170 of file Splitter.h.

template<class DTOTYPE>
static NodePtr cca::Splitter< DTOTYPE >::create ( std::string  nodename,
int  first,
int  second,
int  third 
) [inline, static]

Creates a splitter shared pointer with specific splitting configuration.

Three integer arguments specify, how to split up the incoming dto. E.g. first=1, second=2, third=1 to split an incoming 4-dimensional DTO into an 1-dimensional, 2-dimensional and another 1-dimensional DTO.

Parameters:
nodenameName of this splitter node
firstSize of first split
secondSize of second split
thirdSize of third split

Definition at line 191 of file Splitter.h.

template<class DTOTYPE>
static NodePtr cca::Splitter< DTOTYPE >::create ( 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 205 of file Splitter.h.

template<class DTOTYPE>
void cca::Splitter< 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 112 of file Splitter.h.

References cca::Splitter< DTOTYPE >::dim, cca::InputPort< DATATYPE >::empty(), cca::InputPort< DATATYPE >::get(), cca::Node::getName(), cca::Splitter< DTOTYPE >::ip, cca::Splitter< DTOTYPE >::ops, and cca::Splitter< DTOTYPE >::splitConfig.

Here is the call graph for this function:


Friends And Related Function Documentation

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

Stream operator.

Parameters:
os
node
Returns:

Definition at line 215 of file Splitter.h.


Member Data Documentation

template<class DTOTYPE>
unsigned int cca::Splitter< DTOTYPE >::dim [private]
template<class DTOTYPE>
InputPort<DTOTYPE>::Ptr cca::Splitter< DTOTYPE >::ip [private]
template<class DTOTYPE>
std::vector<typename OutputPort<DTOTYPE>::Ptr> cca::Splitter< DTOTYPE >::ops [private]
template<class DTOTYPE>
nemo::IntVector cca::Splitter< DTOTYPE >::splitConfig [private]

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