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 
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 
63  double GetTimeStamp();
64 
66  void GetTimeStamp(igtlUint32* second, igtlUint32* nanosecond);
67 
69  igtlUint64 GetTimeStampUint64();
70 
71 
72 protected:
73 
75  TimeStamp();
76 
78  virtual ~TimeStamp();
79 
81  virtual void PrintSelf( std::ostream& os) const;
82 
83 private:
84 
86  igtlInt32 m_Frequency;
87 
89  igtlInt32 m_Second;
90 
92  igtlInt32 m_Nanosecond;
93 
94 
95 #if defined(WIN32) || defined(_WIN32)
96  //typedef double TimeStampType;
97  //typedef double FrequencyType;
98  //
99  //FrequencyType m_WinFrequency;
100  //TimeStampType m_WinDifference;
101  //TimeStampType m_WinOrigin;
102 
103  time_t m_WinTimeOrigin;
104  clock_t m_WinClockOrigin;
105 
106 #endif
107 
108 };
109 
110 } // end of namespace igtl
111 
112 #endif // __igtlTimeStamp_h
113 
114 
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
#define IGTLCommon_EXPORT
TimeStamp Self
Definition: igtlTimeStamp.h:33
SmartPointer< const Self > ConstPointer
Definition: igtlTimeStamp.h:36
Light weight base class for most igtl classes.
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 Nov 11 2013 05:19:49 for OpenIGTLink by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2012