ADTF
|
A class that collects the sample sets from multiple sample readers. More...
Public Types | |
typedef std::function< tResult(cExternalQueueSampleReader &, const adtf::ucom::iobject_ptr< const IStreamType > &pStreamType)> | tStreamTypeChangeCallback |
Public Member Functions | |
cTimeBasedSampleSetCollector (tStreamTypeChangeCallback pTypeChangeCallback) | |
Constructor with type change callback. More... | |
cTimeBasedSampleSetCollector (const cTimeBasedSampleSetCollector &)=delete | |
cTimeBasedSampleSetCollector (cTimeBasedSampleSetCollector &&)=default | |
cTimeBasedSampleSetCollector & | operator= (const cTimeBasedSampleSetCollector &)=delete |
cTimeBasedSampleSetCollector & | operator= (cTimeBasedSampleSetCollector &&)=default |
tResult | CollectFrom (cExternalQueueSampleReader &oSampleReader) |
Adds a sample reader to the list of sample readers that data is read from. More... | |
void | ClearQueues () |
Clear all internal queues for all connected sample readers. | |
template<typename ... T> | |
tResult | GetSampleSetAt (tTimeStamp tmTime, T &... samples) |
Get the next sample set from all sample readers. More... | |
Private Member Functions | |
template<typename ... T> | |
tResult | GetSampleSetWithCheckAt (tTimeStamp tmTime, bool &bSampleFound, adtf::ucom::iobject_ptr< const ISample > &pSample, T &... samples) |
tResult | GetSampleSetWithCheckAt (tTimeStamp, bool &) |
Private Attributes | |
std::vector< std::shared_ptr< detail::cExternalSampleReaderQueue > > | m_oQueues |
tStreamTypeChangeCallback | m_pTypeChangeCallback |
A class that collects the sample sets from multiple sample readers.
Usage:
It returns a set of samples for each sample that has arrived. This set contains the new sample and the last ones from the other streams/readers.
(for more detail see sample_reader)
Definition at line 229 of file sample_collectors.h.
cTimeBasedSampleSetCollector | ( | tStreamTypeChangeCallback | pTypeChangeCallback | ) |
Constructor with type change callback.
[in] | pTypeChangeCallback | a callback that is called when ever the stream type of a reader changes. |
tResult CollectFrom | ( | cExternalQueueSampleReader & | oSampleReader | ) |
Adds a sample reader to the list of sample readers that data is read from.
[in] | oSampleReader | The sample reader to read data from. |
ERR_NOERROR | Stream type is valid |
|
inline |
Get the next sample set from all sample readers.
All samples in the set and before the set are removed from the queues.
[in] | tmTime | The timestamp which the set should be valid for. |
[out] | samples | Collection of sample to return |
ERR_NOERROR | data is valid |
RETURN_IF_FAILED | (ERR_INVALID_ARG) more sample were requested than readers registered (to many parameters) |
RETURN_ERROR(ERR_EMPTY) | no data available |
Definition at line 278 of file sample_collectors.h.
References RETURN_ERROR, RETURN_IF_FAILED, and RETURN_NOERROR.