108 explicit Always(
bool auto_register=
true);
109 ~
Always() SATCAT5_OPTIONAL_DTOR;
119 friend satcat5::util::ListCore;
120 friend
void satcat5::poll::service();
121 satcat5::poll::
Always* m_next;
138 void request_cancel();
141 static unsigned count_ondemand();
155 friend satcat5::util::ListCore;
157 friend satcat5::ptp::Interface;
178 bool clock_ready()
const;
191 bool pre_test_reset();
194 void poll_demand()
override;
216 static unsigned count_timer();
219 void timer_once(
unsigned msec);
221 void timer_every(
unsigned msec);
235 ~
Timer() SATCAT5_OPTIONAL_DTOR;
238 virtual
void timer_event() = 0;
242 void query(
unsigned elapsed_msec);
244 friend satcat5::util::ListCore;
246 satcat5::poll::
Timer* m_next;
260 void timer_event()
override;
285 unsigned const m_interval;
Poll any OnDemand object using a TimeRef.
An "Always" object is polled whenever service() is called.
virtual void poll_always()=0
Child class MUST override this method.
static unsigned count_always()
Count active objects of this type.
void poll_register()
Register this pollable object, called by the constructor.
void poll_unregister()
Unregister this pollable object, called by the destructor.
Always(bool auto_register=true)
Registers this pollable object unless auto_register = false.
Global helper object that services all OnDemand objects.
An "OnDemand" object is polled only on request.
virtual void poll_demand()=0
Deferred event handler, called after request().
constexpr OnDemand()
Register this pollable object.
Global coordinator for multiple Timer objects.
Connect a Timer to any OnDemand object.
Timer objects are polled after a fixed delay or at a regular interval.
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.
The TimeRef API provides access to a monotonic time-counter.
Timekeeper timekeeper
There is a single global instance of the Timekeeper class.
void service()
Single-pass service loop.
void service_all(unsigned limit=100)
Multi-pass service loop Calling this function regularly is required for SatCat5 operation.
bool pre_test_reset()
Reset the global PRNG state used for rand_*(), below.
Timestamp for measuring elapsed time.
TimeRef and TimeVal define the API for monotonic timers.
Basic type aliases and prototypes used throughout SatCat5.