47 void startTimer(
unsigned int interval_s ,
unsigned int interval_us = 0U ) ;
87 return m_time.s != 0 ;
109 template <
typename T>
113 typedef void (T::*method_type)() ;
124 virtual void onException( std::exception & )
override ;
129 void operator=(
const Timer<T> & ) ;
137 template <
typename T>
141 m_event_exception_handler(e)
145 template <
typename T>
151 template <
typename T>
154 m_event_exception_handler.onException( e ) ;
A subsecond-resolution timestamp based on a time_t.
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket events and t...
bool active() const
Returns true if the timer is started and not cancelled.
TimerBase()
Default constructor.
A singleton which maintains a list of all Timer objects, and interfaces to the event loop on their be...
virtual void onTimeout()=0
Called when the timer expires (or soon after).
virtual void onTimeout() override
Override from GNet::TimerBase.
void cancelTimer()
Cancels the timer.
void startTimer(unsigned int interval_s, unsigned int interval_us=0U)
Starts the timer so that it goes off after the given time interval.
virtual ~TimerBase()
Destructor.
virtual void onException(std::exception &) override
Override from GNet::EventExceptionHandler.
An interface used by GNet::TimerList to keep track of pending timeouts and to deliver timeout events...
bool immediate() const
Returns true if the timer is active() and zero-length.
Timer(T &t, method_type m, EventExceptionHandler &event_exception_handler)
Constructor.
A timer class template in which the timeout is delivered to the specified method. ...