ADTF  3.18.2
interpolating_clock.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include "base_clock.h"
9 
10 #include <atomic>
11 
12 namespace adtf
13 {
14 
15 namespace system
16 {
17 
18 namespace ant
19 {
20 
27 {
28  private:
29  std::atomic_int_least64_t m_nExternalStreamOffset;
30  mutable tTimeStamp m_nLastInterpolatedTime = 0;
31  bool m_bPaused = false;
32 
33  public:
38  cInterpolatingClock(const char* strName);
39 
40  public:
41  tTimeStamp GetTime() const override;
42 
43  public:
51 
61 
65  void Start();
66 
70  void Pause();
71 };
72 
73 }
74 
75 namespace hollow
76 {
77 
80 {
81  private:
82  std::atomic_int_least64_t m_nExternalStreamOffset;
83  mutable adtf::base::flash::tNanoSeconds m_nLastInterpolatedTime = adtf::base::flash::tNanoSeconds{0};
84  bool m_bPaused = false;
85 
86  public:
88  cInterpolatingClock(const char* strName);
89 
90  public:
91  adtf::base::flash::tNanoSeconds GetTimeNs() const override;
92 
93  public:
96 
99 
102 
105 
107  void Start();
108 
110  void Pause();
111 };
112 
113 }
114 
115 namespace lucky
116 {
117 
120 {
121  public:
125 
127  cInterpolatingClock(const char* strName);
129 
130  adtf::base::flash::tNanoSeconds GetTimeNs() const override;
131 
132  public:
140  tResult Reset(tTimeStamp nNewTime, double fSpeedFactor = 1.0);
141 
144 
152  tResult Reset(adtf::base::flash::tNanoSeconds nNewTime, double fSpeedFactor = 1.0);
153 
156 
158  void Start();
159 
161  void Pause();
162 
163  private:
164  class cImplementation;
165  std::unique_ptr<cImplementation> m_pImplementation;
166 };
167 
168 
169 }
170 
172 
173 }
174 
175 }
Copyright © Audi Electronics Venture GmbH.
Basic Clock implementation for adtf::services::ant::IReferenceClock::IClock.
Definition: base_clock.h:25
void Start()
Restarts interpolation after pausing.
void Pause()
Pauses the clock at the current instant.
cInterpolatingClock(const char *strName)
Constructor.
tResult Reset(tTimeStamp nNewTime)
Resets the time to the new value and send the reset time events.
tResult SetTime(tTimeStamp nNewTime)
Sets the time to the new value.
void Start()
Restarts interpolation after pausing.
tResult Reset(adtf::base::flash::tNanoSeconds nNewTime)
Resets the time to the new value and send the reset time events.
void Pause()
Pauses the clock at the current instant.
cInterpolatingClock(const char *strName)
Constructor.
tResult Reset(tTimeStamp nNewTime)
Resets the time to the new value and send the reset time events.
tResult SetTime(tTimeStamp nNewTime)
Sets the time to the new value.
tResult SetTime(adtf::base::flash::tNanoSeconds nNewTime)
Sets the time to the new value.
void Start()
Restarts interpolation after pausing.
tResult Reset(adtf::base::flash::tNanoSeconds nNewTime, double fSpeedFactor=1.0)
Resets the time to the new value and send the reset time events.
void Pause()
Pauses the clock at the current instant.
cInterpolatingClock()
CTOR make sure you call SetName()
cInterpolatingClock(const char *strName)
Constructor.
tResult Reset(tTimeStamp nNewTime, double fSpeedFactor=1.0)
Resets the time to the new value and send the reset time events.
tResult SetTime(tTimeStamp nNewTime)
Sets the time to the new value.
tResult SetTime(adtf::base::flash::tNanoSeconds nNewTime)
Sets the time to the new value.
Namespace for entire ADTF SDK.