|
SatCat5
|
An "OnDemand" object is polled only on request.
A call to service() polls all pending OnDemand requests. This is the most common type of polling object. To receive OnDemand callbacks, derive a child class and override "poll_demand()".
#include <polling.h>
Public Member Functions | |
| void | request_poll () |
| Call this method to request polling at a later time. More... | |
| void | request_cancel () |
| Call this method to cancel a previous request_poll(). | |
Static Public Member Functions | |
| static unsigned | count_ondemand () |
| Count queued objects of this type (i.e., non-idle). | |
Protected Member Functions | |
| virtual void | poll_demand ()=0 |
| Deferred event handler, called after request(). More... | |
| constexpr | OnDemand () |
| Register this pollable object. More... | |
Private Attributes | |
| satcat5::poll::OnDemand * | m_next |
| bool | m_idle |
|
inlineconstexprprotected |
|
protectedpure virtual |
Deferred event handler, called after request().
Child class MUST override this method. (Call "request_poll" to enqueue a callback to this method.)
Implemented in satcat5::ptp::Dispatch, satcat5::poll::Timekeeper, satcat5::io::MultiBuffer, satcat5::gui::Canvas, satcat5::test::CountOnDemand, satcat5::io::Readable, and satcat5::cfg::MultiSerial.
| void satcat5::poll::OnDemand::request_poll | ( | ) |
Call this method to request polling at a later time.
Safe to stack requests, but only one call to poll().
Definition at line 208 of file polling.cc.