VR-Link API Documentation for HLA 1.3
vlTime.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 #pragma once
00006 
00010 #include "vlMachineTypes.h"
00011 
00012 #ifdef DtUSE_UTILITIES_NAMESPACE
00013 namespace DtUSE_UTILITIES_NAMESPACE
00014 {
00015 #endif
00016 
00017 
00019 typedef DtReal DtTime;
00020 
00025 class DT_DLL_VLUTIL DtClock
00026 {
00027 public:
00028 
00031    DtClock();
00032 
00034    DtClock(const DtClock &orig);
00035 
00037    DtClock & operator=(const DtClock &orig);
00038 
00040    virtual ~DtClock();
00041 
00044    virtual void init();
00045 
00047    virtual DtTime simTime() const;
00048 
00052    virtual void setSimTime(DtTime NewSimTime);
00053 
00056    virtual bool isSimTimeSet() const;
00057 
00059    virtual DtTime elapsedRealTime() const;
00060 
00063    virtual DtTime approximateElapsedRealTime() const;
00064 
00066    virtual bool useSimTimeForApproxRealTime() const;
00067 
00070    virtual void setUseSimTimeForApproxRealTime();
00071    virtual void clearUseSimTimeForApproxRealTime();
00072 
00074    virtual DtTime absRealTime() const; 
00075 
00076 public:
00077 
00079    static const double hour2sec;
00080    static const double sec2hour;
00081 
00082 protected:
00083 
00085    DtTime myInitialTime;
00086 
00088    DtTime mySimTime;
00089 
00093    DtTime myApproxElapsedRealTime;
00094 
00095    bool mySimTimeSet;
00096 
00098    bool myUseSimTimeForApproxRealTime;
00099 
00100 #ifdef _WIN32
00101    int myUsePerfCounter;
00102    double myCounterAtInitialTime;
00103    double myCounterFreq;
00104 #endif
00105 };
00106 
00112 
00113 
00114 #define DtHour2Sec DtClock::hour2sec
00115 #define DtSec2Hour DtClock::sec2hour
00116 
00117 
00118 DT_DLL_VLUTIL void DtTimeInit();
00119 DT_DLL_VLUTIL DtTime DtGetSimTime();
00120 DT_DLL_VLUTIL void DtSetSimTime(DtTime NewSimTime);
00121 DT_DLL_VLUTIL void DtIsSimTimeSet();
00122 DT_DLL_VLUTIL DtTime DtGetElapsedRealTime();
00123 DT_DLL_VLUTIL DtTime DtGetApproximateElapsedRealTime();
00124 
00128 DT_DLL_VLUTIL DtTime DtAbsRealTime();
00129 
00130 #ifdef DtUSE_UTILITIES_NAMESPACE
00131 } 
00132 #endif

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)