ADTF  3.18.2
reference_clock_intf.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include <adtfucom3/adtf_ucom3.h>
10 #include <adtfbase/chrono.h>
11 #include <adtfbase/string_intf.h>
12 
15 #define CID_ADTF_REFERENCE_CLOCK "reference_clock.service.adtf.cid"
16 
17 namespace adtf
18 {
19 namespace services
20 {
21 namespace ant
22 {
23 
33 {
34  protected:
36  ~IReferenceClock() = default;
37  public:
38 
43  ADTF_IID(IReferenceClock, "reference_clock.ant.streaming.adtf.iid");
44 
45  public:
46 
51  static const int ADTF_MAX_CLOCK_NAME_LENGTH = 256;
52 
53  public:
54 
59  {
65  EVENT_TimeUpdate = 0x0004
66  };
67 
82  {
86  int nEventId;
91  };
92 
98  class IClock: public ucom::IObject
99  {
100  public:
105  ADTF_IID(IClock, "clock.reference_clock.ant.streaming.adtf.iid");
106 
107  public:
111  virtual tResult GetName(adtf::base::ant::IString&& strName) const = 0;
112 
118  virtual tTimeStamp GetTime() const = 0;
119  };
120 
125  {
126  public:
133  };
134 
139  {
140  public:
145  ADTF_IID(ISync2RefChannel, "sync2ref_channel.reference_clock.ant.streaming.adtf.iid");
146 
147  public:
173  virtual tTimeStamp Sync2RefTime(tTimeStamp tmInputTime) = 0;
198  virtual tTimeStamp Sync2RefTime(tTimeStamp tmRefStreamTime, tTimeStamp tmInputTime) = 0;
199  };
200 
205  {
206  public:
211  ADTF_IID(ISync2RefChannelFactory, "sync2ref_channel_factory.reference_clock.ant.streaming.adtf.iid");
212 
213  public:
214  virtual tResult GetName(adtf::base::ant::IString&& strName) const = 0;
215  virtual tResult GetSync2RefChannel(adtf::ucom::ant::iobject_ptr<ISync2RefChannel>& pSync2RefChannel, const char* strName = nullptr) = 0;
216  };
217 
222  {
223  public:
230  };
231 
232 
233  public:
241  virtual tTimeStamp GetTime() const = 0;
242 
250  virtual tTimeStamp GetStreamTime() const = 0;
251 
260 
268 
275  virtual tResult GetClocks(IClockListCallback& oCallback) const = 0;
276 
284  virtual tResult GetClock(const char* strName, adtf::ucom::ant::iobject_ptr<IClock>& pClock) const = 0;
285 
297  virtual tResult SetMainClock(const char* strName) = 0;
298 
303  virtual tResult GetMainClock(adtf::base::ant::IString&& strName) const = 0;
304 
312  virtual tResult SetStreamClock(const char* strName) = 0;
313 
318  virtual tResult GetStreamClock(adtf::base::ant::IString&& strName) const = 0;
319 
326 
333 
340 
349  const char* strName = nullptr, const char* strMethod = nullptr) const = 0;
350 };
351 
352 } //namespace ant
353 
354 namespace flash
355 {
356 
361 {
362  protected:
364  ~IReferenceClock() = default;
365 
366  public:
367 
372  ADTF_IID(IReferenceClock, "reference_clock.flash.streaming.adtf.iid");
373 
374  public:
389  {
394  };
395 
400  {
401  public:
406  ADTF_IID(IClock, "clock.reference_clock.flash.streaming.adtf.iid");
407 
408  public:
414  };
415 
420  {
421  public:
426  ADTF_IID(ISync2RefChannel, "sync2ref_channel.reference_clock.flash.streaming.adtf.iid");
427 
428  public:
430  virtual base::flash::tNanoSeconds Sync2RefTime(base::flash::tNanoSeconds tmInputTime) = 0;
431  virtual base::flash::tNanoSeconds Sync2RefTime(base::flash::tNanoSeconds tmRefStreamTime, base::flash::tNanoSeconds tmInputTime) = 0;
432  };
433 
434  public:
435  virtual base::flash::tNanoSeconds GetTimeNs() const = 0;
436  virtual base::flash::tNanoSeconds GetStreamTimeNs() const = 0;
437 
439  virtual tResult GetSync2RefChannel(adtf::ucom::ant::iobject_ptr<ISync2RefChannel>& pSync2RefChannel,
440  const char* strName = nullptr, const char* strMethod = nullptr) const = 0;
441 };
442 
443 } // namespace flash
444 
445 namespace giant
446 {
447 
452 {
453  protected:
455  ~IReferenceClock() = default;
456 
457  public:
458 
463  ADTF_IID(IReferenceClock, "reference_clock.giant.streaming.adtf.iid");
464 
465  public:
466 
471  {
472  public:
477  ADTF_IID(ISync2RefChannel, "sync2ref_channel.reference_clock.giant.streaming.adtf.iid");
478 
479  public:
480 
484  virtual void SyncReset() = 0;
485  };
486 
487  public:
489  using flash::IReferenceClock::GetSync2RefChannel;
490  virtual tResult GetSync2RefChannel(adtf::ucom::ant::iobject_ptr<ISync2RefChannel>& pSync2RefChannel,
491  const char* strName = nullptr, const char* strMethod = nullptr) const = 0;
492 };
493 
494 } // namespace giant
495 
496 namespace osborn
497 {
498 
503 {
504  protected:
506  ~IReferenceClock() = default;
507 
508  public:
509 
514  ADTF_IID(IReferenceClock, "reference_clock.osborn.streaming.adtf.iid");
515 
520  {
521  public:
522  ADTF_IID(ISystemClock, "system_clock.reference_clock.osborn.streaming.adtf.iid");
523 
527  virtual bool IsSystemClock() const = 0;
528  };
529 
536  virtual tResult ConvertStreamTime(adtf::base::flash::tNanoSeconds tmStreamTime, adtf::base::ant::IString&& strStringRepresentation) const = 0;
537 
544  virtual tResult ConvertStreamTime(const char* strStringRepresentation, adtf::base::flash::tNanoSeconds& tmStreamTime) const = 0;
545 
552  virtual tResult ConvertTimeOffset(adtf::base::flash::tNanoSeconds tmOffset, adtf::base::ant::IString&& strStringRepresentation) const = 0;
553 
560  virtual tResult ConvertTimeOffset(const char* strStringRepresentation, adtf::base::flash::tNanoSeconds& tmOffset) const = 0;
561 
562 
564  using flash::IReferenceClock::GetSync2RefChannel;
565  using giant::IReferenceClock::GetSync2RefChannel;
566 
578  virtual tResult GetSync2RefChannel(bool bSystemClockTimestamps,
580  const char* strName = nullptr) const = 0;
581 };
582 
583 }// namespace osborn
584 
585 namespace penguin
586 {
587 
592 {
593  protected:
595  ~IReferenceClock() = default;
596 
597  public:
598 
603  ADTF_IID(IReferenceClock, "reference_clock.penguin.streaming.adtf.iid");
604 
605  public:
606 
612  {
613  public:
620  virtual tResult WaitUntilBegin() const = 0;
621 
625  enum class tTimePointId: uint8_t
626  {
627  Begin = 0,
628  End = 1
629  };
630 
636 
641  virtual bool IsBroken(tTimePointId eTimePointId) const = 0;
642  };
643 
649  {
650  public:
651  ADTF_IID(ITimeGuard, "time_guard.reference_clock.penguin.streaming.adtf.iid");
652 
664 
668  virtual void Cancel() = 0;
669  };
670 
671 
676  {
677  public:
678  ADTF_IID(IGuardableClock, "guardable_clock.reference_clock.penguin.streaming.adtf.iid");
679 
680  public:
687  virtual tResult GetTimeGuard(const char* strName, ucom::ant::iobject_ptr<ITimeGuard>& pGuard) = 0;
688  };
689 
694  virtual tResult GetTimeGuard(const char* strName, ucom::ant::iobject_ptr<ITimeGuard>& pGuard) = 0;
695 };
696 
697 }// namespace penguin
698 
699 namespace riddler
700 {
705 {
706 protected:
708  ~IReferenceClock() = default;
709 
710 public:
715  ADTF_IID(IReferenceClock, "reference_clock.riddler.streaming.adtf.iid");
716 
720  enum class tTimeBase : uint8_t
721  {
722  UNSPECIFIED,
723  POSIX_UTC,
724  POSIX_TAI
725  };
726 
728  using flash::IReferenceClock::GetSync2RefChannel;
729  using giant::IReferenceClock::GetSync2RefChannel;
731 
741  virtual tResult GetSync2RefChannel(tTimeBase eTimeBase, adtf::ucom::ant::iobject_ptr<IReferenceClock::ISync2RefChannel>& pSync2RefChannel, const char* strName = nullptr) const = 0;
742 };
743 
744 } // namespace riddler
745 
748 
749 } // namespace services
750 
751 } // namespace adtf
Copyright © Audi Electronics Venture GmbH.
tVoid * tHandle
type definition for a handle value (platform and compiler dependent type).
Copyright © Audi Electronics Venture GmbH.
The IString interface provides methods for getting and setting strings through abstract interfaces.
Definition: string_intf.h:28
ADTF_IID(IClock, "clock.reference_clock.ant.streaming.adtf.iid")
Marks the IClock to be castable with the adtf::ucom::ant::ucom_cast.
virtual tTimeStamp GetTime() const =0
Returns the current time of the clock.
virtual tResult GetName(adtf::base::ant::IString &&strName) const =0
virtual tResult HandleClock(const ucom::ant::iobject_ptr< IClock > &pClock)=0
This will be called for each registered clock.
ADTF_IID(ISync2RefChannelFactory, "sync2ref_channel_factory.reference_clock.ant.streaming.adtf.iid")
Marks the ISync2RefChannelFactory to be castable with the adtf::ucom::ant::ucom_cast.
Interface for synchronizing external timestamps to stream time.
ADTF_IID(ISync2RefChannel, "sync2ref_channel.reference_clock.ant.streaming.adtf.iid")
Marks the ISync2RefChannel to be castable with the adtf::ucom::ant::ucom_cast.
virtual tTimeStamp Sync2RefTime(tTimeStamp tmInputTime)=0
Converts an input timestamp to the StreamTime of the framework's ReferenceClock by identifying the cl...
virtual tTimeStamp Sync2RefTime(tTimeStamp tmRefStreamTime, tTimeStamp tmInputTime)=0
Converts an input timestamp to the given StreamTime of the framework's ReferenceClock by identifying ...
virtual tResult HandleSync2RefFactory(ISync2RefChannelFactory &oFactory)=0
This will be called for each registered sync method.
The IReferenceClock interface provides the reference time source for the filter graph.
virtual tResult UnregisterSync2RefFactory(const adtf::ucom::ant::iobject_ptr< ISync2RefChannelFactory > &oSync2RefFactory)=0
Unregisters a Sync2Ref channel factory.
virtual tTimeStamp GetTime() const =0
Retrieves the current reference time.
virtual tResult GetStreamClock(adtf::base::ant::IString &&strName) const =0
Retrieves the name of the current stream clock.
virtual tResult UnregisterClock(const adtf::ucom::ant::iobject_ptr< IClock > &pClock)=0
Unregisters a clock.
virtual tResult SetMainClock(const char *strName)=0
This will change the main clock to the given clock.
virtual tResult RegisterClock(const adtf::ucom::ant::iobject_ptr< IClock > &pClock)=0
Registers a new clock.
virtual tResult GetClock(const char *strName, adtf::ucom::ant::iobject_ptr< IClock > &pClock) const =0
Find a clock.
static const int ADTF_MAX_CLOCK_NAME_LENGTH
The maximum length of clock names, due to length restrictions when storing names in the clock extensi...
virtual tResult GetSync2RefChannel(adtf::ucom::ant::iobject_ptr< ISync2RefChannel > &pSync2RefChannel, const char *strName=nullptr, const char *strMethod=nullptr) const =0
Returns a new instance of a Sync2Ref Channel implementation.
virtual tResult RegisterSync2RefFactory(const adtf::ucom::ant::iobject_ptr< ISync2RefChannelFactory > &oSync2RefFactory)=0
Registers a new Sync2Ref channel factory.
~IReferenceClock()=default
not destructable
virtual tResult GetMainClock(adtf::base::ant::IString &&strName) const =0
Retrieves the name of the current main clock.
virtual tResult ListSync2RefMethods(ISync2RefListCallback &oCallback)=0
Lists all available Sync2Ref methods.
virtual tResult GetClocks(IClockListCallback &oCallback) const =0
Lists all available clocks.
virtual tTimeStamp GetStreamTime() const =0
Retrieves the stream time which is reset at the start of the stream.
tReferenceClockEventId
Event Id enumeration for the tReferenceClockEvent::nEventId.
@ EVENT_TimeResetEnd
Event describes the Time reset after a new time was set.
@ EVENT_TimeResetBegin
Event describes the Time reset before setting a new time.
@ EVENT_TimeUpdate
Event describes that the time has been updated, only emitted by non-continuous clocks.
ADTF_IID(IReferenceClock, "reference_clock.ant.streaming.adtf.iid")
Marks the IReferenceClock to be castable with the adtf::ucom::ant::ucom_cast.
virtual tResult SetStreamClock(const char *strName)=0
Sets the clock of which the time is returned by adtf::services::ant::IReferenceClock::GetStreamTime.
ADTF_IID(IClock, "clock.reference_clock.flash.streaming.adtf.iid")
Marks the IClock to be castable with the adtf::ucom::ant::ucom_cast.
virtual base::flash::tNanoSeconds GetTimeNs() const =0
Returns the current time of the clock in nanoseconds.
Interface for synchronizing external timestamps to stream time.
ADTF_IID(ISync2RefChannel, "sync2ref_channel.reference_clock.flash.streaming.adtf.iid")
Marks the ISync2RefChannel to be castable with the adtf::ucom::ant::ucom_cast.
The IReferenceClock interface provides the reference time source for the filter graph.
~IReferenceClock()=default
not destructable
ADTF_IID(IReferenceClock, "reference_clock.flash.streaming.adtf.iid")
Marks the IReferenceClock to be castable with the adtf::ucom::ant::ucom_cast.
Interface for synchronizing external timestamps to stream time.
virtual void SyncReset()=0
Manually reset internal data (offset and drift).
ADTF_IID(ISync2RefChannel, "sync2ref_channel.reference_clock.giant.streaming.adtf.iid")
Marks the ISync2RefChannel to be castable with the adtf::ucom::ant::ucom_cast.
The IReferenceClock interface provides the reference time source for the filter graph.
ADTF_IID(IReferenceClock, "reference_clock.giant.streaming.adtf.iid")
Marks the IReferenceClock to be castable with the adtf::ucom::ant::ucom_cast.
~IReferenceClock()=default
not destructable
Use this to mark certain clocks as clocks that return timestamps from the system clock.
The IReferenceClock interface provides the reference time source for the filter graph.
ADTF_IID(IReferenceClock, "reference_clock.osborn.streaming.adtf.iid")
Marks the IReferenceClock to be castable with the adtf::ucom::ant::ucom_cast.
virtual tResult ConvertStreamTime(adtf::base::flash::tNanoSeconds tmStreamTime, adtf::base::ant::IString &&strStringRepresentation) const =0
Converts an absolute timestamp into a textual representation based on the settings of the clock servi...
virtual tResult GetSync2RefChannel(bool bSystemClockTimestamps, adtf::ucom::ant::iobject_ptr< giant::IReferenceClock::ISync2RefChannel > &pSync2RefChannel, const char *strName=nullptr) const =0
Returns a new instance of a Sync2Ref Channel implementation.
~IReferenceClock()=default
not destructable
virtual tResult ConvertTimeOffset(adtf::base::flash::tNanoSeconds tmOffset, adtf::base::ant::IString &&strStringRepresentation) const =0
Converts a relative timestamp into a textual representation based on the settings of the clock servic...
virtual tResult ConvertStreamTime(const char *strStringRepresentation, adtf::base::flash::tNanoSeconds &tmStreamTime) const =0
Converts a textual timestamp into an absolute numeric timestamp based on the settings of the clock se...
virtual tResult ConvertTimeOffset(const char *strStringRepresentation, adtf::base::flash::tNanoSeconds &tmOffset) const =0
Converts a textual timestamp into a relative numeric timestamp based on the settings of the clock ser...
Interface for clock based waiting and monitoring.
virtual tResult GetTimeGuard(const char *strName, ucom::ant::iobject_ptr< ITimeGuard > &pGuard)=0
Get a new time guard object.
Interface for communicating instants of time to the clock.
virtual bool IsBroken(tTimePointId eTimePointId) const =0
virtual tResult WaitUntilBegin() const =0
Waits until the time has reached or passed the beginning of the barrier.
virtual adtf::base::flash::tNanoSeconds GetTimePoint(tTimePointId eTimePointId) const =0
Interface for time manipulation and monitoring.
virtual void Cancel()=0
Cancels all ongoing and future ITimeBarrier::WaitUntil() calls.
virtual tResult CreateBarrier(base::flash::tNanoSeconds tmBegin, base::flash::tNanoSeconds tmEnd, ucom::ant::iobject_ptr< ITimeBarrier > &pBarrier)=0
Creates a new time barrier at tmTimePoint.
The IReferenceClock interface provides the reference time source for the filter graph.
ADTF_IID(IReferenceClock, "reference_clock.penguin.streaming.adtf.iid")
Marks the IReferenceClock to be castable with the adtf::ucom::ant::ucom_cast.
virtual tResult GetTimeGuard(const char *strName, ucom::ant::iobject_ptr< ITimeGuard > &pGuard)=0
Get a new time guard object from the current ADTF Stream Time clock.
~IReferenceClock()=default
not destructable
The IReferenceClock interface provides the reference time source for the filter graph.
virtual tResult GetSync2RefChannel(tTimeBase eTimeBase, adtf::ucom::ant::iobject_ptr< IReferenceClock::ISync2RefChannel > &pSync2RefChannel, const char *strName=nullptr) const =0
Returns a new instance of a Sync2Ref Channel implementation.
~IReferenceClock()=default
not destructable
ADTF_IID(IReferenceClock, "reference_clock.riddler.streaming.adtf.iid")
Marks the IReferenceClock to be castable with the adtf::ucom::ant::ucom_cast.
Base class for every interface type within the uCOM.
Definition: object_intf.h:31
Base object pointer to realize binary compatible reference counting in interface methods.
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
This structure describes the functionality for the adtf::ucom::ant::IEventSource Communication Expans...
tTimeStamp nOldTime
The old time before set new time.
int nEventId
EventId shown in IReferenceClock::tReferenceClockEventId.
This structure describes the functionality for the adtf::ucom::ant::IEventSource Communication Expans...
adtf::base::flash::tNanoSeconds nOldTimeNs
The old time before set new time.
adtf::base::flash::tNanoSeconds nNewTimeNs
The new time set.