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

#include <samplestream.h>

Inherits adtf::ucom::ant::enable_object_ptr_from_this< ISampleStream >, and adtf::streaming::hollow::IStreamTypeHandler.

Inherited by adtf::streaming::sample_stream<>, adtf::streaming::sample_stream< IStreamingPort, IStreamingInPort, ISampleStreamInPort >, adtf::streaming::sample_stream< IStreamingPort, IStreamingOutPort, ISampleStreamOutPort >, and adtf::streaming::sample_stream< INTERFACES >.

Public Member Functions

 cSampleStreamBase (cTriggerPipeItemBase &oPipeItem, ISampleStream &oSelf) noexcept
 
 cSampleStreamBase (const cSampleStreamBase &)=delete
 
cSampleStreamBase & operator= (const cSampleStreamBase &)=delete
 
tResult GetType (ucom::ant::iobject_ptr< const IStreamType > &pStreamType) const noexcept
 
tResult SetStreamError (const tResult &oError) noexcept
 
tResult AttachRouting (const ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo) noexcept
 
tResult DetachRouting (const ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo) noexcept
 
tResult Open (ucom::ant::iobject_ptr< ISampleInStream > &pInStream, ISampleStream::IPushReadEventSink *&pPushEventSink, ISampleStreamAccess::tMode ui32Mode, size_t szQueueSize) noexcept
 
tResult Open (ucom::ant::iobject_ptr< ISampleOutStream > &pOutStream, ISampleStreamAccess::tMode ui32Mode, size_t szQueueSize) noexcept
 
tResult RegisterSubItem (const ucom::ant::iobject_ptr< ITriggerPipeItem > &pSubRun, ITriggerPipeItem::tPriority ui32Prio) noexcept
 
tResult UnregisterSubItem (const ucom::ant::iobject_ptr< ITriggerPipeItem > &pSubRun) noexcept
 
tResult GetInternalBindingProxy (ucom::ant::iobject_ptr< IBindingProxy > &pBindingProxy) noexcept
 
void BlockSampleStreaming (bool bBlock) noexcept
 
bool IsSampleStreamingBlocked () const noexcept
 
wolverine::ISampleStreamStatistics::tSampleStreamStatistic GetStatistics () noexcept
 
void EnableSampleSizeStatistics (bool bEnable) noexcept
 
void ResetStatistics () noexcept
 
void SetForwardAllTriggers (bool bForwardAll) noexcept
 
void SetSubStreamFilter (const char *strSubStream) noexcept
 
- Public Member Functions inherited from adtf::ucom::ant::enable_object_ptr_from_this< ISampleStream >
object_ptr< ISampleStream > object_ptr_from_this ()
 Retrieve an object_ptr with *this being the shared resource.
 
object_ptr< const ISampleStream > object_ptr_from_this () const
 Retrieve an object_ptr with *this being the shared resource - const correct.
 

Additional Inherited Members

- Protected Member Functions inherited from adtf::ucom::ant::enable_object_ptr_from_this< ISampleStream >
 enable_object_ptr_from_this ()=default
 Default constructor.
 
 enable_object_ptr_from_this (const enable_object_ptr_from_this &)=default
 Default copy construction.
 
 ~enable_object_ptr_from_this ()=default
 Default destructor.
 
enable_object_ptr_from_this & operator= (const enable_object_ptr_from_this &)=default
 Default copy assignment.
 

Detailed Description

The implementation of a sample stream, shared by adtf::streaming::cSampleStream and the sample stream ports. It is not a ucom object itself, so that every adtf::streaming::sample_stream can bring its own set of interfaces while they all fold into each other.

A stream that is attached to another one hands its sinks over to it, so that the writer of the first stream of a chain pushes directly to the readers of the last one and a single trigger runs the sub items of the whole chain in the order the nested trigger pipe items would have run them.

Constructor & Destructor Documentation

◆ cSampleStreamBase()

adtf::streaming::detail::cSampleStreamBase::cSampleStreamBase ( cTriggerPipeItemBase & oPipeItem,
ISampleStream & oSelf )
noexcept
Parameters
[in]oPipeItemThe trigger pipe item of the sample stream, which runs the sinks.
[in]oSelfThe sample stream itself, used for its name and as the trigger pipe source.

Member Function Documentation

◆ AttachRouting()

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

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::detail::cSampleStreamBase::BlockSampleStreaming ( bool bBlock)
noexcept

Blocks the streaming of samples if bBlock 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::detail::cSampleStreamBase::DetachRouting ( const ucom::ant::iobject_ptr< ISampleStream > & pSampleStreamTo)
noexcept

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::detail::cSampleStreamBase::EnableSampleSizeStatistics ( bool bEnable)
noexcept

