ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cSampleWriter

This base implementation of a sample writer is samples and types to the given pin set at SetStreamerPin. More...

#include <samplewriter.h>

Inheritance diagram for cSampleWriter:
[legend]

Public Member Functions

void SetName (const char *strName) override
 Sets the name of the streamer.
 
tResult GetName (base::ant::IString &&strName) override
 Retrieves the name of the streamer.
 
tResult SetType (const ucom::ant::iobject_ptr< const ant::IStreamType > &pStreamType) override
 Sets the initial stream type of a streamer.
 
tResult GetType (ucom::ant::iobject_ptr< const ant::IStreamType > &pStreamType) const override
 Returns the initial stream type of the streamer.
 
tResult BeginStreaming (ISampleStream &oSampleStream) override
 Begin streaming on the given sample stream.
 
tResult EndStreaming () override
 End streaming.
 
tResult SetStreamerPin (const ucom::ant::iobject_ptr< IStreamerPin > &pStreamerPin) override
 Sets the pin that the streamer is associated with.
 
tResult Write (const ucom::ant::iobject_ptr< const ant::ISample > &pSample) override
 Writes a sample to the connected sample stream.
 
virtual tResult Transmit (const ucom::ant::iobject_ptr< const ant::ISample > &pSample)
 For compatibility purposes, call Write() instead.
 
tResult ChangeType (const ucom::ant::iobject_ptr< const ant::IStreamType > &pType) override
 Communicates a type change for all following samples.
 
tResult Flush () override
 Flushes the writer.
 
tResult SetStreamError (tResult oError) override
 Reports and handles an error via the sample stream.
 
tResult ManualTrigger (base::flash::tNanoSeconds tmActivationTime=base::flash::tNanoSeconds {-1}) override
 Calls all connected runners synchronously in this call.
 

Protected Attributes

std::unique_ptr< cImplementation > m_pImplementation
 

Detailed Description

This base implementation of a sample writer is samples and types to the given pin set at SetStreamerPin.

Definition at line 355 of file samplewriter.h.

Member Function Documentation

◆ BeginStreaming()

tResult BeginStreaming ( ISampleStream & pStream)
overridevirtual

Begin streaming on the given sample stream.

Parameters
[in]pStreamthe sample stream.
Returns
Standard result.

Implements ISampleStreamer.

Reimplemented in writer_with_request_broker< BaseWriter >, and writer_with_request_broker< adtf::streaming::cSampleWriter >.

◆ ChangeType()

tResult ChangeType ( const ucom::ant::iobject_ptr< const ant::IStreamType > & pType)
overridevirtual

Communicates a type change for all following samples.

Parameters
[in]pTypeThe new stream type
Returns
Standard result. Errors will be reported via the associated sample stream.

Implements ISampleWriter.

Reimplemented in encoding_sample_writer< WriterImplementation >, encoding_sample_writer< WriterImplementation >, encoding_sample_writer< WriterImplementation >, requestable_writer< BaseWriter >, and requestable_writer< BaseWriter >.

◆ EndStreaming()

◆ Flush()

tResult Flush ( )
overridevirtual

Flushes the writer.

Returns
Standard result.

Implements ISampleWriter.

◆ GetName()

tResult GetName ( base::ant::IString && strName)
overridevirtual

Retrieves the name of the streamer.

Parameters
[out]strNameThis will be updated with the name.
Returns
Standard result.

Implements ISampleStreamer.

◆ GetType()

tResult GetType ( ucom::ant::iobject_ptr< const ant::IStreamType > & pStreamType) const
overridevirtual

Returns the initial stream type of the streamer.

Parameters
[out]pStreamTypeThis will reference the initial stream type.
Returns
Standard result.

Implements ISampleStreamer.

◆ ManualTrigger()

tResult ManualTrigger ( base::flash::tNanoSeconds tmActivationTime = base::flash::tNanoSeconds {-1})
overridevirtual

Calls all connected runners synchronously in this call.

Parameters
[in]tmActivationTimeThe timestamp passed to all runners. If equals -1, the current stream time is retrieved from the reference clock.
Returns
Standard result. Errors will be reported via the associated sample stream.

Implements ISampleWriter.

◆ SetName()

void SetName ( const char * strName)
overridevirtual

Sets the name of the streamer.

This will be used when creating pins.

Parameters
[in]strNameThe name

Implements ISampleStreamer.

◆ SetStreamerPin()

tResult SetStreamerPin ( const ucom::ant::iobject_ptr< IStreamerPin > & pStreamerPin)
overridevirtual

Sets the pin that the streamer is associated with.

Parameters
[in]pStreamerPinThe pin.
Returns
Standard result.

Implements ISampleStreamer.

◆ SetStreamError()

tResult SetStreamError ( tResult oError)
overridevirtual

Reports and handles an error via the sample stream.

Mind that you still need to cope with the error in the best possible manner.

Parameters
[in]oErrorThe error code.
Returns
Standard result.

Implements ISampleWriter.

◆ SetType()

tResult SetType ( const ucom::ant::iobject_ptr< const ant::IStreamType > & pStreamType)
overridevirtual

Sets the initial stream type of a streamer.

Parameters
[in]pStreamTypeThe stream type
Returns
Standard result.

Implements ISampleStreamer.

Reimplemented in encoding_sample_writer< WriterImplementation >, encoding_sample_writer< WriterImplementation >, encoding_sample_writer< WriterImplementation >, requestable_writer< BaseWriter >, and requestable_writer< BaseWriter >.

◆ Transmit()

virtual tResult Transmit ( const ucom::ant::iobject_ptr< const ant::ISample > & pSample)
virtual

For compatibility purposes, call Write() instead.

Writes a sample to the connected sample stream.

Parameters
[in]pSampleThe sample to write
Returns
Standard result. Errors will be reported via the associated sample stream.

◆ Write()

tResult Write ( const ucom::ant::iobject_ptr< const ant::ISample > & pSample)
overridevirtual

Writes a sample to the connected sample stream.

Parameters
[in]pSampleThe sample to write
Returns
Standard result. Errors will be reported via the associated sample stream.

Implements ISampleWriter.

Member Data Documentation

◆ m_pImplementation

std::unique_ptr<cImplementation> m_pImplementation
protected

Definition at line 387 of file samplewriter.h.