51 void startTimer(
unsigned int interval_s ,
unsigned int interval_us = 0U ) ;
62 bool active()
const noexcept ;
77 void adjust(
unsigned int us ) ;
93 void operator=(
const TimerBase & ) = delete ;
131 using method_type = void (T::*)() ;
136 void startTimer(
unsigned int interval_s ,
unsigned int interval_us = 0U ) ;
151 ~
Timer() override = default ;
154 void operator=( const
Timer<T> & ) = delete ;
155 void operator=(
Timer<T> && ) = delete ;
158 void onTimeout() override ;
A tuple containing an ExceptionHandler interface pointer and a bound 'exception source' pointer.
An interface used by GNet::TimerList to keep track of pending timeouts and to deliver timeout events.
void doTimeout()
Used by TimerList to execute the onTimeout() callback.
bool immediate() const
Used by TimerList.
void cancelTimer()
Cancels the timer. Does nothing if not running.
TimerBase(ExceptionSink es)
Constructor.
virtual void onTimeout()=0
Called when the timer expires (or soon after).
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.
bool active() const noexcept
Returns true if the timer is started and not cancelled.
G::TimerTime t() const
Used by TimerList to get the expiry epoch time.
virtual ~TimerBase()
Destructor.
void adjust(unsigned int us)
Used by TimerList to set the fractional part of the expiry time of immediate() timers so that t() is ...
A timer class template in which the timeout is delivered to the specified method.
void startTimer(unsigned int interval_s, unsigned int interval_us=0U)
Starts or restarts the timer so that it expires after the given interval.
void startTimer(const G::TimeInterval &)
Starts or restarts the timer so that it expires after the given interval.
void cancelTimer()
Cancels the timer. Does nothing if not running.
bool active() const noexcept
Returns true if the timer is running.
Timer(T &t, method_type m, ExceptionSink)
Constructor.
An interval between two G::SystemTime values or two G::TimerTime values.
A monotonically increasing subsecond-resolution timestamp, notionally unrelated to time_t.
bool isZero() const noexcept
Returns true if zero().