Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 
18 #ifndef MITKTIMESTAMP_H_HEADER_INCLUDED_
19 #define MITKTIMESTAMP_H_HEADER_INCLUDED_
20 
21 #include <itkObject.h>
22 #include <itkObjectFactory.h>
23 #include <MitkIGTExports.h>
24 
25 #include "mitkRealTimeClock.h"
26 
27 
28 namespace mitk {
29 
52  class MITKIGT_EXPORT IGTTimeStamp : public itk::Object
53  {
54  public:
55 
57 
66  static IGTTimeStamp* CreateInstance();
67 
74  static IGTTimeStamp* GetInstance();
75 
87  void Start( itk::Object::Pointer device );
88 
97  void Stop( itk::Object::Pointer device );
98 
108  double GetElapsed();
109 
118  double GetElapsed(itk::Object::Pointer device);
119 
120 
136  double GetOffset(itk::Object::Pointer Device);
137 
151  void SetRealTimeClock(mitk::RealTimeClock::Pointer Clock);
152 
161  void Initialize();
162 
163  protected:
164 
165  IGTTimeStamp();
166 
167  virtual ~IGTTimeStamp();
168 
169  double GetCurrentStamp();
170 
171  /* the current timestamp when GetCurrentStamp() is called. */
172  double m_Time;
173 
174  /* the timestamp in ms acquired when Start() was called. */
176 
177  /* pointer to the RealTimeClock used internally */
179 
180  /* pointer to the current instance */
182 
183  /* map, in which pointer to all devices calling Start(), are saved */
184  std::map<itk::Object::Pointer, double> m_DeviceMap;
185 
186  std::map<itk::Object::Pointer, double>::iterator m_MapIterator;
187  };
188 } // namespace mitk
189 
190 #endif /* MITKTIMESTAMP_H_HEADER_INCLUDED_ */
itk::SmartPointer< Self > Pointer
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 mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
std::map< itk::Object::Pointer, double > m_DeviceMap