A timer class template in which the timeout is delivered to the specified method. More...
#include <gtimer.h>
Public Types | |
typedef void(T::* | method_type )() |
Public Member Functions | |
Timer (T &t, method_type m, EventHandler &exception_handler) | |
Constructor. More... | |
Public Member Functions inherited from GNet::AbstractTimer | |
virtual | ~AbstractTimer () |
Destructor. More... | |
void | startTimer (unsigned int time) |
Starts the timer. More... | |
void | cancelTimer () |
Cancels the timer. More... | |
Protected Member Functions | |
virtual void | onTimeout () |
Final override from GNet::AbstractTimer. More... | |
virtual void | onTimeoutException (std::exception &) |
Final override from GNet::AbstractTimer. More... | |
Protected Member Functions inherited from GNet::AbstractTimer | |
AbstractTimer () | |
Default constructor. More... | |
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:
typedef void(T::* GNet::Timer< T >::method_type)() |
GNet::Timer< T >::Timer | ( | T & | t, |
method_type | m, | ||
EventHandler & | exception_handler | ||
) |
Constructor.
The EventHandler reference is required in case the timeout handler throws.
|
protectedvirtual |
Final override from GNet::AbstractTimer.
Implements GNet::AbstractTimer.
|
protectedvirtual |
Final override from GNet::AbstractTimer.
Implements GNet::AbstractTimer.