Clock Class Reference
#include <Clock.h>
Inheritance diagram for Clock:
![](../class_clock.png)
# Public Member Functions | |
void | constructor () |
Class' constructor. | |
void | destructor () |
Class' destructor. | |
void | start () |
Start the clock. | |
void | stop () |
Stop the clock. | |
void | pause (bool pause) |
void | reset () |
Reset the clock's elapsed time. | |
void | update (uint32 elapsedMilliseconds) |
bool | isPaused () |
uint32 | getMilliseconds () |
uint32 | getMinutes () |
uint32 | getSeconds () |
void | print (int32 col, int32 row, const char *font) |
# Static Public Member Functions | |
static void | printTime (uint32 milliseconds, int32 x, int32 y, const char *font, uint32 precision) |
static void | printDeciseconds (uint32 milliSeconds, int32 x, int32 y, const char *font) |
static void | printCentiseconds (uint32 milliSeconds, int32 x, int32 y, const char *font) |
static void | printMilliseconds (uint32 milliSeconds, int32 x, int32 y, const char *font) |
# Protected Attributes | |
uint32 | milliseconds |
Elapsed time in milliseconds. | |
uint32 | previousSecond |
Previous elapsed second. | |
uint32 | previousMinute |
Previous elapsed minute. | |
bool | paused |
Flag to signal if the clock is paused or not. |
# Additional Inherited Members | |
![]() | |
void | constructor () |
Class' constructor. | |
void | destructor () |
Class' destructor. | |
void | addEventListener (ListenerObject listener, uint16 eventCode) |
void | removeEventListener (ListenerObject listener, uint16 eventCode) |
void | removeEventListeners (uint16 eventCode) |
void | removeAllEventListeners () |
Remove all listener objects. | |
bool | hasActiveEventListeners () |
void | fireEvent (uint16 eventCode) |
void | sendMessageTo (ListenerObject receiver, uint32 message, uint32 delay, uint32 randomDelay) |
void | sendMessageToSelf (uint32 message, uint32 delay, uint32 randomDelay) |
void | discardAllMessages () |
Discard all messages, both to be sent and to be received. | |
void | discardMessages (uint32 message) |
virtual bool | onEvent (ListenerObject eventFirer, uint16 eventCode) |
virtual bool | handleMessage (Telegram telegram) |
![]() | |
VirtualList | events |
List of registered events. | |
int8 | eventFirings |
Counter that keeps track of the number of fired events to prevent race conditions in nested firings. |
# Detailed Description
Class Clock
Inherits from ListenerObject
Implements simple clock that can keep track of time and print itself.
# Member Function Documentation
# constructor()
# destructor()
# getMilliseconds()
uint32 Clock::getMilliseconds | ( | ) |
# getMinutes()
uint32 Clock::getMinutes | ( | ) |
# getSeconds()
uint32 Clock::getSeconds | ( | ) |
# isPaused()
bool Clock::isPaused | ( | ) |
# pause()
void Clock::pause | ( | bool | pause | ) |
# print()
# printCentiseconds()
# printDeciseconds()
# printMilliseconds()
# printTime()
# reset()
# start()
# stop()
# update()
void Clock::update | ( | uint32 | elapsedMilliseconds | ) |
# Member Data Documentation
# milliseconds
|
protected |
# paused
|
protected |
# previousMinute
|
protected |
# previousSecond
|
protected |
The documentation for this class was generated from the following files: