Class eva::RepeatTimer¶
ClassList > eva > RepeatTimer
Timer that fires repeatedly at fixed intervals.
#include <evaRepeatTimer.h>
Inherits the following classes: eva::DelayTimer
Public Functions¶
| Type | Name |
|---|---|
| DelayTimer () Constructs a RepeatTimer with no listener. |
|
| DelayTimer (IHandler * listener) Constructs a RepeatTimer with no listener. |
|
| RepeatTimer (unsigned short period, IHandler * listener) Constructs a RepeatTimer and starts it. |
|
| RepeatTimer * | setListener (IHandler * listener) Assigns or changes the event listener. |
| RepeatTimer * | setPeriod (unsigned short period) Changes the timer period. |
| void | start (unsigned short period, IHandler * listener) Starts or restarts the repeating timer. |
| void | start (unsigned short period) Starts or restarts the countdown timer. |
| void | start () Starts or restarts the countdown timer. |
Public Functions inherited from eva::DelayTimer¶
See eva::DelayTimer
| Type | Name |
|---|---|
| DelayTimer () Constructs a DelayTimer with no listener. |
|
| DelayTimer (IHandler * listener) Constructs a DelayTimer with a listener. |
|
| bool | isRunning () Checks if the timer is currently active. |
| DelayTimer * | setListener (IHandler * listener) Assigns or changes the event listener. |
| void | start (unsigned short delay, IHandler * listener) Starts the timer. |
| void | start (unsigned short delay) Starts the timer. |
| void | stop () Stops the timer. |
Public Functions inherited from eva::Tickable¶
See eva::Tickable
| Type | Name |
|---|---|
| Tickable () |
|
| Tickable (const Tickable &) = delete |
|
| Tickable (Tickable &&) = delete |
|
| Tickable & | operator= (const Tickable &) = delete |
| Tickable & | operator= (Tickable &&) = delete |
| virtual | ~Tickable () |
Public Static Functions inherited from eva::Tickable¶
See eva::Tickable
| Type | Name |
|---|---|
| void | tac () Triggers tick on this and all linked tickables. |
Protected Attributes inherited from eva::DelayTimer¶
See eva::DelayTimer
| Type | Name |
|---|---|
| IHandler * | listener |
| unsigned long | nextFire |
Protected Functions inherited from eva::DelayTimer¶
See eva::DelayTimer
| Type | Name |
|---|---|
| bool | checkTimeElapsed () |
| virtual void | tick () override |
Public Functions Documentation¶
function DelayTimer [1/2]¶
Constructs a RepeatTimer with no listener.
eva::RepeatTimer::DelayTimer ()
function DelayTimer [2/2]¶
Constructs a RepeatTimer with no listener.
eva::RepeatTimer::DelayTimer (
IHandler * listener
)
function RepeatTimer¶
Constructs a RepeatTimer and starts it.
eva::RepeatTimer::RepeatTimer (
unsigned short period,
IHandler * listener
)
Parameters:
periodInterval in millisecondslistenerHandler to invoke on each tick
function setListener¶
Assigns or changes the event listener.
RepeatTimer * eva::RepeatTimer::setListener (
IHandler * listener
)
Parameters:
listenerPointer to IHandler implementation that will receive timer events
Returns:
Pointer to this RepeatTimer instance for method chaining
function setPeriod¶
Changes the timer period.
RepeatTimer * eva::RepeatTimer::setPeriod (
unsigned short period
)
Parameters:
periodNew interval in milliseconds
Returns:
Pointer to this RepeatTimer instance for method chaining
function start [1/3]¶
Starts or restarts the repeating timer.
void eva::RepeatTimer::start (
unsigned short period,
IHandler * listener
)
Parameters:
periodInterval in millisecondslistenerHandler to invoke on each tick
function start [2/3]¶
Starts or restarts the countdown timer.
void eva::RepeatTimer::start (
unsigned short period
)
Parameters:
periodInterval in milliseconds
Listener must be assigned via constructor or setListener(). Use overloaded version with listener parameter if not pre-assigned.
function start [3/3]¶
Starts or restarts the countdown timer.
void eva::RepeatTimer::start ()
Parameters:
periodInterval in milliseconds
Listener and period must be assigned via constructor or setListener() and setPeriod(). Use overloaded versions if not pre-assigned.
The documentation for this class was generated from the following file src/evaRepeatTimer.h