ADTF  3.18.2
cSampleStreamBase

The implementation of the ISampleStream base implemenation. More...

Inheritance diagram for cSampleStreamBase:
[legend]

Public Member Functions

 cSampleStreamBase ()
 CTOR.
 
virtual ~cSampleStreamBase ()=default
 DTOR.
 
tResult GetStreamError ()
 Getter for the last forwarded stream error. More...
 
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)
 Opens The SampleStream for reading access. More...
 
tResult 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. More...
 
tResult GetType (adtf::ucom::ant::iobject_ptr< const IStreamType > &pStreamType) const
 Retrieves the current type of the stream. More...
 
tTimeStamp GetTime () const
 Returns the last flush time and so the current position of the stream. More...
 
tResult SetStreamError (const tResult &oError)
 Sets and forwards a StreamError to the readers. More...
 
tResult AttachRouting (const adtf::ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo)
 Attaches a SampleStream where to route the Write / Flush and Run calls to. More...
 
tResult DetachRouting (const adtf::ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo)
 Detaches a SampleStream where the routing was set by AttachRouting. More...
 
tResult SetFullName (const char *strName)
 Set the name which is used for error handling etc. More...
 
tResult RunTrigger (tTimeStamp tmActivationTime)
 Internal Run implementation. More...
 
tResult GetInternalBindingProxy (ucom::ant::iobject_ptr< ant::IBindingProxy > &pBindingProxy)
 Get the internal Binding Proxy. More...
 
void SetSubStreamFilter (const char *strSubStream)
 If set, only Stream Types and Samples of the given Substream mwill be forwarded. More...
 
uint64_t GetItemCount ()
 
- Public Member Functions inherited from runnable< adtf::base::ant::IRunnable::RUN_TRIGGER >
 runnable ()
 CTOR.
 
 runnable (IRunnable::tRunFunction fcRunOnceFunc)
 Main CTOR with callable function. More...
 
virtual ~runnable ()=default
 DTOR.
 
tResult Run (tTimeStamp tmTimeofActivation, IRunnable::tActivationType ui32ActivationType, const void *, size_t) override
 IRunnable::Run implementation which will call m_fcRunOnceFunc if ui32ActivationType is TYPE_OF_ACTIVATION. More...
 
virtual IRunnable::tActivationType GetActivationType () const
 Returns the type of activation implemented. More...
 
- Public Member Functions inherited from object< IRunnable, IRunnable >
tResult GetInterface (const char *i_strIID, void *&o_pInterface) override
 Query interfaces on an object. More...
 
tResult GetInterface (const char *i_strIID, const void *&o_pInterface) const override
 Provides const correct interface querying. More...
 
void Destroy () const override
 Destruct and deallocate instantiations of type IObject. More...
 
- Public Member Functions inherited from IObject
 ADTF_IID (IObject, "object.ant.ucom.adtf.iid")
 Marks the IObject to be castable with the ucom_cast() More...
 

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 IObject
 ~IObject ()=default
 Protected destructor --> Use implemented Destroy() instead of delete!
 

Private Member Functions

 A_UTILS_D (cSampleStreamBase)
 private d-pointer
 

Additional Inherited Members

- Protected Attributes inherited from runnable< adtf::base::ant::IRunnable::RUN_TRIGGER >
IRunnable::tRunFunction m_fcRunOnceFunc
 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

Definition at line 37 of file samplestream.h.

Member Function Documentation

◆ AttachRouting()

tResult 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.

Referenced by sample_stream< INTERFACE >::AttachRouting().

◆ DetachRouting()

tResult 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.

Referenced by sample_stream< INTERFACE >::DetachRouting().

◆ GetInternalBindingProxy()

tResult 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 GetItemCount ( )
Returns
The current amount of items that have been written to the Sample Stream.

◆ GetStreamError()

tResult GetStreamError ( )

Getter for the last forwarded stream error.

Returns
Stream error;

◆ GetTime()

tTimeStamp GetTime ( ) const

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

Remarks
This is not yet implemented.
Returns
-1

Referenced by sample_stream< INTERFACE >::GetTime().

◆ GetType()

tResult 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

◆ Open() [1/2]

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 
)

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 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

◆ RunTrigger()

tResult RunTrigger ( tTimeStamp  tmActivationTime)

Internal Run implementation.

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

◆ SetFullName()

tResult SetFullName ( const char *  strName)

Set the name which is used for error handling etc.

Parameters
[in]strNameThe name.
Returns
Standard result.

◆ SetStreamError()

tResult 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.

Referenced by sample_stream< INTERFACE >::SetStreamError().

◆ SetSubStreamFilter()

void 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.