ADTF  3.18.2
base_clock.h
Go to the documentation of this file.
1 
7 #pragma once
9 
10 namespace adtf
11 {
12 namespace system
13 {
14 namespace ant
15 {
16 
23 class cBaseClock : public ucom::catwo::object<services::ant::IReferenceClock::IClock,
24  ucom::cEventSource>
25 {
26  private:
27  adtf_util::cString m_strName;
28 
29  public:
32  cBaseClock(const char* strName);
33 
34  public:
35  tResult GetName(base::ant::IString&& strName) const override;
36 
37  protected:
44  tResult SendResetBeginEvent(tTimeStamp tmOldTime, tTimeStamp tmNewTime) const;
45 
52  tResult SendResetEndEvent(tTimeStamp tmOldTime, tTimeStamp tmNewTime) const;
53 
60  tResult SendUpdateEvent(tTimeStamp tmOldTime, tTimeStamp tmNewTime) const;
61 };
62 
63 }
64 
65 namespace flash
66 {
67 
68 class cBaseClock : public ucom::catwo::object<services::ant::IReferenceClock::IClock,
69  services::flash::IReferenceClock::IClock,
70  ucom::cEventSource>
71 {
72  public:
76 
79  cBaseClock(const char* strName);
80 
85  void SetName(const char* strName);
86 
87  tResult GetName(base::ant::IString&& strName) const override;
88 
89  // you need to override at least one of these
90  tTimeStamp GetTime() const override;
91  adtf::base::flash::tNanoSeconds GetTimeNs() const override;
92 
93  protected:
100  tResult SendResetBeginEvent(tTimeStamp tmOldTime, tTimeStamp tmNewTime) const;
101 
108  tResult SendResetEndEvent(tTimeStamp tmOldTime, tTimeStamp tmNewTime) const;
109 
116  tResult SendUpdateEvent(tTimeStamp tmOldTime, tTimeStamp tmNewTime) const;
117 
118  protected:
126 
134 
142 
143  private:
145  base::flash::tNanoSeconds tmOldTime,
146  base::flash::tNanoSeconds tmNewTime) const;
148  tTimeStamp tmOldTime,
149  tTimeStamp tmNewTime) const;
150 
151  private:
152  std::string m_strName;
153 
154 };
155 
156 }
157 
158 using flash::cBaseClock;
159 
160 }
161 
162 }
The IString interface provides methods for getting and setting strings through abstract interfaces.
Definition: string_intf.h:28
tReferenceClockEventId
Event Id enumeration for the tReferenceClockEvent::nEventId.
Basic Clock implementation for adtf::services::ant::IReferenceClock::IClock.
Definition: base_clock.h:25
cBaseClock(const char *strName)
CTOR to set the name of the clock.
tResult SendResetEndEvent(tTimeStamp tmOldTime, tTimeStamp tmNewTime) const
Sends the Reset end event.
tResult SendUpdateEvent(tTimeStamp tmOldTime, tTimeStamp tmNewTime) const
Sends the time update event.
tResult SendResetBeginEvent(tTimeStamp tmOldTime, tTimeStamp tmNewTime) const
Sends the Reset begin event.
tResult SendResetBeginEvent(base::flash::tNanoSeconds tmOldTime, base::flash::tNanoSeconds tmNewTime) const
Sends the Reset begin event.
tResult SendResetEndEvent(base::flash::tNanoSeconds tmOldTime, base::flash::tNanoSeconds tmNewTime) const
Sends the Reset end event.
tResult SendUpdateEvent(base::flash::tNanoSeconds tmOldTime, base::flash::tNanoSeconds tmNewTime) const
Sends the time update event.
cBaseClock()
CTOR make sure you call SetName()
cBaseClock(const char *strName)
CTOR to set the name of the clock.
void SetName(const char *strName)
Sets the name of the clock.
tResult SendResetEndEvent(tTimeStamp tmOldTime, tTimeStamp tmNewTime) const
Sends the Reset end event.
tResult SendUpdateEvent(tTimeStamp tmOldTime, tTimeStamp tmNewTime) const
Sends the time update event.
tResult SendResetBeginEvent(tTimeStamp tmOldTime, tTimeStamp tmNewTime) const
Sends the Reset begin event.
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an e...
Definition: object.h:379
string_base< cStackString > cString
cString implementation for a stack string which works on stack if string is lower than A_UTILS_DEFAUL...
Definition: string.h:2778
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.