CCA

Global heart beat of the Data-Flow graph. More...

#include <HeartBeat.h>

Inheritance diagram for cca::timing::HeartBeat:
Collaboration diagram for cca::timing::HeartBeat:

List of all members.

Public Member Functions

 HeartBeat (unsigned int milliseconds, PortConfiguration::Transport transport=PortConfiguration::CCALocal)
 ~HeartBeat ()
std::string print () const
 Print.
void execute ()
 The main execution method which is executed with the specified cycle-time.
virtual unsigned int getCycleTime ()
 Cycle time.
virtual void run ()
 Run it.
virtual void run (unsigned int cycles)
 Run it.
virtual void cancel ()
 Interrupts the task.
virtual bool isCancelRequested ()
 Tells whether the task was interrupted by a call to cancel.

Static Public Member Functions

static HeartBeatPtr LOCAL (unsigned int milliseconds=10)
 Factory for local beat.
static HeartBeatPtr REMOTE (unsigned int milliseconds=10)
 Factory for remote (external) beat.
static HeartBeatPtr LOCALREMOTE (unsigned int milliseconds=10)
 Factory local and remote (external) beat.

Protected Attributes

unsigned int _cycletime
 Samplerate in milliseconds.
unsigned int _sequenceNumber

Private Attributes

rsc::logging::LoggerPtr logger
 Component logger.

Friends

std::ostream & operator<< (std::ostream &os, const HeartBeat &beat)
 Stream operator.

Detailed Description

Global heart beat of the Data-Flow graph.

With the specified sample-rate, all node that listen to a beat will get the global beat signal.

Todo:
Run methods with specified duration or specified number of ticks

Definition at line 49 of file HeartBeat.h.


Constructor & Destructor Documentation

Definition at line 41 of file HeartBeat.cpp.

References cca::PortConfiguration::CCALocalRemote, cca::Port::configure(), cca::PortConfiguration::create(), logger, and cca::timing::BeatProvider::outputBeat.

Referenced by LOCAL(), LOCALREMOTE(), and REMOTE().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 59 of file HeartBeat.cpp.


Member Function Documentation

void cca::timing::HeartBeat::cancel ( ) [virtual]

Interrupts the task.

The default implementation sets a boolean flag that can be checked with isCancelRequested.

Definition at line 73 of file HeartBeat.cpp.

References logger.

The main execution method which is executed with the specified cycle-time.

Definition at line 62 of file HeartBeat.cpp.

References _sequenceNumber, logger, cca::timing::BeatProvider::outputBeat, and cca::OutputPort< DATATYPE >::publish().

Here is the call graph for this function:

unsigned int cca::timing::HeartBeat::getCycleTime ( ) [virtual]

Cycle time.

Returns:
Cycle-time in milliseconds

Definition at line 69 of file HeartBeat.cpp.

References _cycletime.

Tells whether the task was interrupted by a call to cancel.

The default implementation returns the value of a boolean flag. Override this for more complex logic but don't forget to also override cancel then.

Returns:
true if cancel was called, else false

Definition at line 78 of file HeartBeat.cpp.

HeartBeatPtr cca::timing::HeartBeat::LOCAL ( unsigned int  milliseconds = 10) [static]

Factory for local beat.

Definition at line 100 of file HeartBeat.cpp.

References cca::PortConfiguration::CCALocal, and HeartBeat().

Here is the call graph for this function:

HeartBeatPtr cca::timing::HeartBeat::LOCALREMOTE ( unsigned int  milliseconds = 10) [static]

Factory local and remote (external) beat.

Definition at line 110 of file HeartBeat.cpp.

References cca::PortConfiguration::CCALocalRemote, and HeartBeat().

Here is the call graph for this function:

Print.

Definition at line 93 of file HeartBeat.cpp.

References _cycletime.

Referenced by cca::timing::operator<<().

Here is the caller graph for this function:

HeartBeatPtr cca::timing::HeartBeat::REMOTE ( unsigned int  milliseconds = 10) [static]

Factory for remote (external) beat.

Definition at line 105 of file HeartBeat.cpp.

References cca::PortConfiguration::CCARemote, and HeartBeat().

Here is the call graph for this function:

void cca::timing::HeartBeat::run ( ) [virtual]

Run it.

Definition at line 82 of file HeartBeat.cpp.

References logger.

Referenced by run().

Here is the caller graph for this function:

void cca::timing::HeartBeat::run ( unsigned int  cycles) [virtual]

Run it.

Definition at line 87 of file HeartBeat.cpp.

References logger, and run().

Here is the call graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const HeartBeat beat 
) [friend]

Stream operator.

Parameters:
os
node
Returns:

Definition at line 115 of file HeartBeat.cpp.


Member Data Documentation

unsigned int cca::timing::HeartBeat::_cycletime [protected]

Samplerate in milliseconds.

Each _cycletime milliseconds, alls receivers get the global beat signal.

Definition at line 128 of file HeartBeat.h.

Referenced by getCycleTime(), and print().

unsigned int cca::timing::HeartBeat::_sequenceNumber [protected]

Definition at line 130 of file HeartBeat.h.

Referenced by execute().

rsc::logging::LoggerPtr cca::timing::HeartBeat::logger [private]

Component logger.

Reimplemented from cca::timing::BeatProvider.

Definition at line 133 of file HeartBeat.h.

Referenced by cancel(), execute(), HeartBeat(), and run().


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