CppELib 1.7.0
|
Abstract class that has functions of common RTOS's one-shot timer. More...
#include <OneShotTimer.h>
Classes | |
class | UncaughtExceptionHandler |
Interface for handling uncaught exception. More... | |
Public Member Functions | |
virtual void | start (unsigned long timeInMillis)=0 |
Start the timer. | |
virtual void | stop ()=0 |
Stop the timer. | |
virtual bool | isStarted () const =0 |
Return true if the timer is started. | |
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 OneShotTimer. | |
UncaughtExceptionHandler * | getUncaughtExceptionHandler () const |
Get the UncaughtExceptionHandler for this OneShotTimer. | |
Static Public Member Functions | |
static void | setDefaultUncaughtExceptionHandler (UncaughtExceptionHandler *handler) |
Set the default UncaughtExceptionHandler for all the OneShotTimer. | |
static UncaughtExceptionHandler * | getDefaultUncaughtExceptionHandler () |
Get the default UncaughtExceptionHandler. | |
static OneShotTimer * | create (Runnable *r, const char *name="") |
Create an OneShotTimer object. | |
static void | destroy (OneShotTimer *t) |
Destroy an OneShotTimer object. | |
Protected Member Functions | |
OneShotTimer (Runnable *r) | |
virtual | ~OneShotTimer () |
void | timerMain () |
Common timer main method. | |
Abstract class that has functions of common RTOS's one-shot timer.
|
inlineexplicitprotected |
|
inlineprotectedvirtual |
|
static |
Create an OneShotTimer object.
r | Pointer of Runnable object |
name | Name of the object |
|
static |
Destroy an OneShotTimer object.
t | Pointer of OneShotTimer object created by OneShotTimer::create() |
|
static |
Get the default UncaughtExceptionHandler.
|
pure virtual |
Get the object's name.
Implemented in StdCppOSWrapper::StdCppOneShotTimer, TestDoubleOSWrapper::TestDoubleOneShotTimer, and WindowsOSWrapper::WindowsOneShotTimer.
OneShotTimer::UncaughtExceptionHandler * OSWrapper::OneShotTimer::getUncaughtExceptionHandler | ( | ) | const |
Get the UncaughtExceptionHandler for this OneShotTimer.
|
pure virtual |
Return true if the timer is started.
true | The timer is already started |
false | The timer is already stopped |
Implemented in StdCppOSWrapper::StdCppOneShotTimer, TestDoubleOSWrapper::TestDoubleOneShotTimer, and WindowsOSWrapper::WindowsOneShotTimer.
|
static |
Set the default UncaughtExceptionHandler for all the OneShotTimer.
handler | Pointer of UncaughtExceptionHandler object |
|
pure virtual |
Set the object's name.
name | The object's name |
Implemented in StdCppOSWrapper::StdCppOneShotTimer, TestDoubleOSWrapper::TestDoubleOneShotTimer, and WindowsOSWrapper::WindowsOneShotTimer.
void OSWrapper::OneShotTimer::setUncaughtExceptionHandler | ( | OneShotTimer::UncaughtExceptionHandler * | handler | ) |
Set the UncaughtExceptionHandler for this OneShotTimer.
handler | Pointer of UncaughtExceptionHandler object |
|
pure virtual |
Start the timer.
After the timeInMillis elapses, the timer calls Runnable::run() specified at create(). When the timer is fired one time, the timer is stopped.
timeInMillis | Time in milliseconds until the timer is fired |
Implemented in StdCppOSWrapper::StdCppOneShotTimer, TestDoubleOSWrapper::TestDoubleOneShotTimer, and WindowsOSWrapper::WindowsOneShotTimer.
|
pure virtual |
Stop the timer.
Before the timer is fired, it stops the timer.
Implemented in StdCppOSWrapper::StdCppOneShotTimer, TestDoubleOSWrapper::TestDoubleOneShotTimer, and WindowsOSWrapper::WindowsOneShotTimer.
|
protected |
Common timer main method.