SatCat5
satcat5::poll::Timer Class Referenceabstract

Detailed Description

Timer objects are polled after a fixed delay or at a regular interval.

SatCat5 event-loop concepts.

To poll a timer once after a fixed delay, call "timer_once()". To poll a timer at a regular interval, call "timer_every()". To receive timer callbacks, derive a child class and override "timer_event()".

Definition at line 213 of file polling.h.

#include <polling.h>

Inheritance diagram for satcat5::poll::Timer:
[legend]
Collaboration diagram for satcat5::poll::Timer:
[legend]

Public Member Functions

void timer_once (unsigned msec)
 Configure a one-time notification after X milliseconds.
 
void timer_every (unsigned msec)
 Configure a repeating notification every X milliseconds.
 
void timer_stop ()
 Stop all future notifications.
 
unsigned timer_interval () const
 Accessor for recurring timer interval, if one is set.
 
unsigned timer_remaining () const
 Accessor for time to next event, if one is set.
 

Static Public Member Functions

static unsigned count_timer ()
 Count all objects of this type, including idle timers.
 

Protected Member Functions

 Timer ()
 Register object in the idle state. More...
 
virtual void timer_event ()=0
 Child class MUST override this method.
 

Private Member Functions

void query (unsigned elapsed_msec)
 

Private Attributes

satcat5::poll::Timerm_next
 
unsigned m_trem
 
unsigned m_tnext
 

Constructor & Destructor Documentation

◆ Timer()

satcat5::poll::Timer::Timer ( )
protected

Register object in the idle state.

(Only children should create or destroy the base class.)

Definition at line 293 of file polling.cc.


The documentation for this class was generated from the following files: