Public Types | |
typedef void(T::* | PtrToMethod )(void) |
use typedef to avoid complex syntax: this allow to refer to a pointer to a generic method of class T using simply PtrToMethod instead of writing every time void (T::*)(void) | |
Public Member Functions | |
QTimer () | |
default constructor. timeout is set to 0 ms | |
QTimer (unsigned long timeoutMs) | |
constructor with timeout | |
virtual | ~QTimer () |
dtor | |
void | Start () |
start timer | |
void | Stop () |
stop timer | |
void | SetTimeout (unsigned long timeoutMs) |
set timeout | |
void | SetSingleShot (bool singleShot) |
toggle whether the timer should run only once or if it should restarted automatically when it expires | |
void | Connect (PtrToMethod mPtr, T *objPtr) |
connect method of the template class to be executed when timeout expires | |
Private Member Functions | |
void | Callback () |
Static Private Member Functions | |
static void | EventEntryPoint (int fd, short event, void *arg) |
Private Attributes | |
struct timeval | fTimeout |
timeout structure used by libevent | |
struct event | fEvent |
event struct used by libevent | |
PtrToMethod | fMethPtr |
pointer to member function to be called when timeout expires | |
T * | fClassPtr |
pointer to object on which callback method will be executed on | |
bool | fSingleShot |
bool | fEventIsSet |
since evtimer_del() crashes when called on an event that has never been set, this variable is used to determine wether event_del() should be called or not |
constructor with timeout
timeoutMs | timeout in ms |
References QTimer< T >::fEventIsSet, QTimerDispatcher::GetInstance(), and QTimer< T >::SetTimeout().
void QTimer< T >::SetTimeout | ( | unsigned long | timeoutMs | ) | [inline] |
set timeout
timeoutMs | timeout in ms |
References QTimer< T >::fTimeout.
Referenced by QPulserGroup::AddChannel(), QPulserController::Init(), QGuiPulserController::Init(), QTimer< T >::QTimer(), and QPulserGroup::SetDelay().
void QTimer< T >::Connect | ( | PtrToMethod | mPtr, | |
T * | objPtr | |||
) | [inline] |
connect method of the template class to be executed when timeout expires
PtrToMethod | pointer to method to be executed | |
objPtr | pointer to the instance of the object the method will be called on |
References QTimer< T >::fClassPtr, and QTimer< T >::fMethPtr.
Referenced by QBasePulserController::ConnectDelayTimers(), QPulserController::Init(), and QGuiPulserController::Init().