SatCat5
satcat5::irq::VirtualTimer Class Reference

Detailed Description

Poll any OnDemand object using a TimeRef.

SatCat5 event-loop concepts.

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.

Definition at line 274 of file polling.h.

#include <polling.h>

Inheritance diagram for satcat5::irq::VirtualTimer:
[legend]
Collaboration diagram for satcat5::irq::VirtualTimer:
[legend]

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::Alwaysm_next
 

Constructor & Destructor Documentation

◆ VirtualTimer()

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.

Member Function Documentation

◆ poll_always()

void satcat5::irq::VirtualTimer::poll_always ( )
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.


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