ADTF  3.18.2
cSampleWriter

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

Inheritance diagram for cSampleWriter:
[legend]

Public Member Functions

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

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 adtf::streaming::flash::cSampleWriter::SetStreamerPin.

Definition at line 363 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< 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 >, and encoding_sample_writer< WriterImplementation >.

◆ EndStreaming()

tResult EndStreaming ( )
overridevirtual

End streaming.

Returns
Standard result.

Implements ISampleStreamer.

Reimplemented in writer_with_request_broker< adtf::streaming::cSampleWriter >.

◆ 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 >, and encoding_sample_writer< WriterImplementation >.

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