25 , m_Time(-1.0), m_ReferenceTime(0.0)
52 if (m_RealTimeClock.IsNull())
56 if ( s_Instance.IsNotNull() )
58 if (m_DeviceMap.empty())
60 m_ReferenceTime = GetCurrentStamp();
63 m_DeviceMap.insert( std::pair<itk::Object::Pointer, double>(device, this->GetElapsed()) );
67 itkGenericOutputMacro(
"Trying to use mitk::TimeStamp::Start() "
68 <<
"without an available singleton instance. Either no instance has "
69 <<
"been created (use TimeStamp::CreateInstance) or it has already "
70 <<
"been destroyed.");
76 if ( s_Instance.IsNotNull() )
78 m_MapIterator = m_DeviceMap.find(device);
79 if ( m_MapIterator != m_DeviceMap.end() )
81 m_DeviceMap.erase( m_MapIterator );
84 if (m_DeviceMap.empty())
92 itkGenericOutputMacro(
"Trying to use mitk::TimeStamp::Stop() "
93 <<
"without an available singleton instance. Either no instance has "
94 <<
"been created (use TimeStamp::CreateInstance) or it has already "
95 <<
"been destroyed.");
104 m_Time = GetCurrentStamp();
105 m_Time = m_Time - m_ReferenceTime;
107 return (
double) m_Time;
113 double offset = this->GetOffset( device );
116 double time = this->GetElapsed();
117 return (
double) time - this->GetOffset(device);
127 if (m_RealTimeClock.IsNotNull())
129 return m_RealTimeClock->GetCurrentStamp();
136 m_RealTimeClock = Clock;
141 m_MapIterator = m_DeviceMap.find(Device);
142 if ( m_MapIterator != m_DeviceMap.end() )
144 return m_MapIterator->second;
154 if ( m_RealTimeClock.IsNull() )
itk::SmartPointer< Self > Pointer
double GetElapsed()
returns the time elapsed since calling Start() for the first time in milliseconds ...
void SetRealTimeClock(mitk::RealTimeClock::Pointer Clock)
setter for the internally used RealTimeClock()
Time stamp in milliseconds.
static mitk::IGTTimeStamp::Pointer s_Instance
double GetOffset(itk::Object::Pointer Device)
returns the offset of this device's starting-time to the reference-time in ms
static IGTTimeStamp * CreateInstance()
creates a new instance of mitkTimeStamp
static IGTTimeStamp * GetInstance()
returns a pointer to the current instance of mitkTimeStamp
void Start(itk::Object::Pointer device)
starts the time-acquisition
void Initialize()
creates a new RealTimeClock
void Stop(itk::Object::Pointer device)
stops the time-acqusition
static Pointer New(void)
instanciates a new, operating-system dependant, instance of mitk::RealTimeClock.