CCA

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

#include <RTPeriodicBeat.h>

Inheritance diagram for cca::RTPeriodicBeat:
Collaboration diagram for cca::RTPeriodicBeat:

List of all members.

Public Member Functions

 RTPeriodicBeat (unsigned int milliseconds)
 ~RTPeriodicBeat ()
std::string print () const
 Print.
void execute ()
 The main execution method which is executed with the specified cycle-time.
void registerReceiver (NodePtr receiver)
 Register a CCANode to receive the global beat.
std::vector< NodePtrgetReceivers ()
NodePtr getReceiver (unsigned int index)
unsigned int getCycleTime ()
 Cycle time.
virtual void run ()
 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 BeatPtr create (unsigned int milliseconds=10)
 Factory.

Protected Attributes

rsc::logging::LoggerPtr beatlogger

Friends

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

Detailed Description

Global heart beat of the Data-Flow graph.

With the specified sample-rate, all registered node get a global beat signal.

Todo:

Run methods with specified duration or specified number of ticks

Increasing/decreasing speed?

Definition at line 49 of file RTPeriodicBeat.h.


Constructor & Destructor Documentation

cca::RTPeriodicBeat::RTPeriodicBeat ( unsigned int  milliseconds)

Definition at line 47 of file RTPeriodicBeat.cpp.

References beatlogger.

Referenced by create().

Here is the caller graph for this function:


Member Function Documentation

void cca::RTPeriodicBeat::cancel ( ) [virtual]

Interrupts the task.

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

Implements cca::Beat.

Definition at line 80 of file RTPeriodicBeat.cpp.

References beatlogger.

BeatPtr cca::RTPeriodicBeat::create ( unsigned int  milliseconds = 10) [static]

Factory.

Definition at line 109 of file RTPeriodicBeat.cpp.

References RTPeriodicBeat().

Here is the call graph for this function:

void cca::RTPeriodicBeat::execute ( ) [virtual]

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

Implements cca::Beat.

Definition at line 53 of file RTPeriodicBeat.cpp.

References cca::Beat::_numReceivers, cca::Beat::_receiver, and beatlogger.

unsigned int cca::RTPeriodicBeat::getCycleTime ( ) [virtual]

Cycle time.

Returns:
Cycle-time in milliseconds

Reimplemented from cca::Beat.

Definition at line 65 of file RTPeriodicBeat.cpp.

References cca::Beat::_cycletime.

NodePtr cca::RTPeriodicBeat::getReceiver ( unsigned int  index) [virtual]

Reimplemented from cca::Beat.

Definition at line 94 of file RTPeriodicBeat.cpp.

References cca::Beat::_numReceivers, and cca::Beat::_receiver.

std::vector< NodePtr > cca::RTPeriodicBeat::getReceivers ( ) [virtual]

Reimplemented from cca::Beat.

Definition at line 76 of file RTPeriodicBeat.cpp.

References cca::Beat::_receiver.

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

Implements cca::Beat.

Definition at line 85 of file RTPeriodicBeat.cpp.

string cca::RTPeriodicBeat::print ( ) const [virtual]

Print.

Reimplemented from cca::Beat.

Definition at line 101 of file RTPeriodicBeat.cpp.

References cca::Beat::_cycletime, and cca::Beat::_numReceivers.

Referenced by cca::operator<<().

Here is the caller graph for this function:

void cca::RTPeriodicBeat::registerReceiver ( NodePtr  receiver) [virtual]

Register a CCANode to receive the global beat.

Parameters:
CCANodeto receive the global beat.

Reimplemented from cca::Beat.

Definition at line 69 of file RTPeriodicBeat.cpp.

References cca::Beat::_numReceivers, cca::Beat::_receiver, and beatlogger.

void cca::RTPeriodicBeat::run ( ) [virtual]

Run it.

Implements cca::Beat.

Definition at line 89 of file RTPeriodicBeat.cpp.

References beatlogger.


Friends And Related Function Documentation

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

Stream operator.

Parameters:
os
node
Returns:

Definition at line 113 of file RTPeriodicBeat.cpp.


Member Data Documentation

rsc::logging::LoggerPtr cca::RTPeriodicBeat::beatlogger [protected]

Definition at line 97 of file RTPeriodicBeat.h.

Referenced by cancel(), execute(), registerReceiver(), RTPeriodicBeat(), and run().


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