Loading...
Searching...
No Matches
ASSA::TimerCountdown Class Reference

`#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.

## Detailed Description

Definition at line 28 of file TimerCountdown.h.

## Constructor & Destructor Documentation

## TimerCountdown()

ASSA::TimerCountdown::TimerCountdown | ( | TimeVal * | wait_time_ | ) |

inline

Constructor.

Definition at line 52 of file TimerCountdown.h.

: m_maxWaitTime (wt_), m_start (TimeVal::gettimeofday ())
{
}
ASSA::TimeVal::gettimeofday
static TimeVal gettimeofday()
Shields off underlying OS differences in getting current time.
Definition TimeVal.cpp:44
ASSA::TimerCountdown::m_start
TimeVal m_start
Time when countdown started.
Definition TimerCountdown.h:44
ASSA::TimerCountdown::m_maxWaitTime
TimeVal * m_maxWaitTime
Maximum time to wait.
Definition TimerCountdown.h:41

References m_maxWaitTime, and m_start.

## ~TimerCountdown()

ASSA::TimerCountdown::~TimerCountdown | ( |  | ) |

inline

Destructor.

Definition at line 59 of file TimerCountdown.h.

{
if (m_maxWaitTime == NULL)
return;
TimeVal elapsed (TimeVal::gettimeofday ());
elapsed -= m_start;
if ( *m_maxWaitTime > elapsed )
*m_maxWaitTime -= elapsed;
else
*m_maxWaitTime = TimeVal::zeroTime ();
}
ASSA::TimeVal::zeroTime
static TimeVal zeroTime()
Static that returns zero timeval: {0,0}.
Definition TimeVal.h:157

References ASSA::TimeVal::gettimeofday(), m_maxWaitTime, m_start, and ASSA::TimeVal::zeroTime().

## Member Data Documentation

## m_maxWaitTime

TimeVal* ASSA::TimerCountdown::m_maxWaitTime

private

Maximum time to wait.

Definition at line 41 of file TimerCountdown.h.

Referenced by TimerCountdown(), and ~TimerCountdown().

## m_start

TimeVal ASSA::TimerCountdown::m_start

private

Time when countdown started.

Definition at line 44 of file TimerCountdown.h.

Referenced by TimerCountdown(), and ~TimerCountdown().

The documentation for this class was generated from the following file:

- TimerCountdown.h