CppELib 1.7.0
|
Abstract class that has functions of common RTOS's periodic timer. More...
#include <PeriodicTimer.h>
Classes | |
class | UncaughtExceptionHandler |
Interface for handling uncaught exception. More... | |
Public Member Functions | |
virtual void | start ()=0 |
Start the timer. | |
virtual void | stop ()=0 |
Stop the timer. | |
virtual bool | isStarted () const =0 |
Return true if the timer is started. | |
virtual unsigned long | getPeriodInMillis () const =0 |
Get the timer period (in milliseconds) | |
virtual void | setName (const char *name)=0 |
Set the object's name. | |
virtual const char * | getName () const =0 |
Get the object's name. | |
void | setUncaughtExceptionHandler (UncaughtExceptionHandler *handler) |
Set the UncaughtExceptionHandler for this PeriodicTimer. | |
UncaughtExceptionHandler * | getUncaughtExceptionHandler () const |
Get the UncaughtExceptionHandler for this PeriodicTimer. | |
Static Public Member Functions | |
static void | setDefaultUncaughtExceptionHandler (UncaughtExceptionHandler *handler) |
Set the default UncaughtExceptionHandler for all the PeriodicTimer. | |
static UncaughtExceptionHandler * | getDefaultUncaughtExceptionHandler () |
Get the default UncaughtExceptionHandler. | |
static PeriodicTimer * | create (Runnable *r, unsigned long periodInMillis, const char *name="") |
Create a PeriodicTimer object. | |
static void | destroy (PeriodicTimer *t) |
Destroy a PeriodicTimer object. | |
Protected Member Functions | |
PeriodicTimer (Runnable *r) | |
virtual | ~PeriodicTimer () |
void | timerMain () |
Common timer main method. | |
Abstract class that has functions of common RTOS's periodic timer.
|
inlineexplicitprotected |
|
inlineprotectedvirtual |
|
static |
Create a PeriodicTimer object.
r | Pointer of Runnable object |
periodInMillis | Timer period in milliseconds |
name | Name of the object |
|
static |
Destroy a PeriodicTimer object.
t | Pointer of PeriodicTimer object created by PeriodicTimer::create() |
|
static |
Get the default UncaughtExceptionHandler.
|
pure virtual |
Get the object's name.
Implemented in StdCppOSWrapper::StdCppPeriodicTimer, TestDoubleOSWrapper::TestDoublePeriodicTimer, and WindowsOSWrapper::WindowsPeriodicTimer.
|
pure virtual |
Get the timer period (in milliseconds)
Implemented in StdCppOSWrapper::StdCppPeriodicTimer, TestDoubleOSWrapper::TestDoublePeriodicTimer, and WindowsOSWrapper::WindowsPeriodicTimer.
PeriodicTimer::UncaughtExceptionHandler * OSWrapper::PeriodicTimer::getUncaughtExceptionHandler | ( | ) | const |
Get the UncaughtExceptionHandler for this PeriodicTimer.
|
pure virtual |
Return true if the timer is started.
true | The timer is already started |
false | The timer is already stopped |
Implemented in StdCppOSWrapper::StdCppPeriodicTimer, TestDoubleOSWrapper::TestDoublePeriodicTimer, and WindowsOSWrapper::WindowsPeriodicTimer.
|
static |
Set the default UncaughtExceptionHandler for all the PeriodicTimer.
handler | Pointer of UncaughtExceptionHandler object |
|
pure virtual |
Set the object's name.
name | The object's name |
Implemented in StdCppOSWrapper::StdCppPeriodicTimer, TestDoubleOSWrapper::TestDoublePeriodicTimer, and WindowsOSWrapper::WindowsPeriodicTimer.
void OSWrapper::PeriodicTimer::setUncaughtExceptionHandler | ( | PeriodicTimer::UncaughtExceptionHandler * | handler | ) |
Set the UncaughtExceptionHandler for this PeriodicTimer.
handler | Pointer of UncaughtExceptionHandler object |
|
pure virtual |
Start the timer.
When the timer period elapses, the timer calls Runnable::run() specified at create(). The timer calls the Runnable::run() per period.
Implemented in StdCppOSWrapper::StdCppPeriodicTimer, TestDoubleOSWrapper::TestDoublePeriodicTimer, and WindowsOSWrapper::WindowsPeriodicTimer.
|
pure virtual |
Stop the timer.
Implemented in StdCppOSWrapper::StdCppPeriodicTimer, TestDoubleOSWrapper::TestDoublePeriodicTimer, and WindowsOSWrapper::WindowsPeriodicTimer.
|
protected |
Common timer main method.