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
27namespace igtl
28{
29
31{
32public:
33 typedef TimeStamp Self;
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
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
79protected:
80
83
85 virtual ~TimeStamp();
86
88 virtual void PrintSelf( std::ostream& os) const;
89
90private:
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
Base class for most igtl classes.
Definition igtlObject.h:61
igtlTypeMacro(TimeStamp, Object)
virtual ~TimeStamp()
igtlUint64 GetTimeStampInNanoseconds() const
void GetTime()
Gets the current time from the system's clock and save it as a time stamp.
void GetTimeStamp(igtlUint32 *second, igtlUint32 *nanosecond)
Gets the time stamp. The second and nanosecond parts are stored in 'second' and 'nanosecond'.
double GetTimeStamp()
Gets the time stamp. Returns a double floating-point value.
igtlGetConstMacro(Second, igtlUint32)
Gets the second part of the time stamp.
igtlGetConstMacro(Frequency, igtlUint32)
Gets the frequency of a clock.
virtual void PrintSelf(std::ostream &os) const
igtlGetConstMacro(Nanosecond, igtlUint32)
Gets the fraction of second part of the time stamp.
void SetTime(igtlUint64 tm)
Sets the time by using 64-bit fixed-point expression used in OpenIGTLink.
void SetTime(igtlUint32 second, igtlUint32 nanosecond)
Sets the time by second and nanosecond.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
void SetTimeInNanoseconds(igtlUint64 tm)
void SetTime(double tm)
Sets the time by double floating-point value.
igtlUint64 GetTimeStampUint64()
Gets the time stamp. Returns a 64-bit fixed-point expression used in OpenIGTLink.
#define IGTLCommon_EXPORT
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...

Generated for OpenIGTLink by Doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2012