Skip to content

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 ()
DelayTimer (IHandler * listener)
RepeatTimer (unsigned short period, IHandler * listener)
Constructor that starts the timer.
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 ()
DelayTimer (IHandler * 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]

eva::RepeatTimer::DelayTimer () 

function DelayTimer [2/2]

eva::RepeatTimer::DelayTimer (
    IHandler * listener
) 

function RepeatTimer

Constructor that starts the timer.

eva::RepeatTimer::RepeatTimer (
    unsigned short period,
    IHandler * listener
) 

Parameters:

  • period Interval in milliseconds
  • listener Handler to invoke on each tick

function setListener

Assigns or changes the event listener.

RepeatTimer * eva::RepeatTimer::setListener (
    IHandler * listener
) 

Parameters:

  • listener Pointer 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:

  • period New 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:

  • period Interval in milliseconds
  • listener Handler to invoke on each tick

function start [2/3]

Starts or restarts the countdown timer.

void eva::RepeatTimer::start (
    unsigned short period
) 

Parameters:

  • period Interval 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:

  • period Interval 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