Garmin Fleet Management Controller
2.19.0
|
Manages timer (periodic) events. More...
#include <TimerManager.h>
Static Public Member Functions | |
static void | addListener (TimerListener *aListener) |
Register a listener to receive periodic callbacks. More... | |
static void | removeListener (TimerListener *aListener) |
Remove a TimerListener from the list that is called. More... | |
static void | tick () |
Timer tick. More... | |
Private Member Functions | |
TimerManager () | |
Constructor. More... | |
virtual | ~TimerManager () |
Destructor. More... | |
void | instanceAddListener (TimerListener *aListener) |
Register a listener to receive periodic callbacks. More... | |
void | instanceRemoveListener (TimerListener *aListener) |
Remove a TimerListener from the list that is called. More... | |
void | instanceTick () |
Timer tick. More... | |
Static Private Member Functions | |
static void | destroyInstance () |
Destroy the TimerManager instance. More... | |
static TimerManager * | getInstance () |
Get the TimerManager instance. More... | |
Private Attributes | |
std::list< TimerListener * > | mListeners |
List of objects that will get periodic notifications. More... | |
Static Private Attributes | |
static TimerManager * | sInstance = NULL |
Pointer to the one and only TimerManager instance. More... | |
Manages timer (periodic) events.
The TimerManager manages the list of TimerListener objects in the application, and periodically calls their onTimer function. The application is responsible for periodically calling tick().
Definition at line 25 of file TimerManager.h.
|
private |
|
privatevirtual |
|
static |
Register a listener to receive periodic callbacks.
aListener | The listener object to add |
Definition at line 61 of file TimerManager.cpp.
References getInstance(), and instanceAddListener().
Referenced by TimerListener::TimerListener(), and ~TimerManager().
|
staticprivate |
Destroy the TimerManager instance.
Destroy the one and only TimerManager.
Definition at line 36 of file TimerManager.cpp.
References sInstance.
Referenced by getInstance().
|
staticprivate |
Get the TimerManager instance.
Get the instance of the TimerManager, constructing it if necessary.
Definition at line 22 of file TimerManager.cpp.
References destroyInstance(), sInstance, and TimerManager().
Referenced by addListener(), removeListener(), and tick().
|
private |
Register a listener to receive periodic callbacks.
aListener | The listener object to add |
Definition at line 73 of file TimerManager.cpp.
References mListeners, and removeListener().
Referenced by addListener().
|
private |
Remove a TimerListener from the list that is called.
aListener | The listener to remove |
Definition at line 98 of file TimerManager.cpp.
References mListeners.
Referenced by removeListener().
|
private |
Timer tick.
This function is called periodically and distributes the timer event to all TimerListnener objects.
Definition at line 121 of file TimerManager.cpp.
References mListeners.
Referenced by tick().
|
static |
Remove a TimerListener from the list that is called.
aListener | The aListener to remove |
Definition at line 86 of file TimerManager.cpp.
References getInstance(), and instanceRemoveListener().
Referenced by instanceAddListener(), and TimerListener::~TimerListener().
|
static |
Timer tick.
This function is called periodically and distributes the timer event to all TimerListnener objects.
Definition at line 111 of file TimerManager.cpp.
References getInstance(), and instanceTick().
Referenced by CFmiPcAppDlg::OnTimer().
|
private |
List of objects that will get periodic notifications.
Definition at line 61 of file TimerManager.h.
Referenced by instanceAddListener(), instanceRemoveListener(), and instanceTick().
|
staticprivate |
Pointer to the one and only TimerManager instance.
Definition at line 58 of file TimerManager.h.
Referenced by destroyInstance(), and getInstance().