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

#include <samplestream.h>

Inherits adtf::base::runnable< DEFAULT_ACTIVATION_TYPE, ANT_INTERFACE, flash::IRunnable, CALLABLE >.

Public Member Functions

 cSampleStreamBase ()
 CTOR.
 
virtual ~cSampleStreamBase () override
 DTOR.
 
tResult GetStreamError ()
 Getter for the last forwarded stream error.
 
tResult Open (const char *strName, adtf::ucom::ant::iobject_ptr< ISampleInStream > &pInStream, const adtf::ucom::ant::iobject_ptr< const IStreamType > &pInitialAcceptedStreamType, ISampleStream::IPushReadEventSink *&pPushEventSink, ISampleStreamAccess::tMode ui32Mode, size_t szQueueSize, adtf::ucom::ant::IObject *pParent)
 
tResult Open (const char *strName, adtf::ucom::ant::iobject_ptr< ISampleOutStream > &pOutStream, ISampleStreamAccess::tMode ui32Mode, size_t szQueueSize, adtf::ucom::ant::IObject *pParent)
 
tResult GetType (adtf::ucom::ant::iobject_ptr< const IStreamType > &pStreamType) const
 
tTimeStamp GetTime () const
 
tResult SetStreamError (const tResult &oError)
 
tResult AttachRouting (const adtf::ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo)
 
tResult DetachRouting (const adtf::ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo)
 
tResult SetFullName (const char *strName)
 
tResult RunTrigger (tTimeStamp tmActivationTime)
 
tResult GetInternalBindingProxy (ucom::ant::iobject_ptr< ant::IBindingProxy > &pBindingProxy)
 
void SetSubStreamFilter (const char *strSubStream)
 
uint64_t GetItemCount ()
 
void BlockSampleStreaming (bool bBlock)
 
bool IsSampleStreamingBlocked () const
 
ISampleStreamStatistics::tSampleStreamStatistic GetStatistics ()
 
void EnableSampleSizeStatistics (bool bEnable)
 
void ResetStatistics ()
 
void LogInputTrigger (tTimeStamp tmTrigger)
 
void LogOutputTrigger (tTimeStamp tmTrigger)
 
- 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

 cSampleStreamBase (const cSampleStreamBase &)=delete
 deleted copy CTOR
 
 cSampleStreamBase (cSampleStreamBase &&)=delete
 deleted move CTOR
 
cSampleStreamBaseoperator= (const cSampleStreamBase &)=delete
 deleted copy operator
 
cSampleStreamBaseoperator= (cSampleStreamBase &&)=delete
 deleted move operator
 
- Protected Member Functions inherited from adtf::ucom::ant::IObject
 ~IObject ()=default
 Protected destructor --> Only the final implementation can be destroyed!
 

Additional Inherited Members

- 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
 

Detailed Description

The implementation of the ISampleStream base implemenation. For internal use only. Consider sample stream, cSampleStream

See also
sample stream

Member Function Documentation

◆ AttachRouting()

tResult adtf::streaming::ant::detail::cSampleStreamBase::AttachRouting ( const adtf::ucom::ant::iobject_ptr< ISampleStream > & pSampleStreamTo)

Attaches a SampleStream where to route the Write / Flush and Run calls to.

This will automatically opens one writer of pSampleStreamTo and forwards the writers queue.

Parameters
[in]pSampleStreamToSampleStream where to root the writer queue to.
Returns
Standard Result Code.

◆ BlockSampleStreaming()

void adtf::streaming::ant::detail::cSampleStreamBase::BlockSampleStreaming ( bool bBlock)

Blocks the streaming of samples if bBlocked is set to true.

Parameters
[in]bBlockfalse: samples and corresponding triggers will be forwarded true: samples and corresponding triggers will not be forwarded and dropped, only stream types and their triggers are forwarded.

◆ DetachRouting()

tResult adtf::streaming::ant::detail::cSampleStreamBase::DetachRouting ( const adtf::ucom::ant::iobject_ptr< ISampleStream > & pSampleStreamTo)

Detaches a SampleStream where the routing was set by AttachRouting.

Parameters
[in]pSampleStreamToSampleStream to detach.
Returns
Standard Result Code.
Return values
ERR_NOT_FOUNDThe SampleStream given by pSampleStreamTo is not attached.

◆ EnableSampleSizeStatistics()

void adtf::streaming::ant::detail::cSampleStreamBase::EnableSampleSizeStatistics ( bool bEnable)

Enables/disables sample size statistics. Disabling can improve performance.

Parameters
[in]bEnableWhether to enable the calculation of sample size statistics.

◆ GetInternalBindingProxy()

tResult adtf::streaming::ant::detail::cSampleStreamBase::GetInternalBindingProxy ( ucom::ant::iobject_ptr< ant::IBindingProxy > & pBindingProxy)

Get the internal Binding Proxy.

Parameters
[out]pBindingProxyThe Binding Proxy, see adtf::streaming::hollow::IInternalBindingProxy.
Returns
Standard result.

◆ GetItemCount()

uint64_t adtf::streaming::ant::detail::cSampleStreamBase::GetItemCount ( )
Returns
The current amount of items that have been written to the Sample Stream.

◆ GetStatistics()

ISampleStreamStatistics::tSampleStreamStatistic adtf::streaming::ant::detail::cSampleStreamBase::GetStatistics ( )

Retrieves the statistical information of the samplestream.

Returns
Current statistic of the samplestream.

◆ GetStreamError()

tResult adtf::streaming::ant::detail::cSampleStreamBase::GetStreamError ( )

Getter for the last forwarded stream error.

Returns
Stream error;

◆ GetTime()

