igtlTimeStamp.h
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 namespace igtl
00026 {
00027
00028 class IGTLCommon_EXPORT TimeStamp : public Object
00029 {
00030 public:
00031 typedef TimeStamp Self;
00032 typedef Object Superclass;
00033 typedef SmartPointer< Self > Pointer;
00034 typedef SmartPointer< const Self > ConstPointer;
00035
00036 igtlTypeMacro(TimeStamp, Object);
00037 igtlNewMacro(Self);
00038
00040 igtlGetConstMacro(Frequency, igtlUint32);
00041 igtlGetConstMacro(Second, igtlUint32);
00042 igtlGetConstMacro(Nanosecond, igtlUint32);
00044
00045 void GetTime();
00046 void SetTime(double tm);
00047 void SetTime(igtlUint32 second, igtlUint32 nanosecond);
00048
00049 double GetTimeStamp();
00050 void GetTimeStamp(igtlUint32* second, igtlUint32* nanosecond);
00051
00052 protected:
00053
00055 TimeStamp();
00056
00058 virtual ~TimeStamp();
00059
00061 virtual void PrintSelf( std::ostream& os) const;
00062
00063 private:
00064
00065 igtlInt32 m_Frequency;
00066 igtlInt32 m_Second;
00067 igtlInt32 m_Nanosecond;
00068
00069
00070 #if defined(WIN32) || defined(_WIN32)
00071 typedef double TimeStampType;
00072 typedef double FrequencyType;
00073
00074 FrequencyType m_WinFrequency;
00075 TimeStampType m_WinDifference;
00076 TimeStampType m_WinOrigin;
00077 #endif
00078
00079 };
00080
00081 }
00082
00083 #endif // __igtlTimeStamp_h
00084
00085
00086