|
E-MailRelay
|
A timer class template in which the timeout is delivered to the specified method. More...
#include <gtimer.h>
Inheritance diagram for GNet::Timer< T >:Public Types | |
| typedef void(T::* | method_type) () |
Public Member Functions | |
| Timer (T &t, method_type m, ExceptionHandler &) | |
| Constructor. More... | |
Public Member Functions inherited from GNet::TimerBase | |
| virtual | ~TimerBase () |
| Destructor. | |
| void | startTimer (unsigned int interval_s, unsigned int interval_us=0U) |
| Starts the timer so that it goes off after the given time interval. More... | |
| void | startTimer (const G::EpochTime &interval_time) |
| Overload for an interval expressed as an G::EpochTime. | |
| void | cancelTimer () |
| Cancels the timer. | |
| bool | active () const |
| Returns true if the timer is started and not cancelled. | |
| bool | immediate () const |
| Used by TimerList. More... | |
| void | doTimeout () |
| Used by TimerList to execute the onTimeout() callback. | |
| G::EpochTime | t () const |
| Used by TimerList to get the expiry epoch time. | |
| bool | expired (G::EpochTime &) const |
| Used by TimerList. More... | |
Protected Member Functions | |
| virtual void | onTimeout () override |
| Override from GNet::TimerBase. | |
Protected Member Functions inherited from GNet::TimerBase | |
| TimerBase (ExceptionHandler &) | |
| Constructor. | |
A timer class template in which the timeout is delivered to the specified method.
Any exception thrown out of the timeout handler is delivered to the specified EventHandler interface so that it can be handled or rethrown.
Eg:
| GNet::Timer< T >::Timer | ( | T & | t, |
| method_type | m, | ||
| ExceptionHandler & | e | ||
| ) |
Constructor.
The ExceptionHandler reference is used when the timeout handler throws; the onException() implementation can simply rethrow to exit the event loop.
1.8.9.1