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: Open IGT Link Library
4  Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlTimeStamp.h $
5  Language: C++
6  Date: $Date: 2011-03-24 00:08:23 -0400 (Thu, 24 Mar 2011) $
7  Version: $Revision: 7354 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notices for more information.
14 
15 =========================================================================*/
16 
17 #ifndef __igtlTimeStamp_h
18 #define __igtlTimeStamp_h
19 
20 #include "igtlMacro.h"
21 #include "igtlObject.h"
22 #include "igtlObjectFactory.h"
23 #include "igtlTypes.h"
24 
25 #if defined(WIN32) || defined(_WIN32)
26 #include <ctime>
27 #endif
28 
29 namespace igtl
30 {
31 
33 {
34 public:
35  typedef TimeStamp Self;
36  typedef Object Superclass;
39 
42 
44  igtlGetConstMacro(Frequency, igtlUint32);
45  igtlGetConstMacro(Second, igtlUint32);
46  igtlGetConstMacro(Nanosecond, igtlUint32);
48 
49  void GetTime();
50  void SetTime(double tm);
51  void SetTime(igtlUint32 second, igtlUint32 nanosecond);
52  void SetTime(igtlUint64 tm); /* 64-bit fixed-point expression used in OpenIGTLink */
53 
54  double GetTimeStamp();
55  void GetTimeStamp(igtlUint32* second, igtlUint32* nanosecond);
56  igtlUint64 GetTimeStampUint64(); /* 64-bit fixed-point expression used in OpenIGTLink */
57 
58 
59 protected:
60 
62  TimeStamp();
63 
65  virtual ~TimeStamp();
66 
68  virtual void PrintSelf( std::ostream& os) const;
69 
70 private:
71 
72  igtlInt32 m_Frequency; /* Clock frequency (Hz)*/
73  igtlInt32 m_Second; /* Second part of the time relative to 00:00:00 January 1, 1970 UTC */
74  igtlInt32 m_Nanosecond; /* Nano-second part of -- */
75 
76 
77 #if defined(WIN32) || defined(_WIN32)
78  //typedef double TimeStampType;
79  //typedef double FrequencyType;
80  //
81  //FrequencyType m_WinFrequency;
82  //TimeStampType m_WinDifference;
83  //TimeStampType m_WinOrigin;
84 
85  time_t m_WinTimeOrigin;
86  clock_t m_WinClockOrigin;
87 
88 #endif
89 
90 };
91 
92 } // end of namespace igtl
93 
94 #endif // __igtlTimeStamp_h
95 
96 
97 

Generated at Thu Mar 20 2014 16:32:06 for OpenIGTLink by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2000