|
ADTF
|
The default Sample Reader will read the incomung Stream of a IInPin. This sample reader has no internal queue! Make sure if you use this sample reader with ISampleStreamAccess::PushRead to register a external queue or to override the adtf::streaming::ant::cSampleReader::ReadNextSample and adtf::streaming::ant::cSampleReader::Push methods. More...
#include <samplereader.h>
Inherits adtf::streaming::ant::sample_streamer< ISampleReader, cInPin >, adtf::streaming::ant::ISampleReaderQueue, and adtf::base::runnable< DEFAULT_ACTIVATION_TYPE, ANT_INTERFACE, flash::IRunnable, CALLABLE >.
Inherited by adtf::streaming::ant::cExternalQueueSampleReader, and adtf::streaming::ant::cLastSampleReader.
Public Member Functions | |
| cSampleReader () | |
| cSampleReader (ISampleStreamAccess::tMode eAccessMode) | |
| virtual tResult | AcceptType (const ucom::ant::iobject_ptr< const IStreamType > &pStreamType) |
| Accept or reject a new stream type. | |
| tResult | BeginStreaming (ISampleStream &oSampleStream) override |
| tResult | EndStreaming () override |
| void | SetAcceptTypeCallback (const std::function< tResult(const ucom::iobject_ptr< const IStreamType > &pStreamType)> &fnAcceptTypeCallback) |
| Sets a callback function which is called while a Stream Type is received. | |
| void | SetStreamErrorCallback (const std::function< tResult(tResult oStreamError)> &fnStreamErrorCallback) |
| A callback function to react on stream errors. | |
| tResult | SetStreamError (const tResult &oError) |
| void | GetSampleInStream (ucom::ant::iobject_ptr< ISampleInStream > &pSampleInStream) |
| Returns the connected ISampleInStream. | |
| void | GetLastType (ucom::ant::iobject_ptr< const IStreamType > &pType) |
| Returns the connected ISampleInStream. | |
| virtual tResult | GetNextSample (ucom::ant::iobject_ptr< const ISample > &pSample) |
| void | Reset () override |
| virtual tResult | Push (const IStreamItem &oStreamItem, tTimeStamp tmTime)=0 |
| Push a new value to the internal sample queue. | |
| virtual void | Clear ()=0 |
| virtual tResult | Pop (IStreamItem &oStreamItem)=0 |
| Returns the next sample from the queue. | |
Public Member Functions inherited from adtf::streaming::ant::sample_streamer< ISampleReader, cInPin > | |
| sample_streamer ()=default | |
| CTOR. | |
| sample_streamer (const char *strName, const ucom::ant::iobject_ptr< const IStreamType > &pStreamType) | |
| virtual | ~sample_streamer () |
| DTOR. | |
| void | SetName (const char *strName) |
| void | ResetPin (ucom::ant::object_ptr< cInPin > &pPin) |
| void | ResetPin () |
| tResult | GetName (base::ant::IString &&strName) const |
| tResult | SetType (const ucom::ant::iobject_ptr< const IStreamType > &pStreamType) |
| tResult | GetType (ucom::ant::iobject_ptr< const IStreamType > &pStreamType) const override |
| tResult | EndStreaming () override |
| sample_streamer ()=default | |
| CTOR. | |
| sample_streamer (const char *strName, const ucom::ant::iobject_ptr< const IStreamType > &pStreamType) | |
| virtual | ~sample_streamer () |
| DTOR. | |
| void | SetName (const char *strName) |
| void | ResetPin (ucom::ant::object_ptr< cInPin > &pPin) |
| void | ResetPin () |
| tResult | GetName (base::ant::IString &&strName) const |
| tResult | SetType (const ucom::ant::iobject_ptr< const IStreamType > &pStreamType) |
| tResult | GetType (ucom::ant::iobject_ptr< const IStreamType > &pStreamType) const override |
| tResult | EndStreaming () override |
Public Member Functions inherited from adtf::base::runnable< DEFAULT_ACTIVATION_TYPE, ANT_INTERFACE, flash::IRunnable, CALLABLE > | |
| runnable ()=delete | |
| CTOR. | |
| runnable (CALLABLE &&fcRunFunc) noexcept | |
| runnable (CALLABLE_WITH_TIMSTAMP &&fcRunFunc) noexcept | |
| runnable (CALLABLE &&fcRunFunc, ant::IRunnable::tActivationType ui32ActivationType) noexcept | |
| ~runnable () override=default | |
| DTOR. | |
| tResult | Run (tTimeStamp tmTimeofActivation, ant::IRunnable::tActivationType ui32ActivationType, const void *pvUserData, size_t nUserDataSize) override |
| tResult | Run (tNanoSeconds tmTimeofActivation, ant::IRunnable::tActivationType ui32ActivationType, const void *pvUserData, size_t nUserDataSize) override |
| ant::IRunnable::tActivationType | GetActivationType () const override |
| runnable ()=delete | |
| CTOR. | |
| runnable (CALLABLE &&fcRunFunc) noexcept | |
| runnable (CALLABLE_WITH_TIMSTAMP &&fcRunFunc) noexcept | |
| runnable (CALLABLE &&fcRunFunc, ant::IRunnable::tActivationType ui32ActivationType) noexcept | |
| ~runnable () override=default | |
| DTOR. | |
| tResult | Run (tTimeStamp tmTimeofActivation, ant::IRunnable::tActivationType ui32ActivationType, const void *pvUserData, size_t nUserDataSize) override |
| tResult | Run (tNanoSeconds tmTimeofActivation, ant::IRunnable::tActivationType ui32ActivationType, const void *pvUserData, size_t nUserDataSize) override |
| ant::IRunnable::tActivationType | GetActivationType () const override |
Public Member Functions inherited from adtf::ucom::catwo::object< Bases > | |
| tResult | GetInterface (const char *i_strIID, void *&o_pInterface) override |
| Query interfaces on an object. | |
| tResult | GetInterface (const char *i_strIID, const void *&o_pInterface) const override |
| Provides const correct interface querying. | |
| void | Destroy () const override |
| Switch from non-virtual destructor to virtual destructor. | |
Public Member Functions inherited from adtf::ucom::ant::IObject | |
| ADTF_IID (IObject, "object.ant.ucom.adtf.iid") | |
Protected Member Functions | |
| tResult | Push (tTimeStamp tmTimeofActivation) |
| internal Push operation to implement pushread mode | |
| virtual tResult | ReadNextSample (ucom::ant::iobject_ptr< const ISample > &pSample) |
| tResult | ProcessStreamItem (const IStreamItem &oStreamItem) |
| tResult | HandleStreamError (tResult nError) |
Protected Member Functions inherited from adtf::streaming::ant::sample_streamer< ISampleReader, cInPin > | |
| sample_streamer (const sample_streamer &)=delete | |
| deleted copy CTOR | |
| sample_streamer (sample_streamer &&)=delete | |
| deleted move CTOR | |
| sample_streamer & | operator= (const sample_streamer &)=delete |
| deleted copy operator | |
| sample_streamer & | operator= (sample_streamer &&)=delete |
| deleted move operator | |
| sample_streamer (const sample_streamer &)=delete | |
| deleted copy CTOR | |
| sample_streamer (sample_streamer &&)=delete | |
| deleted move CTOR | |
| sample_streamer & | operator= (const sample_streamer &)=delete |
| deleted copy operator | |
| sample_streamer & | operator= (sample_streamer &&)=delete |
| deleted move operator | |
Protected Member Functions inherited from adtf::streaming::ant::ISampleReader | |
| ~ISampleReader ()=default | |
| not destructable | |
Protected Member Functions inherited from adtf::streaming::ant::ISampleStreamer | |
| ~ISampleStreamer ()=default | |
| not destructable | |
Protected Member Functions inherited from adtf::ucom::ant::IObject | |
| ~IObject ()=default | |
| Protected destructor --> Only the final implementation can be destroyed! | |
Additional Inherited Members | |
Public Types inherited from adtf::streaming::ant::sample_streamer< ISampleReader, cInPin > | |
| typedef cInPin | pin_type |
Protected Attributes inherited from adtf::streaming::ant::sample_streamer< ISampleReader, cInPin > | |
| adtf_util::cString | m_strName |
| name of the streamer (used i.e. to create the pins name) | |
| ucom::object_ptr< const IStreamType > | m_pStreamType |
| stream type of the streamer | |
| ucom::object_ptr< cInPin > | m_poPin |
| pin reference reading/writing from | |
| adtf_util::cString | m_strName |
| name of the streamer (used i.e. to create the pins name) | |
| ucom::object_ptr< const IStreamType > | m_pStreamType |
| stream type of the streamer | |
| ucom::object_ptr< cInPin > | m_poPin |
| pin reference reading/writing from | |
Protected Attributes inherited from adtf::base::runnable< DEFAULT_ACTIVATION_TYPE, ANT_INTERFACE, flash::IRunnable, CALLABLE > | |
| std::decay_t< CALLABLE > | m_fcRunFunc |
| given function to call on Run | |
| std::decay_t< CALLABLE > | m_fcRunFunc |
| given function to call on Run | |
The default Sample Reader will read the incomung Stream of a IInPin. This sample reader has no internal queue! Make sure if you use this sample reader with ISampleStreamAccess::PushRead to register a external queue or to override the adtf::streaming::ant::cSampleReader::ReadNextSample and adtf::streaming::ant::cSampleReader::Push methods.
|
inline |
Default CTOR.
|
inline |
Default CTOR which defines the access method.
| eAccessMode | the access method. |
|
virtual |
Accept or reject a new stream type.
If the cSampleReader::SetAcceptTypeCallback method was used to set a accept sample callback method the internal meta type comparison will be replaced. The internal meta type comparison uses the IStreamMetaType::IsCompatible implementation, where the "old" type and its Stream Meta Type decides wether the incoming type is accepted or rejected.
| [in] | pStreamType | The incoming Stream Type to accept or reject. |
| ERR_INVALID_TYPE | the incoming Stream Type is not valid |
| ERR_NOERROR | the incoming Stream Type is valid |
|
inlineoverridevirtual |
BeginStreaming will open the given Sample Stream for Reading while a connection is establishing.
| pStream | [in] Sample Stream to open |
Implements adtf::streaming::ant::ISampleReader.
|
virtual |
clears the local queue of the reader either only EndStreaming or incoming event ISampleInStream::IQueueItem::RE_Flush
Implements adtf::streaming::ant::ISampleReaderQueue.
|
inlineoverridevirtual |
Sample Stream disconnected. Streaming ends.
Implements adtf::streaming::ant::ISampleStreamer.
|
inlinevirtual |
Gets the next Sample within internal queue which not has been read. param[out] pSample Sample found
| ERR_EMPTY | No Sample found. |
|
virtual |
Returns the next sample from the queue.
| [out] | oStreamItem | stream item reference to copy the references to |
Implements adtf::streaming::ant::ISampleReaderQueue.
|
inlineprotected |
This will process the stream items.
This method will cal the user hook callbacks for accepting type (cSampleReader::SetAcceptTypeCallback)
| oStreamItem | Recently read stream item. |
| ERR_INVALID_TYPE | received stream type was not accepted. |
| ERR_NOT_CONNECTED | No sample stream is connected and the cSampleReader::BeginStreaming is not called yet. |
|
virtual |
Push a new value to the internal sample queue.
| [in] | oStreamItem | The sample to store |
| [in] | tmTime | Time of storage |
Implements adtf::streaming::ant::ISampleReaderQueue.
|
inlineprotectedvirtual |
This will read the stream items until a sample is reached and return it. If another stream item type is reached than sample, cSampleReader::ProcessStreamItem will handle it.
| pSample | sample reference set if valid. |
| ERR_EMPTY | stream is empty |
| ERR_INVALID_TYPE | received stream type was not accepted. |
| ERR_NOT_CONNECTED | No sample stream is connected and the cSampleReader::BeginStreaming is not called yet. |
Reimplemented in adtf::streaming::ant::cLastSampleReader.
|
inline |
Sets a callback function which is called while a Stream Type is received.
| [in] | fnAcceptTypeCallback | The callback function is called while AcceptType is executed. It must return ERR_NOERROR to accept the type or any error to reject the new type. |
Forward an error to the corresponding stream.
| oError | [in] The error passed to the SampleStream. |
|
inline |
A callback function to react on stream errors.
| [in] | fnStreamErrorCallback | The callback function which will be called on stream errors |