32 m_time(
G::TimerTime::zero())
55 else if( immediate() )
67 return m_time <= now ;
74 m_immediate = time == 0U && time_us == 0U ;
94 G_ASSERT( m_active && m_immediate ) ;
109 G_ASSERT( m_active ) ;
A tuple containing an ExceptionHandler interface pointer and a bound 'exception source' pointer.
void doTimeout()
Used by TimerList to execute the onTimeout() callback.
void adjust(unsigned long)
Used by TimerList to set the order of immedate() timer expiry.
bool immediate() const
Used by TimerList.
void cancelTimer()
Cancels the timer. Does nothing if not running.
TimerBase(ExceptionSink es)
Constructor.
void startTimer(unsigned int interval_s, unsigned int interval_us=0U)
Starts or restarts the timer so that it expires after the given interval.
bool expired(G::TimerTime &) const
Used by TimerList.
G::TimerTime t() const
Used by TimerList to get the expiry epoch time.
virtual ~TimerBase()
Destructor.
void remove(TimerBase &) noexcept
Removes a timer from the list.
void updateOnStart(TimerBase &)
Called by Timer when a timer is started.
static TimerList & instance()
Singleton access. Throws an exception if none.
static TimerList * ptr() noexcept
Singleton access. Returns nullptr if none.
void updateOnCancel(TimerBase &)
Called by Timer when a timer is cancelled.
void add(TimerBase &, ExceptionSink)
Adds a timer. Called from the Timer constructor.
An interval between two G::SystemTime values or two G::TimerTime values.
A monotonically increasing subsecond-resolution timestamp, notionally unrelated to time_t.
static TimerTime now()
Factory function for the current steady-clock time.
static TimerTime zero()
Factory function for the start of the epoch, guaranteed to be less than any now().