VR-Link API Documentation for DIS
oldTStamp.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *********************************************************************/
00005 
00006 
00007 #ifndef oldTStamp_H_
00008 #define oldTStamp_H_
00009 
00010 #include <vlutil/vlTime.h>
00011 
00018 #define DtRELATIVE 0
00019 #define DtABSOLUTE 1
00020 
00021 const double DtHourFracPerHour = 2147483648.0;      /* (1L<<31) */
00022 const double DtHourPerHourFrac = 1.0/2147483648.0;  /* but SPARCcompiler 
00023                        * chokes on that */
00024 DT_DLL_VLPROTIND DtU32 DtTimeStampNow(int relOrAbs = DtRELATIVE);
00025 DT_DLL_VLPROTIND DtU32 DtMakeTimeStamp(DtTime time, int relativeOrAbs = DtRELATIVE);
00026 
00027 inline int DtAbsoluteHourFrac(DtU32 hourFrac) { return ((int)(hourFrac & 1)); }
00028 inline DtU32 DtSetAbsoluteHourFrac(DtU32 hourFrac) { return hourFrac | 1; }
00029 
00030 inline double DtHourFrac2Hour(DtU32 hourFrac) 
00031 { return (hourFrac >> 1) * DtHourPerHourFrac; }
00032 
00033 inline double DtHourFrac2Sec(DtU32 hourFrac) 
00034 { return DtHourFrac2Hour(hourFrac) * DtHour2Sec; }
00035 
00036 inline DtU32 DtHour2HourFrac(double hour) 
00037 { return (DtU32)(hour * DtHourFracPerHour) << 1; }
00038 
00039 inline DtU32 DtSec2HourFrac(double sec) 
00040 { return DtHour2HourFrac(sec * DtSec2Hour); }
00041 
00042 #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)