VR-Link API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vlTime.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1992-2010 MAK Technologies, Inc
3 ** All rights reserved.
4 *******************************************************************************/
5 #pragma once
6 
10 #include "vlMachineTypes.h"
11 
12 #ifdef DtUSE_UTILITIES_NAMESPACE
13 namespace DtUSE_UTILITIES_NAMESPACE
14 {
15 #endif
16 
17 
19 typedef DtReal DtTime;
20 
26 {
27 public:
28 
31  DtClock();
32 
34  DtClock(const DtClock &orig);
35 
37  DtClock & operator=(const DtClock &orig);
38 
40  virtual ~DtClock();
41 
44  virtual void init();
45 
47  virtual DtTime simTime() const;
48 
52  virtual void setSimTime(DtTime NewSimTime);
53 
56  virtual bool isSimTimeSet() const;
57 
59  virtual DtTime elapsedRealTime() const;
60 
63  virtual DtTime approximateElapsedRealTime() const;
64 
66  virtual bool useSimTimeForApproxRealTime() const;
67 
70  virtual void setUseSimTimeForApproxRealTime();
71  virtual void clearUseSimTimeForApproxRealTime();
72 
74  virtual DtTime absRealTime() const;
75 
79  inline void setUsePerfCounter(bool val) { myUsePerfCounter = val; }
80  inline bool usePerfCounter() const { return myUsePerfCounter; }
81 
82 public:
83 
85  static const double hour2sec;
86  static const double sec2hour;
87 
88 protected:
89 
92 
95 
100 
102 
105 
108 #ifdef _WIN32
109  double myCounterAtInitialTime;
110  double myCounterFreq;
111 #endif
112 };
113 
119 
120 
121 #define DtHour2Sec DtClock::hour2sec
122 #define DtSec2Hour DtClock::sec2hour
123 
124 
127 DT_DLL_VLUTIL void DtSetSimTime(DtTime NewSimTime);
131 
136 
137 #ifdef DtUSE_UTILITIES_NAMESPACE
138 }
139 #endif
bool myUsePerfCounter
Definition: vlTime.h:106
bool myUseSimTimeForApproxRealTime
Flag to change meaning of approximate real time.
Definition: vlTime.h:104
DtTime myInitialTime
Save starting time to subtract from current to get elapsed.
Definition: vlTime.h:91
void DtSetSimTime(DtTime NewSimTime)
Used to set and maintain time in a simulation.
Definition: vlTime.h:25
static const double hour2sec
Clock constants used for time conversions.
Definition: vlTime.h:85
DtTime DtAbsRealTime()
DtAbsRealTime() may not be as accurate as creating a persistent instance of a DtClock and getting the...
DtTime DtGetElapsedRealTime()
void setUsePerfCounter(bool val)
In windows this enables the high performance counter which allows for better than millisecond counts ...
Definition: vlTime.h:79
bool mySimTimeSet
Definition: vlTime.h:101
bool myInitializedTime
Definition: vlTime.h:107
DtTime mySimTime
This is the internal vr-link simulation clock.
Definition: vlTime.h:94
DtTime DtGetApproximateElapsedRealTime()
void DtIsSimTimeSet()
DtTime myApproxElapsedRealTime
This is the Elapsed Real Time at the point that SetSimTime() is called.
Definition: vlTime.h:99
DtTime DtGetSimTime()
DtReal DtTime
A definition of DtTime.
Definition: vlTime.h:19
static const double sec2hour
Definition: vlTime.h:86
This file contains typedefs for machine dependant types.
#define DT_DLL_VLUTIL
Definition: vlMachineTypes.h:109
bool usePerfCounter() const
Definition: vlTime.h:80
void DtTimeInit()

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)