ADTF
Loading...
Searching...
No Matches
adtf::streaming::sample_stream< INTERFACES > Class Template Reference

#include <samplestream.h>

Inherits adtf::streaming::ant::ISampleStream, adtf::streaming::ant::ITriggerPipeSource, adtf::streaming::ant::ITriggerPipeItem, base::ant::INamedGraphObject, adtf::streaming::hollow::IInternalBindingProxy, adtf::streaming::vision::IBlockableSampleStream, adtf::streaming::wolverine::ISampleStreamStatistics, adtf::ucom::catwo::object< Bases >, and adtf::streaming::detail::cSampleStreamBase.

Public Member Functions

 sample_stream ()
 Creates a sample stream without a name.
 
 sample_stream (const char *strName)
 
tResult GetType (ucom::ant::iobject_ptr< const IStreamType > &pStreamType) const noexcept override
 
tTimeStamp GetTime () const noexcept override
 
tResult SetStreamError (const tResult &oError) noexcept override
 
tResult AttachRouting (const ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo) noexcept override
 
tResult DetachRouting (const ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo) noexcept override
 
tResult Open (const char *strName, ucom::ant::iobject_ptr< ISampleInStream > &pInStream, const ucom::ant::iobject_ptr< const IStreamType > &pInitialAcceptedStreamType, ISampleStream::IPushReadEventSink *&pPushEventSink, ISampleStreamAccess::tMode ui32Mode, size_t szQueueSize) noexcept override
 
tResult Open (const char *strName, ucom::ant::iobject_ptr< ISampleOutStream > &pOutStream, ISampleStreamAccess::tMode ui32Mode, size_t szQueueSize) noexcept override
 
tResult RegisterSubItem (const ucom::ant::iobject_ptr< ITriggerPipeItem > &pSubRun, ITriggerPipeItem::tPriority ui32Prio) noexcept override
 
tResult UnregisterSubItem (const ucom::ant::iobject_ptr< ITriggerPipeItem > &pSubRun) noexcept override
 
tResult ChangePriority (const ucom::ant::iobject_ptr< ITriggerPipeItem > &, ITriggerPipeItem::tPriority) noexcept override
 
tResult GetInternalBindingProxy (ucom::ant::iobject_ptr< IBindingProxy > &pBindingProxy) noexcept override
 
void BlockSampleStreaming (bool bBlock) noexcept override
 
bool IsSampleStreamingBlocked () const noexcept override
 
wolverine::ISampleStreamStatistics::tSampleStreamStatistic GetStatistics () noexcept override
 
void EnableSampleSizeStatistics (bool bEnable) noexcept override
 
void ResetStatistics () noexcept override
 
- Public Member Functions inherited from adtf::streaming::ant::ISampleStream
 ADTF_IID (ISampleStream, "samplestream.ant.streaming.adtf.iid")
 definition of interface identifier
 
virtual tResult Open (const char *strName, adtf::ucom::ant::iobject_ptr< ISampleInStream > &pInStream, const adtf::ucom::ant::iobject_ptr< const IStreamType > &pInitialAcceptedStreamType, IPushReadEventSink *&pPushEventSink, ISampleStreamAccess::tMode ui32Mode, size_t szQueueSize)=0
 
virtual tResult Open (const char *strName, adtf::ucom::ant::iobject_ptr< ISampleOutStream > &pOutStream, ISampleStreamAccess::tMode ui32Mode, size_t szQueueSize)=0
 
- Public Member Functions inherited from adtf::streaming::ant::ITriggerPipeItem
 ADTF_IID (ITriggerPipeItem, "trigger_pipe_item.ant.streaming.adtf.iid")
 Definition of interface ID.
 
