ADTF
|
The implementation of the ISampleStream base implemenation. More...
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 | |
cSampleStreamBase & | operator= (const cSampleStreamBase &)=delete |
deleted copy operator | |
cSampleStreamBase & | operator= (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 | |
The implementation of the ISampleStream base implemenation.
For internal use only. Consider Sample Stream, cSampleStream
Definition at line 37 of file samplestream.h.
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.
[in] | pSampleStreamTo | SampleStream where to root the writer queue to. |
Referenced by sample_stream< INTERFACE >::AttachRouting().
tResult DetachRouting | ( | const adtf::ucom::ant::iobject_ptr< ISampleStream > & | pSampleStreamTo | ) |
Detaches a SampleStream where the routing was set by AttachRouting.
[in] | pSampleStreamTo | SampleStream to detach. |
ERR_NOT_FOUND | The SampleStream given by pSampleStreamTo is not attached. |
Referenced by sample_stream< INTERFACE >::DetachRouting().
tResult GetInternalBindingProxy | ( | ucom::ant::iobject_ptr< ant::IBindingProxy > & | pBindingProxy | ) |
Get the internal Binding Proxy.
[out] | pBindingProxy | The Binding Proxy, see adtf::streaming::hollow::IInternalBindingProxy. |
uint64_t GetItemCount | ( | ) |
tResult GetStreamError | ( | ) |
Getter for the last forwarded stream error.
tTimeStamp GetTime | ( | ) | const |
Returns the last flush time and so the current position of the stream.
Referenced by sample_stream< INTERFACE >::GetTime().
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.
[in,out] | pStreamType | object_ptr to set the type reference to. |
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 !
[in] | strName | Name of the reader (is not yet relevant in default implementation cSampleStream but may be in future). |
[in,out] | pInStream | object_ptr where to put the in stream reference to (Recommended: keep it private). |
[in] | pInitialAcceptedStreamType | The StreamType you want to receive, but this might not be the streamtype you will get from the writers! |
[in] | pPushEventSink | Reference 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] | ui32Mode | Mode to open. see ISampleStreamAccess::tMode. |
[in] | szQueueSize | QueueSize of the Reader. In PushRead this should be 0 because a Reader will not have a real internal queue. |
[in] | pParent | concreate sample_stream implementation |
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 !
[in] | strName | Name of the reader (is not yet relevant in default implementation cSampleStream but may be in future). |
[in,out] | pOutStream | object_ptr where to put the out stream reference to (Recommended: keep it private). |
[in] | ui32Mode | Mode to open. see ISampleStreamAccess::tMode. |
[in] | szQueueSize | QueueSize 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] | pParent | concreate sample_stream implementation |
tResult RunTrigger | ( | tTimeStamp | tmActivationTime | ) |
Internal Run implementation.
tmActivationTime | [in] TimeSTamp of a activation |
ERR_NOERROR | Succesfully run. |
tResult SetFullName | ( | const char * | strName | ) |
Set the name which is used for error handling etc.
[in] | strName | The name. |
Sets and forwards a StreamError to the readers.
Depending on the implementation and error type this may stop the streaming!
[in] | oError | Error to set |
Referenced by sample_stream< INTERFACE >::SetStreamError().
void SetSubStreamFilter | ( | const char * | strSubStream | ) |
If set, only Stream Types and Samples of the given Substream mwill be forwarded.
[in] | strSubStream | The name of the Substream. |