1#ifndef OS_WRAPPER_ONESHOT_TIMER_H_INCLUDED
2#define OS_WRAPPER_ONESHOT_TIMER_H_INCLUDED
7class OneShotTimerFactory;
23 : m_runnable(r), m_uncaughtExceptionHandler(0) {}
88 virtual void start(
unsigned long timeInMillis) = 0;
138 void handleException(
const char* msg);
Interface for handling uncaught exception.
Definition OneShotTimer.h:36
virtual ~UncaughtExceptionHandler()
Definition OneShotTimer.h:38
virtual void handle(OneShotTimer *t, const char *msg)=0
Handle uncaught exception thrown in the OneShotTimer.
Abstract class that has functions of common RTOS's one-shot timer.
Definition OneShotTimer.h:20
static void destroy(OneShotTimer *t)
Destroy an OneShotTimer object.
Definition OneShotTimer.cpp:93
virtual void stop()=0
Stop the timer.
static UncaughtExceptionHandler * getDefaultUncaughtExceptionHandler()
Get the default UncaughtExceptionHandler.
Definition OneShotTimer.cpp:24
UncaughtExceptionHandler * getUncaughtExceptionHandler() const
Get the UncaughtExceptionHandler for this OneShotTimer.
Definition OneShotTimer.cpp:34
OneShotTimer(Runnable *r)
Definition OneShotTimer.h:22
void timerMain()
Common timer main method.
Definition OneShotTimer.cpp:62
virtual ~OneShotTimer()
Definition OneShotTimer.h:24
static OneShotTimer * create(Runnable *r, const char *name="")
Create an OneShotTimer object.
Definition OneShotTimer.cpp:84
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 void start(unsigned long timeInMillis)=0
Start the timer.
static void setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler *handler)
Set the default UncaughtExceptionHandler for all the OneShotTimer.
Definition OneShotTimer.cpp:19
virtual const char * getName() const =0
Get the object's name.
void setUncaughtExceptionHandler(UncaughtExceptionHandler *handler)
Set the UncaughtExceptionHandler for this OneShotTimer.
Definition OneShotTimer.cpp:29
Interface for implementing an active class.
Definition Runnable.h:9
OSWrapper provides abstract C++ interface of common RTOS: thread, mutex, event flag,...
Definition EventFlag.cpp:5
void registerOneShotTimerFactory(OneShotTimerFactory *factory)
Register the OneShotTimerFactory.
Definition OneShotTimer.cpp:11