21 #ifndef G_NET_TIMER__H
22 #define G_NET_TIMER__H
50 void startTimer(
unsigned int interval_s ,
unsigned int interval_us = 0U ) ;
92 return m_time.s != 0 ;
114 template <
typename T>
118 typedef void (T::*method_type)() ;
131 void operator=(
const Timer<T> & ) ;
139 template <
typename T>
144 m_event_exception_handler(e)
148 template <
typename T>
A subsecond-resolution timestamp based on a time_t.
void doTimeout()
Used by TimerList to execute the onTimeout() callback.
G::EpochTime t() const
Used by TimerList to get the expiry epoch time.
bool active() const
Returns true if the timer is started and not cancelled.
virtual void onTimeout()=0
Called when the timer expires (or soon after).
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket events...
Timer(T &t, method_type m, ExceptionHandler &)
Constructor.
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.
TimerBase(ExceptionHandler &)
Constructor.
bool expired(G::EpochTime &) const
Used by TimerList.
An interface used by GNet::TimerList to keep track of pending timeouts and to deliver timeout events...
bool immediate() const
Used by TimerList.
A timer class template in which the timeout is delivered to the specified method. ...