ADTF
Loading...
Searching...
No Matches
adtf::streaming::ant::cLastSampleReader Class Reference

Sample reader which always provides the last successful received sample. More...

#include <samplereader.h>

Inherits adtf::streaming::ant::cSampleReader.

Public Member Functions

tResult GetLastSample (ucom::ant::iobject_ptr< const ISample > &pSample)
 
void Reset () override
 
 cSampleReader ()
 
 cSampleReader (ISampleStreamAccess::tMode eAccessMode)
 
- Public Member Functions inherited from adtf::streaming::ant::cSampleReader
 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 ReadNextSample (ucom::ant::iobject_ptr< const ISample > &pSample) override
 Collect the next sample by overriding the adtf::streaming::ant::cSampleReader::ReadNextSample.
 
- Protected Member Functions inherited from adtf::streaming::ant::cSampleReader
tResult Push (tTimeStamp tmTimeofActivation)
 internal Push operation to implement pushread mode
 
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_streameroperator= (const sample_streamer &)=delete
 deleted copy operator
 
sample_streameroperator= (sample_streamer &&)=delete
 deleted move operator
 
 sample_streamer (const sample_streamer &)=delete
 deleted copy CTOR
 
 sample_streamer (sample_streamer &&)=delete
 deleted move CTOR
 
sample_streameroperator= (const sample_streamer &)=delete
 deleted copy operator
 
sample_streameroperator= (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!
 

Protected Attributes

ucom::object_ptr< const ISamplem_pLastValidSample
 Last Sample Reference.
 
- 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 IStreamTypem_pStreamType
 stream type of the streamer
 
ucom::object_ptr< cInPinm_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 IStreamTypem_pStreamType
 stream type of the streamer
 
ucom::object_ptr< cInPinm_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
 

Additional Inherited Members

- Public Types inherited from adtf::streaming::ant::sample_streamer< ISampleReader, cInPin >
typedef cInPin pin_type
 

Detailed Description

Sample reader which always provides the last successful received sample.

Member Function Documentation

◆ cSampleReader() [1/2]

adtf::streaming::ant::cSampleReader::cSampleReader ( )
inline

Default CTOR.

◆ cSampleReader() [2/2]

adtf::streaming::ant::cSampleReader::cSampleReader ( ISampleStreamAccess::tMode eAccessMode)
inline

Default CTOR which defines the access method.

Parameters
eAccessModethe access method.
Remarks
Only PushRead access methed is implemented at the moment.

◆ GetLastSample()

tResult adtf::streaming::ant::cLastSampleReader::GetLastSample ( ucom::ant::iobject_ptr< const ISample > & pSample)
inline

Returns the last Sample received. It will always return the last sample received if at least one was within queue. If no sample received since last successfully call the last sample will be returned again. param[out] pSample Sample found

Returns
Standard Result Code
Return values
ERR_EMPTYNo Sample found.

◆ ReadNextSample()

tResult adtf::streaming::ant::cLastSampleReader::ReadNextSample ( ucom::ant::iobject_ptr< const ISample > & pSample)
inlineoverrideprotectedvirtual

Collect the next sample by overriding the adtf::streaming::ant::cSampleReader::ReadNextSample.

Reimplemented from adtf::streaming::ant::cSampleReader.


The documentation for this class was generated from the following file: