![]() |
Diana Software
|
thread-safe timer class More...
Public Member Functions | |
| QWatchdogTimer () | |
| virtual | ~QWatchdogTimer () |
| QError | SetTimeoutSec (double timeout) |
| QError | TimeoutElapsed (bool &elapsed) const |
| QError | Start () |
| QError | Stop () |
Private Attributes | |
| boost::mutex * | fMutex |
| boost::posix_time::time_duration * | fTimeout |
| boost::posix_time::ptime * | fLastStartTime |
thread-safe timer class
Definition at line 20 of file QWatchdogTimer.hh.
| QWatchdogTimer::QWatchdogTimer | ( | ) |
Definition at line 9 of file QWatchdogTimer.cc.
References fMutex.
|
virtual |
Definition at line 20 of file QWatchdogTimer.cc.
References fLastStartTime, fMutex, and fTimeout.
| QError QWatchdogTimer::SetTimeoutSec | ( | double | timeout | ) |
set the timeout in seconds
Definition at line 31 of file QWatchdogTimer.cc.
References fMutex, fTimeout, and QERR_SUCCESS.
Referenced by QDb::InitWatchdogThread().
| QError QWatchdogTimer::Start | ( | ) |
Start the timer, or reset it if it is already running
Definition at line 65 of file QWatchdogTimer.cc.
References fLastStartTime, fMutex, and QERR_SUCCESS.
Referenced by QDb::UpdateWatchdogTimer().
| QError QWatchdogTimer::Stop | ( | ) |
stop the timer
Definition at line 78 of file QWatchdogTimer.cc.
References fLastStartTime, fMutex, and QERR_SUCCESS.
| QError QWatchdogTimer::TimeoutElapsed | ( | bool & | elapsed | ) | const |
Check whether the timeout elapsed
On success, the value of elapsed tells wehther or not the timeout has elapsed. If the timer is not running, elapsed is set to false.
Definition at line 43 of file QWatchdogTimer.cc.
References fLastStartTime, fMutex, fTimeout, and QERR_SUCCESS.
Referenced by QDbWatchdogThread::operator()().
|
private |
Definition at line 47 of file QWatchdogTimer.hh.
Referenced by Start(), Stop(), TimeoutElapsed(), and ~QWatchdogTimer().
|
mutableprivate |
Definition at line 45 of file QWatchdogTimer.hh.
Referenced by QWatchdogTimer(), SetTimeoutSec(), Start(), Stop(), TimeoutElapsed(), and ~QWatchdogTimer().
|
private |
Definition at line 46 of file QWatchdogTimer.hh.
Referenced by SetTimeoutSec(), TimeoutElapsed(), and ~QWatchdogTimer().