tTimeStamp adtf::streaming::ant::detail::cSampleStreamBase::GetTime ( ) const

Remarks
This is not yet implemented.
Returns
-1

◆ GetType()

tResult adtf::streaming::ant::detail::cSampleStreamBase::GetType ( adtf::ucom::ant::iobject_ptr< const IStreamType > & pStreamType) const

Retrieves the current type of the stream. This is only a information interface. The current type of the stream is always part of the Queues of ISampleStreamReader or ISampleStreamWriter. It will only return the last written IStreamType.

Parameters
[in,out]pStreamTypeobject_ptr to set the type reference to.
Returns
Standard Result Code

◆ IsSampleStreamingBlocked()

bool adtf::streaming::ant::detail::cSampleStreamBase::IsSampleStreamingBlocked ( ) const

Indicates wether sample streaming is blocked or not.

Return values
trueis blocked samples and their corresponding triggers are filtered
falseis not blocked

◆ LogInputTrigger()

void adtf::streaming::ant::detail::cSampleStreamBase::LogInputTrigger ( tTimeStamp tmTrigger)

Logs a trigger on the samplestream input.

Parameters
[in]tmTriggerTimestamp of the trigger.

◆ LogOutputTrigger()

void adtf::streaming::ant::detail::cSampleStreamBase::LogOutputTrigger ( tTimeStamp tmTrigger)

Logs a trigger on the samplstream output.

Parameters
[in]tmTriggerTimestamp of the trigger.

◆ Open() [1/2]

tResult adtf::streaming::ant::detail::cSampleStreamBase::Open ( const char * strName,
adtf::ucom::ant::iobject_ptr< ISampleInStream > & pInStream,
const adtf::ucom::ant::iobject_ptr< const IStreamType > & pInitialAcceptedStreamType,
ISampleStream::IPushReadEventSink *& pPushEventSink,
ISampleStreamAccess::tMode ui32Mode,
size_t szQueueSize,
adtf::ucom::ant::IObject * pParent )

Opens The SampleStream for reading access. To receive data you need to read from given pReader. See also ISampleStreamReader::Read. The pInStream will automatically closes until it is destroyed by its reference counting. Usually you should only keep your private Reader instance to make sure the Reader will safely close !

Parameters
[in]strNameName of the reader (is not yet relevant in default implementation cSampleStream but may be in future).
[in,out]pInStreamobject_ptr where to put the in stream reference to (Recommended: keep it private).
[in]pInitialAcceptedStreamTypeThe StreamType you want to receive, but this might not be the streamtype you will get from the writers!
[in]pPushEventSinkReference to a PushRead EventSink. This parameter neead to be valid only if you open in ISampleStreamAccess::tMode::PushRead. Make sure this instance exists until the the Reader closes. (so again ... Recommended: keep your Reader private)
[in]ui32ModeMode to open. see ISampleStreamAccess::tMode.
[in]szQueueSizeQueueSize of the Reader. In PushRead this should be 0 because a Reader will not have a real internal queue.
Returns
Standard Result Code.
See also
sample stream
Parameters
[in]pParentconcreate sample_stream implementation

◆ Open() [2/2]

tResult adtf::streaming::ant::detail::cSampleStreamBase::Open ( const char * strName,
adtf::ucom::ant::iobject_ptr< ISampleOutStream > & pOutStream,
ISampleStreamAccess::tMode ui32Mode,
size_t szQueueSize,
adtf::ucom::ant::IObject * pParent )

Opens The SampleStream for writing access. To write data you need to write to the given pWriter. See also ISampleOutStream::Write. The pOutStream will automatically closes until it is destroyed by its reference counting. Usually you should only keep your private Writer instance to make sure the Writer will safely close !

Parameters
[in]strNameName of the reader (is not yet relevant in default implementation cSampleStream but may be in future).
[in,out]pOutStreamobject_ptr where to put the out stream reference to (Recommended: keep it private).
[in]ui32ModeMode to open. see ISampleStreamAccess::tMode.
[in]szQueueSizeQueueSize of the Writer. In PushRead this should be 0 because a Writer will have an unlimited Queue. If you set a queue size > 0 all QueueContent will be dropped if you do not flush before the maximum queue size is reached. Keep in mind Sample/StreamType/Error are part of the Queue!
[in]pParentconcreate sample_stream implementation
Returns
Standard Result Code.
See also
sample stream

◆ ResetStatistics()

void adtf::streaming::ant::detail::cSampleStreamBase::ResetStatistics ( )

Resets statistical information.

◆ RunTrigger()

tResult adtf::streaming::ant::detail::cSampleStreamBase::RunTrigger ( tTimeStamp tmActivationTime)

Internal Run implementation

Parameters
tmActivationTime[in] TimeSTamp of a activation
Return values
ERR_NOERRORSuccesfully run.

◆ SetFullName()

tResult adtf::streaming::ant::detail::cSampleStreamBase::SetFullName ( const char * strName)

Set the name which is used for error handling etc.

Parameters
[in]strNameThe name.
Returns
Standard result.

◆ SetStreamError()

tResult adtf::streaming::ant::detail::cSampleStreamBase::SetStreamError ( const tResult & oError)

Sets and forwards a StreamError to the readers. Depending on the implementation and error type this may stop the streaming!

Parameters
[in]oErrorError to set
Returns
Standard Result Code.

◆ SetSubStreamFilter()

void adtf::streaming::ant::detail::cSampleStreamBase::SetSubStreamFilter ( const char * strSubStream)

If set, only Stream Types and Samples of the given Substream mwill be forwarded.

Parameters
[in]strSubStreamThe name of the Substream.

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