- Public Member Functions inherited from adtf::base::ant::IRunnable
 ADTF_IID (IRunnable, "runnable.ant.base.adtf.iid")
 defintion of interface id
 
 ADTF3_DEPRECATED ("Use adtf::base::flash::IRunnable::Run(tNanoSeconds tmTimeofActivation, ant::IRunnable::tActivationType " "ui32ActivationType, const void* pvUserData, size_t nUserDataSize) instead.") virtual tResult Run(tTimeStamp tmTimeofActivation
 
virtual tActivationType GetActivationType () const
 
- Public Member Functions inherited from adtf::streaming::ant::ITriggerPipeSource
 ADTF_IID (ITriggerPipeSource, "trigger_pipe_source.ant.streaming.adtf.iid")
 definiton of interface id
 
virtual tResult GetSubItems (adtf::ucom::ant::iobject_enum< const ITriggerPipeItem > &lstSubItems) const =0
 
- Public Member Functions inherited from adtf::ucom::ant::IObject
 ADTF_IID (IObject, "object.ant.ucom.adtf.iid")
 
- Public Member Functions inherited from adtf::streaming::ant::INamedGraphObject
 ADTF_IID (INamedGraphObject, "namedgraphobject.ant.streaming.adtf.iid")
 defintion of interface id
 
virtual tResult GetName (base::ant::IString &&strName) const =0
 
virtual tResult SetName (const char *strName)=0
 
virtual tResult SetParent (const ucom::ant::IObject *oParentObject)=0
 
virtual tResult GetParent (const ucom::ant::IObject *&poParentObject) const =0
 
- Public Member Functions inherited from adtf::streaming::hollow::IInternalBindingProxy
 ADTF_IID (IInternalBindingProxy, "internal_binding_proxy.hollow.streaming.adtf.iid")
 definition of interface id
 
- Public Member Functions inherited from adtf::streaming::vision::IBlockableSampleStream
 ADTF_IID (IBlockableSampleStream, "blockable_samplestream.vision.streaming.adtf.iid")
 definition of interface identifier
 
- Public Member Functions inherited from adtf::streaming::wolverine::ISampleStreamStatistics
 ADTF_IID (ISampleStreamStatistics, "samplestream_statistics.wolverine.streaming.adtf.iid")
 definition of interface identifier
 
- 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::streaming::detail::cSampleStreamBase
 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

- Public Types inherited from adtf::base::ant::IRunnable
enum  tActivationType : uint32_t {
  RUN_UNSPECIFIED = 0 , RUN_TIMER = 1 , RUN_SIGNAL = 2 , RUN_EXCEPTION = 3 ,
  RUN_MESSAGE = 5 , RUN_THREAD = 6 , RUN_JOB = 7 , RUN_TRIGGER = 8 ,
  RUN_PUSH = 9 , RUN_USER = 0x1000
}
 
typedef std::function< tResult(tTimeStamp)> tRunFunction
 Type definition of the function used to implement Run.
 
- Public Types inherited from adtf::streaming::ant::ITriggerPipeSource
enum  tPriority : uint32_t {
  Invalid = 0 , Lowest = 1 , Lower = 30 , BelowNormal = 40 ,
  Normal = 50 , AboveNormal = 60 , Higher = 70 , Highest = 100
}
 
- Public Types inherited from adtf::streaming::wolverine::ISampleStreamStatistics
using tSampleStreamStatistic = adtf::services::wolverine::ISampleStreamTracer::tTraceData
 structure containing the current samplestream statistics for samplestream input and output
 
- Public Attributes inherited from adtf::base::ant::IRunnable
tActivationType ui32ActivationType
 
tActivationType const void * pvUserData
 
tActivationType const void size_t nUserDataSize = 0
 
- Protected Member Functions inherited from adtf::streaming::ant::ISampleStream
 ~ISampleStream ()=default
 not destructable
 
- Protected Member Functions inherited from adtf::streaming::ant::ITriggerPipeItem
 ~ITriggerPipeItem ()=default
 not destructable
 
- Protected Member Functions inherited from adtf::base::ant::IRunnable
 ~IRunnable ()=default
 not destructable
 
- Protected Member Functions inherited from adtf::streaming::ant::ITriggerPipeSource
 ~ITriggerPipeSource ()=default
 not destructable
 
- Protected Member Functions inherited from adtf::ucom::ant::IObject
 ~IObject ()=default
 Protected destructor --> Only the final implementation can be destroyed!
 
- Protected Member Functions inherited from adtf::streaming::ant::INamedGraphObject
 ~INamedGraphObject ()=default
 not destructable
 
- Protected Member Functions inherited from adtf::streaming::hollow::IInternalBindingProxy
 ~IInternalBindingProxy ()=default
 not destructable
 
- Protected Member Functions inherited from adtf::streaming::vision::IBlockableSampleStream
virtual ~IBlockableSampleStream ()=default
 
- Protected Member Functions inherited from adtf::streaming::wolverine::ISampleStreamStatistics
 ~ISampleStreamStatistics ()=default
 not destructable
 
- 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

template<typename... INTERFACES>
class adtf::streaming::sample_stream< INTERFACES >

Helper template to implement a sample stream that exposes further interfaces, like the sample stream ports do. Every instantiation shares detail::cSampleStreamBase, so they all fold into each other.

Template Parameters
INTERFACESAdditional interfaces to expose, they are added after ant::ISampleStream.

Constructor & Destructor Documentation

◆ sample_stream()

template<typename... INTERFACES>
adtf::streaming::sample_stream< INTERFACES >::sample_stream ( const char * strName)
inline

Creates a sample stream and names it.

Parameters
[in]strNameName of the stream.

Member Function Documentation

◆ AttachRouting()

template<typename... INTERFACES>
tResult adtf::streaming::sample_stream< INTERFACES >::AttachRouting ( const ucom::ant::iobject_ptr< ISampleStream > & pSampleStreamTo)
inlineoverridevirtualnoexcept

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.

Implements adtf::streaming::ant::ISampleStream.

◆ BlockSampleStreaming()

template<typename... INTERFACES>
void adtf::streaming::sample_stream< INTERFACES >::BlockSampleStreaming ( bool bBlock)
inlineoverridevirtualnoexcept

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.

Implements adtf::streaming::vision::IBlockableSampleStream.

◆ ChangePriority()

template<typename... INTERFACES>
tResult adtf::streaming::sample_stream< INTERFACES >::ChangePriority ( const ucom::ant::iobject_ptr< ITriggerPipeItem > & ,
ITriggerPipeItem::tPriority  )
inlineoverridevirtualnoexcept

Remarks
The order of the sinks of a whole chain is established while they are registered.
Returns
ERR_NOT_SUPPORTED

Implements adtf::streaming::ant::ITriggerPipeSource.

◆ DetachRouting()

template<typename... INTERFACES>
tResult adtf::streaming::sample_stream< INTERFACES >::DetachRouting ( const ucom::ant::iobject_ptr< ISampleStream > & pSampleStreamTo)
inlineoverridevirtualnoexcept

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.

Implements adtf::streaming::ant::ISampleStream.

◆ EnableSampleSizeStatistics()

template<typename... INTERFACES>
void adtf::streaming::sample_stream< INTERFACES >::EnableSampleSizeStatistics ( bool bEnable)
inlineoverridevirtualnoexcept

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

Parameters
[in]bEnableWhether to enable sample size statistics.

Implements adtf::streaming::wolverine::ISampleStreamStatistics.

◆ GetInternalBindingProxy()

template<typename... INTERFACES>
tResult adtf::streaming::sample_stream< INTERFACES >::GetInternalBindingProxy ( ucom::ant::iobject_ptr< IBindingProxy > & pBindingProxy)
inlineoverridevirtualnoexcept

Retrieve the internal binding proxy.

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

Implements adtf::streaming::hollow::IInternalBindingProxy.

◆ GetStatistics()

template<typename... INTERFACES>
wolverine::ISampleStreamStatistics::tSampleStreamStatistic adtf::streaming::sample_stream< INTERFACES >::GetStatistics ( )
inlineoverridevirtualnoexcept

Calculates and retrieves the statistical information.

Returns
Statistic information object.
Remarks
The wall time an item arrived at is taken whenever the statistics are polled, so it is only as exact as the polling is frequent.

Implements adtf::streaming::wolverine::ISampleStreamStatistics.

◆ GetTime()

template<typename... INTERFACES>
tTimeStamp adtf::streaming::sample_stream< INTERFACES >::GetTime ( ) const
inlineoverridevirtualnoexcept

Returns the last flush time and so the current position of the stream.

Returns
The current time of the stream.
Remarks
This is not implemented, the sample stream does not keep track of the stream time.
Returns
0

Implements adtf::streaming::ant::ISampleStream.

◆ GetType()

template<typename... INTERFACES>
tResult adtf::streaming::sample_stream< INTERFACES >::GetType ( ucom::ant::iobject_ptr< const IStreamType > & pStreamType) const
inlineoverridevirtualnoexcept

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

Implements adtf::streaming::ant::ISampleStream.

◆ IsSampleStreamingBlocked()

template<typename... INTERFACES>
bool adtf::streaming::sample_stream< INTERFACES >::IsSampleStreamingBlocked ( ) const
inlineoverridevirtualnoexcept

Indicates wether sample streaming is blocked or not.

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

Implements adtf::streaming::vision::IBlockableSampleStream.

◆ Open() [1/2]

template<typename... INTERFACES>
tResult adtf::streaming::sample_stream< INTERFACES >::Open ( const char * strName,
ucom::ant::iobject_ptr< ISampleInStream > & pInStream,
const ucom::ant::iobject_ptr< const IStreamType > & pInitialAcceptedStreamType,
ISampleStream::IPushReadEventSink *& pPushEventSink,
ISampleStreamAccess::tMode ui32Mode,
size_t szQueueSize )
inlineoverridenoexcept

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
Remarks
This implementation only supports szQueueSize = 0 and ui32Mode = ISampleStreamAccess::tMode::Push or ISampleStreamAccess::tMode::PushRead.

◆ Open() [2/2]

template<typename... INTERFACES>
tResult adtf::streaming::sample_stream< INTERFACES >::Open ( const char * strName,
ucom::ant::iobject_ptr< ISampleOutStream > & pOutStream,
ISampleStreamAccess::tMode ui32Mode,
size_t szQueueSize )
inlineoverridenoexcept

Opens The SampleStream for writing access. To write data you need to write to the given pWriter. See also ISampleStreamWriter::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 out stream. 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!
Returns
Standard Result Code.
See also
sample stream
Remarks
This implementation only supports szQueueSize = 0 and ui32Mode = ISampleStreamAccess::tMode::PushRead.

◆ RegisterSubItem()

template<typename... INTERFACES>
tResult adtf::streaming::sample_stream< INTERFACES >::RegisterSubItem ( const ucom::ant::iobject_ptr< ITriggerPipeItem > & pSubRun,
ITriggerPipeItem::tPriority ui32Prio )
inlineoverridevirtualnoexcept

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.

Implements adtf::streaming::ant::ITriggerPipeSource.

◆ ResetStatistics()

template<typename... INTERFACES>
void adtf::streaming::sample_stream< INTERFACES >::ResetStatistics ( )
inlineoverridevirtualnoexcept

Resets statistical information.

Implements adtf::streaming::wolverine::ISampleStreamStatistics.

◆ SetStreamError()

template<typename... INTERFACES>
tResult adtf::streaming::sample_stream< INTERFACES >::SetStreamError ( const tResult & oError)
inlineoverridevirtualnoexcept

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.

Implements adtf::streaming::ant::ISampleStream.

◆ UnregisterSubItem()

template<typename... INTERFACES>
tResult adtf::streaming::sample_stream< INTERFACES >::UnregisterSubItem ( const ucom::ant::iobject_ptr< ITriggerPipeItem > & pSubRun)
inlineoverridevirtualnoexcept

Unregisters the pSubRun from the source.

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

Implements adtf::streaming::ant::ITriggerPipeSource.


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