ASSA::TimerCountdown Class Reference

#include <TimerCountdown.h>

Collaboration diagram for ASSA::TimerCountdown:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TimerCountdown (TimeVal *wait_time_)
 Constructor.
 ~TimerCountdown ()
 Destructor.

Private Attributes

TimeValm_maxWaitTime
 Maximum time to wait.
TimeVal m_start
 Time when countdown started.

Detailed Description

Definition at line 28 of file TimerCountdown.h.


Constructor & Destructor Documentation

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 }


Member Data Documentation

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().


The documentation for this class was generated from the following file:
Generated on Sun Aug 13 15:08:22 2006 for libassa by  doxygen 1.4.6