CCA

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

#include <PeriodicBeat.h>

Inheritance diagram for cca::PeriodicBeat:
Collaboration diagram for cca::PeriodicBeat:

List of all members.

Public Member Functions

 PeriodicBeat (unsigned int milliseconds)
 ~PeriodicBeat ()
std::string print () const
 Print.
void execute ()
 The main execution method which is executed with the specified cycle-time.
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 PeriodicBeatPtr create (unsigned int milliseconds=10)
 Factory.

Protected Attributes

rsc::logging::LoggerPtr beatlogger

Friends

std::ostream & operator<< (std::ostream &os, const PeriodicBeat &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 PeriodicBeat.h.


Constructor & Destructor Documentation

cca::PeriodicBeat::PeriodicBeat ( unsigned int  milliseconds)

Definition at line 47 of file PeriodicBeat.cpp.

References beatlogger.

Referenced by create().

Here is the caller graph for this function:

Definition at line 62 of file PeriodicBeat.cpp.


Member Function Documentation

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

Interrupts the task.

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

Implements cca::Beat.

Definition at line 69 of file PeriodicBeat.cpp.

References beatlogger.

PeriodicBeatPtr cca::PeriodicBeat::create ( unsigned int  milliseconds = 10) [static]

Factory.

Definition at line 91 of file PeriodicBeat.cpp.

References PeriodicBeat().

Here is the call graph for this function:

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

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

Implements cca::Beat.

Definition at line 53 of file PeriodicBeat.cpp.

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

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

Cycle time.

Returns:
Cycle-time in milliseconds

Reimplemented from cca::Beat.

Definition at line 65 of file PeriodicBeat.cpp.

References cca::Beat::_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

Implements cca::Beat.

Definition at line 74 of file PeriodicBeat.cpp.

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

Print.

Reimplemented from cca::Beat.

Definition at line 83 of file PeriodicBeat.cpp.

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

Referenced by cca::operator<<().

Here is the caller graph for this function:

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

Run it.

Implements cca::Beat.

Definition at line 78 of file PeriodicBeat.cpp.

References beatlogger.


Friends And Related Function Documentation

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

Stream operator.

Parameters:
os
node
Returns:

Definition at line 95 of file PeriodicBeat.cpp.


Member Data Documentation

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

Definition at line 90 of file PeriodicBeat.h.

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


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