#include <TimerCountdown.h>
Public Member Functions | |
TimerCountdown (TimeVal *wait_time_) | |
Constructor. | |
~TimerCountdown () | |
Destructor. | |
Private Attributes | |
TimeVal * | m_maxWaitTime |
Maximum time to wait. | |
TimeVal | m_start |
Time when countdown started. |
Definition at line 28 of file TimerCountdown.h.
ASSA::TimerCountdown::TimerCountdown | ( | TimeVal * | wait_time_ | ) | [inline] |
Constructor.
Definition at line 53 of file TimerCountdown.h.
00054 : m_maxWaitTime (wt_), m_start (TimeVal::gettimeofday ()) 00055 { 00056 }
ASSA::TimerCountdown::~TimerCountdown | ( | ) | [inline] |
Destructor.
Definition at line 60 of file TimerCountdown.h.
References ASSA::TimeVal::gettimeofday(), m_maxWaitTime, m_start, and ASSA::TimeVal::zeroTime().
00061 { 00062 if (m_maxWaitTime == NULL) 00063 return; 00064 00065 TimeVal elapsed (TimeVal::gettimeofday ()); 00066 elapsed -= m_start; 00067 00068 if ( *m_maxWaitTime > elapsed ) 00069 *m_maxWaitTime -= elapsed; 00070 else 00071 *m_maxWaitTime = TimeVal::zeroTime (); 00072 }
TimeVal* ASSA::TimerCountdown::m_maxWaitTime [private] |
Maximum time to wait.
Definition at line 41 of file TimerCountdown.h.
Referenced by ~TimerCountdown().
TimeVal ASSA::TimerCountdown::m_start [private] |
Time when countdown started.
Definition at line 44 of file TimerCountdown.h.
Referenced by ~TimerCountdown().