Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuHWTimer Class Reference

This class implements a basic hardware clock on systems that have hardware which support a high performance counter. More...

#include <vuHWTimer.h>

Collaboration diagram for vuHWTimer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vuHWTimer ()
 The default constructor.
 vuHWTimer (const vuHWTimer &t)
 The copy constructor.
 ~vuHWTimer ()
 The destructor.
vuHWTimeroperator= (const vuHWTimer &rhs)
 The assignment operator.
bool isSupported (void) const
 Determines whether the system offers a hardware clock.
float getElapsedTimeFloat (void)
 Gets the elapsed time as a float.
double getElapsedTimeDouble (void)
 Gets the elapsed time as a double.
void sleepFloat (float s)
 Halts the program for s seconds.
void sleepDouble (double s)
 Halts the program for s seconds.

Private Attributes

timeval m_LastCount
 The last time the time was checked....
bool m_IsSupported
 true iff a hardware clock is supported

Detailed Description

This class implements a basic hardware clock on systems that have hardware which support a high performance counter.

Author: Steve Kilthau Date: January 4, 2001

Definition at line 19 of file vuHWTimer.h.


Constructor & Destructor Documentation

vuHWTimer::vuHWTimer  ) 
 

The default constructor.

If the system offers a hardware clock, the default constructor sets up the appropriate values.

Definition at line 119 of file vuHWTimer.cpp.

References m_IsSupported.

vuHWTimer::vuHWTimer const vuHWTimer t  ) 
 

The copy constructor.

Definition at line 126 of file vuHWTimer.cpp.

References m_IsSupported, and m_LastCount.

vuHWTimer::~vuHWTimer  ) 
 

The destructor.

Definition at line 133 of file vuHWTimer.cpp.


Member Function Documentation

double vuHWTimer::getElapsedTimeDouble void   ) 
 

Gets the elapsed time as a double.

The elapsed time is the time since the last call to GetElapsedTimeDouble/GetElapsedTimeFloat, or since the return from the last call to SleepFloat/SleepDouble.

Definition at line 166 of file vuHWTimer.cpp.

References m_LastCount, and TIMEVALDIFFDOUBLE.

float vuHWTimer::getElapsedTimeFloat void   ) 
 

Gets the elapsed time as a float.

The elapsed time is the time since the last call to GetElapsedTimeDouble/GetElapsedTimeFloat, or since the return from the last call to SleepFloat/SleepDouble.

Definition at line 153 of file vuHWTimer.cpp.

References m_LastCount, and TIMEVALDIFFFLOAT.

Referenced by vuKeyFramerDialog::OnTakeShot(), vuKeyFramerDialog::PlayInTime(), vuKeyFramerDialog::RecordFunc(), and vuKFThread::run().

bool vuHWTimer::isSupported void   )  const
 

Determines whether the system offers a hardware clock.

Returns:
True if a hardware clock is supported.

Definition at line 148 of file vuHWTimer.cpp.

vuHWTimer & vuHWTimer::operator= const vuHWTimer rhs  ) 
 

The assignment operator.

Definition at line 137 of file vuHWTimer.cpp.

References m_IsSupported, and m_LastCount.

void vuHWTimer::sleepDouble double  s  ) 
 

Halts the program for s seconds.

Causes the program to halt until s seconds have elapsed since the last call to GetElapsedTimeFloat, GetElapsedTimeDouble, SleepFloat, or SleepDouble. Before the function returns, the timer is updated.

Definition at line 198 of file vuHWTimer.cpp.

References m_LastCount, and TIMEVALDIFFDOUBLE.

void vuHWTimer::sleepFloat float  s  ) 
 

Halts the program for s seconds.

Causes the program to halt until s seconds have elapsed since the last call to GetElapsedTimeFloat, GetElapsedTimeDouble, SleepFloat, or SleepDouble. Before the function returns, the timer is updated.

Definition at line 179 of file vuHWTimer.cpp.

References m_LastCount, and TIMEVALDIFFFLOAT.


Member Data Documentation

bool vuHWTimer::m_IsSupported [private]
 

true iff a hardware clock is supported

Definition at line 81 of file vuHWTimer.h.

Referenced by operator=(), and vuHWTimer().

struct timeval vuHWTimer::m_LastCount [private]
 

The last time the time was checked....

Definition at line 79 of file vuHWTimer.h.

Referenced by getElapsedTimeDouble(), getElapsedTimeFloat(), operator=(), sleepDouble(), sleepFloat(), and vuHWTimer().


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:21:16 2004 for vuVolume by  doxygen 1.3.9.1