CCA

Base CCA Data-Flow Component. More...

#include <Component.h>

Inheritance diagram for cca::Component:
Collaboration diagram for cca::Component:

List of all members.

Public Member Functions

 Component (const std::string &name, ComponentStatePtr initialState=ComponentState::EXECUTION())
 Constructor.
virtual ~Component ()
virtual bool requestTransition (const ComponentStatePtr &state)
 Make a transition in the component`s life-cycle.
virtual void configureStateInputPort (PortConfigurationPtr portcfg)
 Configure state change input port.
virtual void configureBeatInputPort (PortConfigurationPtr portcfg)
 Configure beat input port.
virtual void configureStateOutputPort (PortConfigurationPtr portcfg)
 Configure component state output port.
virtual void publishState ()
 Publish the components state over it`s configured state output port.
virtual void process ()
 If processing is triggered.
virtual void onProcess ()
 This is the user-defined main execution method of the component.
virtual void onStartExecution ()
 Called once when component transitions to execution state.
virtual void onStopExecution ()
 Called once when component leaves execution state.
virtual void onLearnOffline ()
 This is the user-defined method for an off-line learning step.
virtual void onStartLearnOffline ()
 Called once when component transitions to off-line learning state.
virtual void onStopLearnOffline ()
 Called once when component leaves off-line learning state.
virtual void onLearnOnlineBeforeProcess ()
 During online learning, this method is called before each execution step.
virtual void onStartLearnOnline ()
 Called once when component transitions to online learning state.
virtual void onStopLearnOnline ()
 Called once when component leaves online learning state.
virtual void onLearnOnlineAfterProcess ()
 During online learning, this method is called after each execution step.
virtual std::string print () const
 Printing information about this component.

Protected Member Functions

void createBeatInputPort ()
void createStateInputPort ()
void createStateOutputPort ()
void beatCallback (rsb::EventPtr)
void stateCallback (rsb::EventPtr)

Protected Attributes

ComponentStatePtr state
 ComponentState.
InputPort< cca::timing::Tick >::Ptr inputBeat
 Input port for a beat.
InputPort< ComponentState >::Ptr inputState
 Input port for state change requests.
OutputPort< ComponentState >::Ptr outputState
 Output port for component state.
cca::timing::TickPtr lastTick
 Virtual time support.
boost::uint64_t circuitTime
boost::uint64_t circuitVirtualTime
boost::uint64_t circuitLastTimestep
boost::uint64_t circuitLastVirtualTimestep
boost::uint64_t circuitSequence

Private Member Functions

 Component (Component &node)
 Copy constructor private for now to disallow copying.
void operator= (const Component &)
 Copy operator private for now to disallow copying.
std::string scopeName ()
 Method to render a valid scope string from component name.

Private Attributes

std::string scopename
rsc::logging::LoggerPtr logger
 Component logger.
ComponentStatePtr initialState
 Initial State.

Detailed Description

Base CCA Data-Flow Component.

Definition at line 42 of file Component.h.


Constructor & Destructor Documentation

cca::Component::Component ( const std::string &  name,
ComponentStatePtr  initialState = ComponentState::EXECUTION() 
)

Constructor.

Parameters:
nameName of this Node
initialStateInitial life-cycle state of the component

Definition at line 56 of file Component.cpp.

References createBeatInputPort(), createStateInputPort(), createStateOutputPort(), cca::Node::getName(), and logger.

Here is the call graph for this function:

cca::Component::Component ( Component node) [private]

Copy constructor private for now to disallow copying.


Member Function Documentation

void cca::Component::beatCallback ( rsb::EventPtr  ) [protected]

Definition at line 224 of file Component.cpp.

References circuitLastTimestep, circuitLastVirtualTimestep, circuitSequence, circuitTime, circuitVirtualTime, cca::InputPort< DATATYPE >::get(), cca::Node::getName(), inputBeat, cca::Node::isConfigured(), lastTick, logger, and cca::Node::tick().

Referenced by createBeatInputPort().

Here is the call graph for this function:

Here is the caller graph for this function:

Configure beat input port.

Parameters:
portcfgPortConfiguration type, either PortConfiguration::LOCAL() or PortConfiguration::REMOTE(), default is the local port.

Definition at line 406 of file Component.cpp.

References cca::Port::configure(), cca::Node::getName(), inputBeat, and logger.

Referenced by createBeatInputPort().

Here is the call graph for this function:

Here is the caller graph for this function:

Configure state change input port.

Parameters:
portcfgPortConfiguration type, either PortConfiguration::LOCAL() or PortConfiguration::REMOTE(), default is the local port.

Definition at line 450 of file Component.cpp.

References cca::Port::configure(), cca::Node::getName(), inputState, and logger.

Referenced by createStateInputPort().

Here is the call graph for this function:

Here is the caller graph for this function:

Configure component state output port.

Parameters:
portcfgPortConfiguration type, either PortConfiguration::LOCAL() or PortConfiguration::REMOTE(), default is the local port.

Definition at line 490 of file Component.cpp.

References cca::Port::configure(), cca::Node::getName(), logger, and outputState.

Referenced by createStateOutputPort().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 455 of file Component.cpp.

References configureStateOutputPort(), cca::Node::create(), cca::Node::getName(), cca::PortConfiguration::LOCAL(), cca::PortConfiguration::LOCALREMOTE(), logger, outputState, cca::PortConfiguration::REMOTE(), scopeName(), and scopename.

Referenced by Component().

Here is the call graph for this function:

Here is the caller graph for this function:

void cca::Component::onLearnOffline ( ) [virtual]

This is the user-defined method for an off-line learning step.

This method will usually compute on a batch of data and can last a bit longer.

Definition at line 106 of file Component.cpp.

References cca::Node::getName(), and logger.

Referenced by process().

Here is the call graph for this function:

Here is the caller graph for this function:

During online learning, this method is called after each execution step.

Definition at line 117 of file Component.cpp.

References cca::Node::getName(), and logger.

Referenced by process().

Here is the call graph for this function:

Here is the caller graph for this function:

During online learning, this method is called before each execution step.

Try to do the heavier computation of the online learning step *after* the execution step, see onLearnOnlineAfterProcess.

Definition at line 111 of file Component.cpp.

References cca::Node::getName(), and logger.

Referenced by process().

Here is the call graph for this function:

Here is the caller graph for this function:

void cca::Component::onProcess ( ) [virtual]

This is the user-defined main execution method of the component.

Every time called, when the defined ProcessingStrategy triggers.

Implements cca::Node.

Definition at line 101 of file Component.cpp.

References cca::Node::getName(), and logger.

Here is the call graph for this function:

Called once when component transitions to execution state.

Definition at line 509 of file Component.cpp.

Referenced by requestTransition().

Here is the caller graph for this function:

Called once when component transitions to off-line learning state.

Definition at line 515 of file Component.cpp.

Referenced by requestTransition().

Here is the caller graph for this function:

Called once when component transitions to online learning state.

Definition at line 521 of file Component.cpp.

Referenced by requestTransition().

Here is the caller graph for this function:

void cca::Component::onStopExecution ( ) [virtual]

Called once when component leaves execution state.

Definition at line 512 of file Component.cpp.

Referenced by requestTransition(), and ~Component().

Here is the caller graph for this function:

Called once when component leaves off-line learning state.

Definition at line 518 of file Component.cpp.

Referenced by requestTransition(), and ~Component().

Here is the caller graph for this function:

Called once when component leaves online learning state.

Definition at line 524 of file Component.cpp.

Referenced by requestTransition(), and ~Component().

Here is the caller graph for this function:

void cca::Component::operator= ( const Component ) [private]

Copy operator private for now to disallow copying.

std::string cca::Component::print ( ) const [virtual]

Printing information about this component.

Reimplemented from cca::Node.

Definition at line 357 of file Component.cpp.

References cca::Node::defaultProperties, cca::Node::getName(), cca::Node::getProcessingStrategy(), inputBeat, cca::Node::inputPorts, inputState, cca::Node::outputPorts, outputState, cca::Node::properties, and state.

Referenced by process().

Here is the call graph for this function:

Here is the caller graph for this function:

void cca::Component::publishState ( ) [virtual]

Publish the components state over it`s configured state output port.

Definition at line 343 of file Component.cpp.

References cca::Node::getName(), cca::Port::isReady(), logger, outputState, cca::OutputPort< DATATYPE >::publish(), and state.

Referenced by requestTransition(), and ~Component().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string cca::Component::scopeName ( ) [private]

Method to render a valid scope string from component name.

Definition at line 495 of file Component.cpp.

References cca::Node::getName(), and scopename.

Referenced by createStateInputPort(), and createStateOutputPort().

Here is the call graph for this function:

Here is the caller graph for this function:

void cca::Component::stateCallback ( rsb::EventPtr  ) [protected]

Definition at line 255 of file Component.cpp.

References cca::Node::getName(), cca::Node::isConfigured(), logger, and requestTransition().

Referenced by createStateInputPort().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

boost::uint64_t cca::Component::circuitLastTimestep [protected]

Definition at line 187 of file Component.h.

Referenced by beatCallback().

boost::uint64_t cca::Component::circuitLastVirtualTimestep [protected]

Definition at line 187 of file Component.h.

Referenced by beatCallback().

boost::uint64_t cca::Component::circuitSequence [protected]

Definition at line 188 of file Component.h.

Referenced by beatCallback().

boost::uint64_t cca::Component::circuitTime [protected]

Definition at line 186 of file Component.h.

Referenced by beatCallback().

boost::uint64_t cca::Component::circuitVirtualTime [protected]

Definition at line 186 of file Component.h.

Referenced by beatCallback().

Initial State.

Definition at line 205 of file Component.h.

Input port for a beat.

Definition at line 176 of file Component.h.

Referenced by beatCallback(), configureBeatInputPort(), createBeatInputPort(), and print().

Input port for state change requests.

Definition at line 179 of file Component.h.

Referenced by configureStateInputPort(), createStateInputPort(), and print().

Virtual time support.

Definition at line 185 of file Component.h.

Referenced by beatCallback().

Output port for component state.

Definition at line 182 of file Component.h.

Referenced by configureStateOutputPort(), createStateOutputPort(), print(), and publishState().

std::string cca::Component::scopename [private]

Definition at line 199 of file Component.h.

Referenced by createStateInputPort(), createStateOutputPort(), and scopeName().


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