ITK  6.0.0
Insight Toolkit
itkRealTimeClock.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkRealTimeClock_h
19#define itkRealTimeClock_h
20
21#include "itkMacro.h"
22#include "itkObject.h"
23#include "itkObjectFactory.h"
24#include "itkRealTimeStamp.h"
25
26namespace itk
27{
39class ITKCommon_EXPORT RealTimeClock : public Object
40{
41public:
46
48 itkOverrideGetNameOfClassMacro(RealTimeClock);
49
51 itkNewMacro(Self);
52
54 using TimeStampType = double;
55
57 using FrequencyType = double;
58
62
64 itkGetConstMacro(Frequency, FrequencyType);
65
69
70protected:
73
75 ~RealTimeClock() override;
76
77 void
78 PrintSelf(std::ostream & os, Indent indent) const override;
79
80private:
81 FrequencyType m_Frequency{ 1 };
82 TimeStampType m_Difference{};
83 TimeStampType m_Origin{};
84
85 // Returns a timestamp in a TimeStamp data structure.
86 // We hide this method in the private section, because it returns the
87 // modified time of the itk::Object. That modified time is ambiguous with
88 // the role of the RealTimeStamp.
89 const TimeStamp &
90 GetTimeStamp() const override;
91};
92} // end of namespace itk
93
94#endif // itkRealTimeClock_h
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
Provides a timestamp from a real-time clock.
const TimeStamp & GetTimeStamp() const override
TimeStampType GetTimeInSeconds() const
void PrintSelf(std::ostream &os, Indent indent) const override
RealTimeStamp GetRealTimeStamp() const
~RealTimeClock() override
The RealTimeStamp is a data structure for representing time with high precision and a large dynamic r...
Generate a unique, increasing time value.
Definition: itkTimeStamp.h:61
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....