Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlTimeStamp.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: The OpenIGTLink Library
4  Language: C++
5  Web page: http://openigtlink.org/
6 
7  Copyright (c) Insight Software Consortium. All rights reserved.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 =========================================================================*/
14 
15 #ifndef __igtlTimeStamp_h
16 #define __igtlTimeStamp_h
17 
18 #include "igtlMacro.h"
19 #include "igtlObject.h"
20 #include "igtlObjectFactory.h"
21 #include "igtlTypes.h"
22 
23 #if defined(WIN32) || defined(_WIN32)
24 #include <ctime>
25 #endif
26 
27 namespace igtl
28 {
29 
31 {
32 public:
33  typedef TimeStamp Self;
34  typedef Object Superclass;
37 
39  igtlNewMacro(Self);
40 
42  igtlGetConstMacro(Frequency, igtlUint32);
43 
45  igtlGetConstMacro(Second, igtlUint32);
46 
48  igtlGetConstMacro(Nanosecond, igtlUint32);
49 
51  void GetTime();
52 
54  void SetTime(double tm);
55 
57  void SetTime(igtlUint32 second, igtlUint32 nanosecond);
58 
60  void SetTime(igtlUint64 tm);
61 
64  void SetTimeInNanoseconds(igtlUint64 tm);
65 
67  double GetTimeStamp();
68 
70  void GetTimeStamp(igtlUint32* second, igtlUint32* nanosecond);
71 
73  igtlUint64 GetTimeStampUint64();
74 
77  igtlUint64 GetTimeStampInNanoseconds() const;
78 
79 protected:
80 
82  TimeStamp();
83 
85  virtual ~TimeStamp();
86 
88  virtual void PrintSelf( std::ostream& os) const;
89 
90 private:
91 
93  igtlInt32 m_Frequency;
94 
96  igtlInt32 m_Second;
97 
99  igtlInt32 m_Nanosecond;
100 
101 
102 #if defined(WIN32) || defined(_WIN32)
103  //typedef double TimeStampType;
104  //typedef double FrequencyType;
105  //
106  //FrequencyType m_WinFrequency;
107  //TimeStampType m_WinDifference;
108  //TimeStampType m_WinOrigin;
109 
110  time_t m_WinTimeOrigin;
111  clock_t m_WinClockOrigin;
112 
113 #endif
114 
115 };
116 
117 } // end of namespace igtl
118 
119 #endif // __igtlTimeStamp_h
120 
121 
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
#define IGTLCommon_EXPORT
TimeStamp Self
Definition: igtlTimeStamp.h:33
SmartPointer< const Self > ConstPointer
Definition: igtlTimeStamp.h:36
SmartPointer< Self > Pointer
Definition: igtlTimeStamp.h:35
#define igtlNewMacro(x)
Definition: igtlMacro.h:431
Base class for most igtl classes.
Definition: igtlObject.h:60
#define igtlGetConstMacro(name, type)
Definition: igtlMacro.h:233

Generated at Mon Dec 23 2019 00:49:24 for OpenIGTLink by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2012