libassa 3.5.0
Public Member Functions | Private Attributes
ASSA::TimerCountdown Class Reference

#include <TimerCountdown.h>

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.

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

{
    if (m_maxWaitTime == NULL)
        return; 

    TimeVal elapsed (TimeVal::gettimeofday ());
    elapsed -= m_start;

    if ( *m_maxWaitTime > elapsed )
        *m_maxWaitTime -= elapsed;
    else
        *m_maxWaitTime = TimeVal::zeroTime ();
}

Member Data Documentation

Maximum time to wait.

Definition at line 41 of file TimerCountdown.h.

Referenced by ~TimerCountdown().

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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines