|
SatCat5
|
Timer objects are polled after a fixed delay or at a regular interval.
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()".
#include <polling.h>
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::Timer * | m_next |
| unsigned | m_trem |
| unsigned | m_tnext |
|
protected |
Register object in the idle state.
(Only children should create or destroy the base class.)
Definition at line 293 of file polling.cc.