11 #include <shared_mutex>
33 if (pSample.
Get() !=
nullptr && pSampleAdd.
Get() !=
nullptr)
35 return (pSampleAdd.
Get()->GetTime() < pSample.
Get()->GetTime());
44 #define ADTF_SAMPLEQUEUE_CLASS_VERSION_01 0x01
97 typedef std::multimap<adtf::base::tNanoSeconds, adtf::ucom::ant::object_ptr<ISample>>
tSampleQueue;
101 tResult Push(
const iobject_ptr<ISample>& pSample);
102 tResult Pop(iobject_ptr<ISample>& pSample);
104 tResult Top(iobject_ptr<ISample>& pSample);
109 tResult Get(iobject_ptr<ISample>& pSample,
112 uint32_t ui32GetMethod=SQG_GetLast);
210 tResult InternalPop(iobject_ptr<ISample>& pSample);
tInt64 tTimeStamp
type definition for a time value.
A common result class usable as return value throughout.
The ISampleQueueEventSink provides methods to act upon sample queue events emitted by a sample queue.
A simple Sample Queue that hold Samples in a sorted way by time.
int m_nClearingQueueCount
Clearing queue count.
tResult GetNearestNewer(iobject_ptr< ISample > &ppSample, tTimeStamp tmTime, tTimeStamp tmDeltaT)
Get the sample which is nearest to and newer than a given timestamp.
bool m_bTimeStampsInitialized
m_tmFirstTime and m_tmLastTime initialized?
size_t m_szMaxSize
Maximum size of queue.
std::shared_mutex m_oQueueReadWriteLock
Queue lock.
tResult Clear()
Clears the SampleQueue.
tResult GetNearest(iobject_ptr< ISample > &pSample, tTimeStamp tmTime, tTimeStamp tmDeltaT)
Get the sample which is nearest to a given timestamp.
std::multimap< adtf::base::tNanoSeconds, adtf::ucom::ant::object_ptr< ISample > > tSampleQueue
Sample queue is organized as multi set.
adtf::base::tNanoSeconds m_tmTimeRange
Time range of the samples in the queue.
adtf::ucom::object_ptr< ISample > m_pLastSample
Last sample of the queue.
adtf::base::tNanoSeconds m_tmLastTime
Last timestamp in queue.
std::list< ISampleQueueEventSink * > m_lstQueueEventReceiver
Event receivers.
tResult FireEvent(uint32_t ui32Event, int nParam1, int nParam2)
Fires the Event to all registered ISampleQueueEventSink.
std::recursive_mutex m_oEventListLocked
Event list lock - RAII-pattern.
tResult GetNearest2(iobject_ptr< ISample > &pSampleOlder, iobject_ptr< ISample > &pSampleNewer, tTimeStamp tmTime)
Search the two samples which are nearest to a given timestamp.
tSampleQueue m_qSamples
The sample queue.
tResult GetNearestOlder(iobject_ptr< ISample > &pSample, tTimeStamp tmTime, tTimeStamp tmDeltaT)
Get the sample which is nearest to and older than a given timestamp.
virtual ~cSampleQueue()
Destructor.
bool m_bFireEvents
Fire events?
tResult SetRanges(tTimeStamp tmTimeRange, size_t szMaxSize=0)
Set The Sample Queue Ranges (sizes).
adtf::base::tNanoSeconds m_tmFirstTime
First timestamp in queue.
bool m_bError
Error indicator.
cSampleQueue(tTimeStamp tmTimeRange, size_t szMaxSize, bool bClearOnTimeJumps=false)
Constructor.
tResult ClearEventList()
Clear all buffered queue events.
The class IEventSource provides a generic event provider interface.
virtual T * Get() const =0
Get raw pointer to shared object.
Base object pointer to realize binary compatible reference counting in interface methods.
Object pointer implementation used for reference counting on objects of type IObject.
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an e...
#define A_UTILS_D(__pclassname_)
Helper macro for d-pattern definitions.
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
A timestamp with nanosecond precision.
Defines the structure for the SampleQueue Insert Compare.
bool operator()(const adtf::ucom::iobject_ptr< ISample > &pSampleAdd, const adtf::ucom::iobject_ptr< ISample > &pSample) const
Comparison operator.