|
SatCat5
|
Poll any OnDemand object using a TimeRef.
This class polls the system time (SATCAT5_CLOCK) and calls request_poll() at the designated interval. On platforms that do not have easy access to hardware interrupts, this is the preferred method of polling the global timekeeper.
#include <polling.h>
Public Member Functions | |
| VirtualTimer (satcat5::poll::OnDemand *obj, unsigned usec=1000) | |
| Poll the designated object once every N microseconds. More... | |
Protected Member Functions | |
| void | poll_always () override |
| Child class MUST override this method. More... | |
| void | poll_register () |
| Register this pollable object, called by the constructor. | |
| void | poll_unregister () |
| Unregister this pollable object, called by the destructor. | |
Static Protected Member Functions | |
| static unsigned | count_always () |
| Count active objects of this type. | |
Protected Attributes | |
| satcat5::poll::OnDemand *const | m_target |
| unsigned const | m_interval |
| satcat5::util::TimeVal | m_tref |
Private Attributes | |
| satcat5::poll::Always * | m_next |
| satcat5::irq::VirtualTimer::VirtualTimer | ( | satcat5::poll::OnDemand * | obj, |
| unsigned | usec = 1000 |
||
| ) |
Poll the designated object once every N microseconds.
(As determined using the designated time reference.)
Definition at line 368 of file polling.cc.
|
overrideprotectedvirtual |
Child class MUST override this method.
(This method should rarely be called directly.)
Implements satcat5::poll::Always.
Definition at line 376 of file polling.cc.