VR-Link API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Attributes | Protected Attributes

Used to set and maintain time in a simulation. More...

+ Collaboration diagram for DtClock:

Public Member Functions

 DtClock ()
 constructor calls init() More...
 
 DtClock (const DtClock &orig)
 copy constructor More...
 
DtClockoperator= (const DtClock &orig)
 assignment operator More...
 
virtual ~DtClock ()
 destructor More...
 
virtual void init ()
 Initialize all VR-Link time object functionality. More...
 
virtual DtTime simTime () const
 Get the current value of VR-Link's simulation time. More...
 
virtual void setSimTime (DtTime NewSimTime)
 Set the current value of VR-Link simulation time. More...
 
virtual bool isSimTimeSet () const
 Returns false if DtSetSimTime was never called and prints out warning message. More...
 
virtual DtTime elapsedRealTime () const
 Return real seconds elapsed since DtTimeInit was called. More...
 
virtual DtTime approximateElapsedRealTime () const
 Returns the value of getElapsedRealTime at the time that setSimTime was last invoked. More...
 
virtual bool useSimTimeForApproxRealTime () const
 Check whether myUseSimTimeForApproxRealTime is set. More...
 
virtual void setUseSimTimeForApproxRealTime ()
 Set/Clear whether simTime should be used to approximate the real time for the method approximateElapsedRealTime(). More...
 
virtual void clearUseSimTimeForApproxRealTime ()
 
virtual DtTime absRealTime () const
 Return current wall-clock time - seconds since Jan 1, 1970. More...
 
void setUsePerfCounter (bool val)
 In windows this enables the high performance counter which allows for better than millisecond counts but is more processor intensive. More...
 
bool usePerfCounter () const
 

Static Public Attributes

static const double hour2sec
 Clock constants used for time conversions. More...
 
static const double sec2hour
 

Protected Attributes

DtTime myInitialTime
 Save starting time to subtract from current to get elapsed. More...
 
DtTime mySimTime
 This is the internal vr-link simulation clock. More...
 
DtTime myApproxElapsedRealTime
 This is the Elapsed Real Time at the point that SetSimTime() is called. More...
 
bool mySimTimeSet
 
bool myUseSimTimeForApproxRealTime
 Flag to change meaning of approximate real time. More...
 
bool myUsePerfCounter
 
bool myInitializedTime
 

Detailed Description

Used to set and maintain time in a simulation.

Examples

Constructor & Destructor Documentation

DtClock::DtClock ( )

constructor calls init()

DtClock::DtClock ( const DtClock orig)

copy constructor

virtual DtClock::~DtClock ( )
virtual

destructor

Member Function Documentation

virtual DtTime DtClock::absRealTime ( ) const
virtual

Return current wall-clock time - seconds since Jan 1, 1970.

virtual DtTime DtClock::approximateElapsedRealTime ( ) const
virtual

Returns the value of getElapsedRealTime at the time that setSimTime was last invoked.

virtual void DtClock::clearUseSimTimeForApproxRealTime ( )
virtual
virtual DtTime DtClock::elapsedRealTime ( ) const
virtual

Return real seconds elapsed since DtTimeInit was called.

virtual void DtClock::init ( )
virtual

Initialize all VR-Link time object functionality.

This must be called before any other time-related functions.

virtual bool DtClock::isSimTimeSet ( ) const
virtual

Returns false if DtSetSimTime was never called and prints out warning message.

DtClock& DtClock::operator= ( const DtClock orig)

assignment operator

virtual void DtClock::setSimTime ( DtTime  NewSimTime)
virtual

Set the current value of VR-Link simulation time.

Should be called once per simulation frame to let VR-Link know the value of simulation time for the frame.

void DtClock::setUsePerfCounter ( bool  val)
inline

In windows this enables the high performance counter which allows for better than millisecond counts but is more processor intensive.

In Linux, this value does nothing.

virtual void DtClock::setUseSimTimeForApproxRealTime ( )
virtual

Set/Clear whether simTime should be used to approximate the real time for the method approximateElapsedRealTime().

virtual DtTime DtClock::simTime ( ) const
virtual

Get the current value of VR-Link's simulation time.

bool DtClock::usePerfCounter ( ) const
inline
virtual bool DtClock::useSimTimeForApproxRealTime ( ) const
virtual

Check whether myUseSimTimeForApproxRealTime is set.

Member Data Documentation

const double DtClock::hour2sec
static

Clock constants used for time conversions.

DtTime DtClock::myApproxElapsedRealTime
protected

This is the Elapsed Real Time at the point that SetSimTime() is called.

It is good enough for timeouts, and is a LOT cheaper than getting the exact real time, which is overkill.

bool DtClock::myInitializedTime
protected
DtTime DtClock::myInitialTime
protected

Save starting time to subtract from current to get elapsed.

DtTime DtClock::mySimTime
protected

This is the internal vr-link simulation clock.

bool DtClock::mySimTimeSet
protected
bool DtClock::myUsePerfCounter
protected
bool DtClock::myUseSimTimeForApproxRealTime
protected

Flag to change meaning of approximate real time.

const double DtClock::sec2hour
static

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

Document ID: Generated on Wed Mar 27 02:04:30 EDT 2024 from SVN revision 264570
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)