CCA
|
Global heart beat of the Data-Flow graph. More...
#include <PeriodicBeat.h>
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().
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().
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.
bool cca::PeriodicBeat::isCancelRequested | ( | ) | [virtual] |
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, elsefalse
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<<().
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] |
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:
- cca/timing/PeriodicBeat.h
- cca/timing/PeriodicBeat.cpp