1#ifndef OS_WRAPPER_PERIODIC_TIMER_H_INCLUDED
2#define OS_WRAPPER_PERIODIC_TIMER_H_INCLUDED
7class PeriodicTimerFactory;
23 : m_runnable(r), m_uncaughtExceptionHandler(0) {}
141 void handleException(
const char* msg);
Interface for handling uncaught exception.
Definition PeriodicTimer.h:36
virtual ~UncaughtExceptionHandler()
Definition PeriodicTimer.h:38
virtual void handle(PeriodicTimer *t, const char *msg)=0
Handle uncaught exception thrown in the PeriodicTimer.
Abstract class that has functions of common RTOS's periodic timer.
Definition PeriodicTimer.h:20
static UncaughtExceptionHandler * getDefaultUncaughtExceptionHandler()
Get the default UncaughtExceptionHandler.
Definition PeriodicTimer.cpp:24
virtual void start()=0
Start the timer.
void timerMain()
Common timer main method.
Definition PeriodicTimer.cpp:62
virtual bool isStarted() const =0
Return true if the timer is started.
UncaughtExceptionHandler * getUncaughtExceptionHandler() const
Get the UncaughtExceptionHandler for this PeriodicTimer.
Definition PeriodicTimer.cpp:34
static void destroy(PeriodicTimer *t)
Destroy a PeriodicTimer object.
Definition PeriodicTimer.cpp:96
static PeriodicTimer * create(Runnable *r, unsigned long periodInMillis, const char *name="")
Create a PeriodicTimer object.
Definition PeriodicTimer.cpp:84
static void setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler *handler)
Set the default UncaughtExceptionHandler for all the PeriodicTimer.
Definition PeriodicTimer.cpp:19
virtual unsigned long getPeriodInMillis() const =0
Get the timer period (in milliseconds)
virtual ~PeriodicTimer()
Definition PeriodicTimer.h:24
PeriodicTimer(Runnable *r)
Definition PeriodicTimer.h:22
virtual const char * getName() const =0
Get the object's name.
virtual void stop()=0
Stop the timer.
void setUncaughtExceptionHandler(UncaughtExceptionHandler *handler)
Set the UncaughtExceptionHandler for this PeriodicTimer.
Definition PeriodicTimer.cpp:29
virtual void setName(const char *name)=0
Set the object's name.
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 registerPeriodicTimerFactory(PeriodicTimerFactory *factory)
Register the PeriodicTimerFactory.
Definition PeriodicTimer.cpp:11