libassa  3.5.1
Public Member Functions | Private Attributes | List of all members
ASSA::TimerCountdown Class Reference

#include <TimerCountdown.h>

Public Member Functions

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

Private Attributes

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

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.

55 {
56 }
static TimeVal gettimeofday()
Shields off underlying OS differences in getting current time.
Definition: TimeVal.cpp:44
TimeVal m_start
Time when countdown started.
TimeVal * m_maxWaitTime
Maximum time to wait.

◆ ~TimerCountdown()

ASSA::TimerCountdown::~TimerCountdown ( )
inline

Destructor.

Definition at line 59 of file TimerCountdown.h.

61 {
62  if (m_maxWaitTime == NULL)
63  return;
64 
65  TimeVal elapsed (TimeVal::gettimeofday ());
66  elapsed -= m_start;
67 
68  if ( *m_maxWaitTime > elapsed )
69  *m_maxWaitTime -= elapsed;
70  else
72 }
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().

◆ m_start

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: