ADTF  3.18.2
sample_writer< DATA_TYPE, BASE >

Specialized Sample Writer to write data of a given type DATA_TYPE (see Supported types for adtf_memory<T> for writing and reading Samples). More...

Inheritance diagram for sample_writer< DATA_TYPE, BASE >:
[legend]

Public Member Functions

 sample_writer ()
 Default CTOR.
 
 ADTF3_DEPRECATED ("Writing data with no concrete sample time is deprecated. Use " "sample_writer<DATA_TYPE>::Write(tmTime, oSampleData) instead.") tResult Write(const DATA_TYPE &oSampleData)
 Writes Data of the given DATA_TYPE. More...
 
tResult Write (tTimeStamp tmTime, const DATA_TYPE &oSampleData)
 
tResult Write (base::flash::tNanoSeconds tmTime, const DATA_TYPE &oSampleData)
 
 ADTF3_DEPRECATED ("Writing data with no concrete sample time is deprecated. Use " "sample_writer<DATA_TYPE>::Write(tmTime, oSampleData) instead.") tResult Transmit(const DATA_TYPE &oSampleData)
 
tResult Transmit (tTimeStamp tmTime, const DATA_TYPE &oSampleData)
 
tResult Transmit (base::flash::tNanoSeconds tmTime, const DATA_TYPE &oSampleData)
 
- Public Member Functions inherited from cSampleWriter
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

ucom::ant::object_ptr< services::flash::IReferenceClockm_pClock
 
- Protected Attributes inherited from cSampleWriter
std::unique_ptr< cImplementation > m_pImplementation
 

Detailed Description

template<typename DATA_TYPE, typename BASE = cSampleWriter>
class adtf::streaming::flash::sample_writer< DATA_TYPE, BASE >

Specialized Sample Writer to write data of a given type DATA_TYPE (see Supported types for adtf_memory<T> for writing and reading Samples).

The operator << will be overloaded to write data.

Template Parameters
DATA_TYPEthe type which is written. This Sample content is created and written at Write call.
BASEthe base adtf::streaming::flash::ISampleWriter Implementation (default is adtf::streaming::flash::cSampleWriter).
Remarks
The sample writer can only handle following data types of DATA_TYPE:

Definition at line 497 of file samplewriter.h.

Member Function Documentation

◆ ADTF3_DEPRECATED()

ADTF3_DEPRECATED ( "Writing data with no concrete sample time is deprecated. Use " "sample_writer<DATA_TYPE>::Write(tmTime, oSampleData) instead."  ) const &
inline

Writes Data of the given DATA_TYPE.

The Sample Time of the created Sample is retrieved from the IReferenceClock (if any exists).

Parameters
oSampleDatareference to the data of DATA_TYPE. All supported types of adtf_memory<T> template can be used see Supported types for adtf_memory<T> for writing and reading Samples.
Returns
tResult

Definition at line 520 of file samplewriter.h.