ITK  5.3.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 
26 namespace itk
27 {
39 class ITKCommon_EXPORT RealTimeClock : public Object
40 {
41 public:
43  using Superclass = Object;
46 
48  itkTypeMacro(RealTimeClock, Object);
49 
51  itkNewMacro(Self);
52 
54  using TimeStampType = double;
55 
57  using FrequencyType = double;
58 
61  GetTimeInSeconds() const;
62 
64  itkGetConstMacro(Frequency, FrequencyType);
65 
68  GetRealTimeStamp() const;
69 
70 protected:
72  RealTimeClock();
73 
75  ~RealTimeClock() override;
76 
77  void
78  PrintSelf(std::ostream & os, Indent indent) const override;
79 
80 private:
81  FrequencyType m_Frequency{ 1 };
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
itkObjectFactory.h
itk::RealTimeClock::TimeStampType
double TimeStampType
Definition: itkRealTimeClock.h:54
itk::RealTimeStamp
The RealTimeStamp is a data structure for representing time with high precision and a large dynamic r...
Definition: itkRealTimeStamp.h:45
itk::RealTimeClock::m_Difference
TimeStampType m_Difference
Definition: itkRealTimeClock.h:82
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::RealTimeClock::FrequencyType
double FrequencyType
Definition: itkRealTimeClock.h:57
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkMacro.h
itk::TimeStamp
Generate a unique, increasing time value.
Definition: itkTimeStamp.h:60
itk::RealTimeClock
Provides a timestamp from a real-time clock.
Definition: itkRealTimeClock.h:39
itkObject.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itk::RealTimeClock::m_Origin
TimeStampType m_Origin
Definition: itkRealTimeClock.h:83
itkRealTimeStamp.h