My Project
|
#include <Timer.h>
Public Member Functions | |
Timer (EPoll &ePoll) | |
Timer (EPoll &ePoll, double delay) | |
void | setTimer (double delay) |
void | clearTimer () |
double | getElapsed () |
double | getEpoch () |
Protected Member Functions | |
virtual void | onTimeout ()=0 |
Set and trigger callback upon specified timeout.
The Timer is used to establish a timer using the timer socket interface. It cannot be instantiated directly but must be extended.
void core::Timer::clearTimer | ( | ) |
Use the clearTimer() to unset the timer and return the timer to an idle state.
double core::Timer::getElapsed | ( | ) |
Use the getElapsed() method to obtain the amount of time that has elapsed since the timer was set.
|
protectedpure virtual |
This method is called when the time out occurs.
void core::Timer::setTimer | ( | double | delay | ) |
Use the setTimer() method to set the time out value for timer. Setting the timer also starts the timer countdown. The clearTimer() method can be used to reset the timer without triggering the onTimeout() callback.
delay | the amount of time in seconds to wait before trigering the onTimeout function. |