Enables/disables the tracking of sample size statistics. For better performance this can be turned off.

Parameters
[in]bEnableWhether to enable sample size statistics.

◆ GetInternalBindingProxy()

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

Retrieve the internal binding proxy.

Parameters
[out]pBindingProxyThis will be updated to point to the proxy.
Returns
Standard result.

◆ GetStatistics()

wolverine::ISampleStreamStatistics::tSampleStreamStatistic adtf::streaming::detail::cSampleStreamBase::GetStatistics ( )
noexcept

Calculates and retrieves the statistical information.

Returns
Statistic information object.

◆ GetType()

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

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::detail::cSampleStreamBase::IsSampleStreamingBlocked ( ) const
noexcept

Indicates wether sample streaming is blocked or not.

Return values
truesample stream is blocking samples and their corresponding triggers.
falsesample stream is not blocked.

◆ Open() [1/2]

tResult adtf::streaming::detail::cSampleStreamBase::Open ( ucom::ant::iobject_ptr< ISampleInStream > & pInStream,
ISampleStream::IPushReadEventSink *& pPushEventSink,
ISampleStreamAccess::tMode ui32Mode,
size_t szQueueSize )
noexcept

Opens the sample stream for reading access, see ant::ISampleStream.

Parameters
[in,out]pInStreamobject_ptr where to put the in stream reference to.
[in]pPushEventSinkReference to a PushRead EventSink. Both supported modes require it, and it has to exist until the reader closes.
[in]ui32ModeMode to open, see ISampleStreamAccess::tMode. This implementation only supports ISampleStreamAccess::tMode::Push and ISampleStreamAccess::tMode::PushRead.
[in]szQueueSizeQueueSize of the reader. This implementation only supports 0, its readers have no internal queue.
Returns
Standard Result Code, ERR_NOT_SUPPORTED for any other mode or queue size and ERR_INVALID_ARG without an event sink.

◆ Open() [2/2]

tResult adtf::streaming::detail::cSampleStreamBase::Open ( ucom::ant::iobject_ptr< ISampleOutStream > & pOutStream,
ISampleStreamAccess::tMode ui32Mode,
size_t szQueueSize )
noexcept

Opens the sample stream for writing access, see ant::ISampleStream.

Parameters
[in,out]pOutStreamobject_ptr where to put the out stream reference to.
[in]ui32ModeMode to open, see ISampleStreamAccess::tMode. This implementation only supports ISampleStreamAccess::tMode::PushRead.
[in]szQueueSizeQueueSize of the out stream. This implementation only supports 0, its writers have no internal queue.
Returns
Standard Result Code, ERR_NOT_SUPPORTED for any other mode or queue size and ERR_DEVICE_IN_USE if the stream already has a writer or is attached to another one.

◆ RegisterSubItem()

tResult adtf::streaming::detail::cSampleStreamBase::RegisterSubItem ( const ucom::ant::iobject_ptr< ITriggerPipeItem > & pSubRun,
ITriggerPipeItem::tPriority ui32Prio )
noexcept

Registers the pSubRun as SubItem of the source. The source will forward a Run call to every registered ITriggerPipeItem in order of ui32Prio.

Parameters
[in]pSubRunTriggerPipeItem to register.
[in]ui32PrioPriority of Run call.
Returns
Standard Result Code.

◆ ResetStatistics()

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

Resets statistical information.

◆ SetForwardAllTriggers()

void adtf::streaming::detail::cSampleStreamBase::SetForwardAllTriggers ( bool bForwardAll)
noexcept

If set, every trigger is forwarded to the sub items, otherwise only those that brought new items.

Remarks
Both policies are read when the sinks are built, so they have to be set before this stream is opened or attached.

◆ SetStreamError()

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

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::detail::cSampleStreamBase::SetSubStreamFilter ( const char * strSubStream)
noexcept

Selects the substream everything below this stream gets to see, an empty name lets all of them pass. If set, every trigger is forwarded to the sub items, otherwise only those that brought new items.

Remarks
Both policies are read when the sinks are built, so they have to be set before this stream is opened or attached.

◆ UnregisterSubItem()

tResult adtf::streaming::detail::cSampleStreamBase::UnregisterSubItem ( const ucom::ant::iobject_ptr< ITriggerPipeItem > & pSubRun)
noexcept

Unregisters the pSubRun from the source.

Parameters
[in]pSubRunTriggerPipeItem to unregister.
Returns
Standard Result Code.

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