ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkRealTimeClock.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 
60  TimeStampType GetTimeInSeconds() const;
61 
63  itkGetConstMacro(Frequency, FrequencyType);
64 
66  RealTimeStamp GetRealTimeStamp() const;
67 
68 protected:
69 
71  RealTimeClock();
72 
74  ~RealTimeClock() override;
75 
76  void PrintSelf(std::ostream & os, Indent indent) const override;
77 
78 private:
79  FrequencyType m_Frequency{1};
82 
83  // Returns a timestamp in a TimeStamp data structure.
84  // We hide this method in the private section, because it returns the
85  // modified time of the itk::Object. That modified time is ambiguous with
86  // the role of the RealTimeStamp.
87  const TimeStamp & GetTimeStamp() const override;
88 };
89 } // end of namespace itk
90 
91 #endif // itkRealTimeClock_h
TimeStampType m_Difference
Light weight base class for most itk classes.
Provides a timestamp from a real-time clock.
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:60
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:60
TimeStampType m_Origin