ADTF  3.18.2
samplequeue_intf.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include "sample_intf.h"
9 
10 namespace adtf
11 {
12 namespace streaming
13 {
14 namespace ant
15 {
16 
17 
18 class ISampleQueue;
19 
25 {
26  protected:
27  ~ISampleQueueEventSink() = default;
28 
29  public:
31  typedef enum : uint8_t
32  {
41 
43  public:
52  virtual tResult OnSampleQueueEvent(uint32_t ui32Event,
53  int nParam1,
54  int nParam2,
55  tTimeStamp tmTimeRange) = 0;
56 };
57 
62 {
63  protected:
65  ~ISampleQueue() = default;
66  public:
68  ADTF_IID(ISampleQueue, "samplequeue.ant.streaming.adtf.iid");
69 
70  public:
72  template <typename T>
75  template <typename T>
77  public:
81  typedef enum : uint32_t
82  {
95 
97  SQG_GetUser = 128
99 
106  virtual tResult Push(const iobject_ptr<ISample>& pSample) = 0;
107 
113  virtual tResult Pop(iobject_ptr<ISample>& pSample) = 0;
118  virtual tResult Pop() = 0;
119 
125  virtual tResult Top(iobject_ptr<ISample>& pSample) = 0;
126 
131  virtual tResult Clear() = 0;
132 
137  virtual size_t GetSize() = 0;
138 
144  virtual bool Empty() = 0;
145 
158  virtual tResult Get(iobject_ptr<ISample>& pSample,
159  tTimeStamp tmTimeStamp,
160  tTimeStamp tmDeltaT,
161  uint32_t ui32GetMethod) = 0;
168  virtual tResult GetSettings(tTimeStamp& tmTimeRange, size_t& szSizeRange) const = 0;
176  virtual tResult SetSettings(const tTimeStamp tmTimeRange, const size_t szSizeRange) = 0;
183  virtual void GetTimes(tTimeStamp& tmFirst, tTimeStamp& tmLast) const = 0;
184 
190  virtual tResult RegisterQueueEventSink(ISampleQueueEventSink* pQueueEventSink) = 0;
191 
197  virtual tResult UnregisterQueueEventSink(const ISampleQueueEventSink* pQueueEventSink) = 0;
198 };
199 
200 
201 
202 
203 } //namesapce ant
204 } //namespac streaming
205 } // namespace adtf
The ISampleQueueEventSink provides methods to act upon sample queue events emitted by a sample queue.
tSampleQueueEvent
specifies the several types of events
@ SQE_SampleQueueErased
Used when a Sample is deleted from Queue.
@ SQE_SampleQueueInserted
Used when a Sample is added to the Queue.
virtual tResult OnSampleQueueEvent(uint32_t ui32Event, int nParam1, int nParam2, tTimeStamp tmTimeRange)=0
This method gets called when a sample queue emits an event.
The ISampleQueue Interface provides methods for manipulating a queue of samples.
virtual size_t GetSize()=0
Retrieves the size of the queue.
virtual void GetTimes(tTimeStamp &tmFirst, tTimeStamp &tmLast) const =0
Gets the current time of first and last sample in the queue.
virtual tResult Get(iobject_ptr< ISample > &pSample, tTimeStamp tmTimeStamp, tTimeStamp tmDeltaT, uint32_t ui32GetMethod)=0
Get a sample from the queue.
virtual tResult Top(iobject_ptr< ISample > &pSample)=0
Retrieves the first sample from the queue.
virtual tResult GetSettings(tTimeStamp &tmTimeRange, size_t &szSizeRange) const =0
Returns the current time range and size range of the sample.
virtual tResult UnregisterQueueEventSink(const ISampleQueueEventSink *pQueueEventSink)=0
Unregisters a queue event sink.
virtual tResult Push(const iobject_ptr< ISample > &pSample)=0
Push a sample onto the queue Implementations may sort the queue by the timestamps of the sample.
virtual tResult RegisterQueueEventSink(ISampleQueueEventSink *pQueueEventSink)=0
Registers a new queue event sink.
virtual tResult Pop(iobject_ptr< ISample > &pSample)=0
Remove the first sample from the queue.
ADTF_IID(ISampleQueue, "samplequeue.ant.streaming.adtf.iid")
definiton of interface id
virtual tResult Pop()=0
Remove the first sample from the queue.
tSampleQueueGetMethod
This Structure defines GetMethodes for the function ISampleQueue::Get.
@ SQG_GetNearest
gets the nearest sample refering to the given time
@ SQG_GetOldest
gets the oldest sample in the queue
@ SQG_GetUser
Offset for user methods.
@ SQG_GetNewest
gets the newest sample
@ SQG_GetNearestOlder
gets the nearest sample refering to the given time, but only returns the older one
@ SQG_GetLast
gets the very last sample
@ SQG_GetNearestNewer
gets the nearest sample refering to the given time, but only returns the newer one
virtual tResult SetSettings(const tTimeStamp tmTimeRange, const size_t szSizeRange)=0
Sets the current time range and size range of the sample.
virtual tResult Clear()=0
Removes all samples from the queue.
virtual bool Empty()=0
Checks if the queue is empty.
~ISampleQueue()=default
not destructable
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.