Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __igtlTimeStamp_h
00018 #define __igtlTimeStamp_h
00019
00020 #include "igtlMacro.h"
00021 #include "igtlObject.h"
00022 #include "igtlObjectFactory.h"
00023 #include "igtlTypes.h"
00024
00025 #if defined(WIN32) || defined(_WIN32)
00026 #include <ctime>
00027 #endif
00028
00029 namespace igtl
00030 {
00031
00032 class IGTLCommon_EXPORT TimeStamp : public Object
00033 {
00034 public:
00035 typedef TimeStamp Self;
00036 typedef Object Superclass;
00037 typedef SmartPointer< Self > Pointer;
00038 typedef SmartPointer< const Self > ConstPointer;
00039
00040 igtlTypeMacro(TimeStamp, Object);
00041 igtlNewMacro(Self);
00042
00044 igtlGetConstMacro(Frequency, igtlUint32);
00045 igtlGetConstMacro(Second, igtlUint32);
00046 igtlGetConstMacro(Nanosecond, igtlUint32);
00048
00049 void GetTime();
00050 void SetTime(double tm);
00051 void SetTime(igtlUint32 second, igtlUint32 nanosecond);
00052 void SetTime(igtlUint64 tm);
00053
00054 double GetTimeStamp();
00055 void GetTimeStamp(igtlUint32* second, igtlUint32* nanosecond);
00056 igtlUint64 GetTimeStampUint64();
00057
00058
00059 protected:
00060
00062 TimeStamp();
00063
00065 virtual ~TimeStamp();
00066
00068 virtual void PrintSelf( std::ostream& os) const;
00069
00070 private:
00071
00072 igtlInt32 m_Frequency;
00073 igtlInt32 m_Second;
00074 igtlInt32 m_Nanosecond;
00075
00076
00077 #if defined(WIN32) || defined(_WIN32)
00078
00079
00080
00081
00082
00083
00084
00085 time_t m_WinTimeOrigin;
00086 clock_t m_WinClockOrigin;
00087
00088 #endif
00089
00090 };
00091
00092 }
00093
00094 #endif // __igtlTimeStamp_h
00095
00096
00097