Medical Imaging Interaction Toolkit  2018.4.99-ef453c4b
Medical Imaging Interaction Toolkit
mitkIGTTimeStamp.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef MITKTIMESTAMP_H_HEADER_INCLUDED_
15 #define MITKTIMESTAMP_H_HEADER_INCLUDED_
16 
17 #include <itkObject.h>
18 #include <itkObjectFactory.h>
19 #include <MitkIGTExports.h>
20 
21 #include "mitkRealTimeClock.h"
22 
23 
24 namespace mitk {
25 
48  class MITKIGT_EXPORT IGTTimeStamp : public itk::Object
49  {
50  public:
51 
53 
62  static IGTTimeStamp* CreateInstance();
63 
70  static IGTTimeStamp* GetInstance();
71 
83  void Start( itk::Object::Pointer device );
84 
93  void Stop( itk::Object::Pointer device );
94 
104  double GetElapsed();
105 
114  double GetElapsed(itk::Object::Pointer device);
115 
116 
132  double GetOffset(itk::Object::Pointer Device);
133 
147  void SetRealTimeClock(mitk::RealTimeClock::Pointer Clock);
148 
157  void Initialize();
158 
159  protected:
160 
161  IGTTimeStamp();
162 
163  ~IGTTimeStamp() override;
164 
165  double GetCurrentStamp();
166 
167  /* the current timestamp when GetCurrentStamp() is called. */
168  double m_Time;
169 
170  /* the timestamp in ms acquired when Start() was called. */
172 
173  /* pointer to the RealTimeClock used internally */
174  mitk::RealTimeClock::Pointer m_RealTimeClock;
175 
176  /* pointer to the current instance */
177  static mitk::IGTTimeStamp::Pointer s_Instance;
178 
179  /* map, in which pointer to all devices calling Start(), are saved */
180  std::map<itk::Object::Pointer, double> m_DeviceMap;
181 
182  std::map<itk::Object::Pointer, double>::iterator m_MapIterator;
183  };
184 } // namespace mitk
185 
186 #endif /* MITKTIMESTAMP_H_HEADER_INCLUDED_ */
mitk::RealTimeClock::Pointer m_RealTimeClock
DataCollection - Class to facilitate loading/accessing structured data.
Time stamp in milliseconds.
std::map< itk::Object::Pointer, double >::iterator m_MapIterator
static mitk::IGTTimeStamp::Pointer s_Instance
#define MITKIGT_EXPORT
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
std::map< itk::Object::Pointer, double > m_DeviceMap