ADTF  3.18.2
cSampleWithCodec

Helper class that combines a Sample Codec with a Sample instance. More...

Inheritance diagram for cSampleWithCodec:
[legend]

Public Member Functions

 cSampleWithCodec ()=default
 Default Constructor -> invalid object.
 
 cSampleWithCodec (ant::cSampleCodec &&oCodec, const ucom::ant::iobject_ptr< const streaming::ant::ISample > &pSample)
 Constructor that initializes a valid object. More...
 
 cSampleWithCodec (cSampleWithCodec &&)=default
 
cSampleWithCodecoperator= (cSampleWithCodec &&)=default
 
ucom::ant::object_ptr< const streaming::ant::ISampleRelease ()
 Retrieve the sample instance. More...
 
- Public Member Functions inherited from cSampleCodec
 cSampleCodec ()=default
 Default constructor.
 
 cSampleCodec (cSampleCodec &&)=default
 Move constructor.
 
cSampleCodecoperator= (cSampleCodec &&)=default
 Move assignment operator.
 
void SetElementValue (const char *strElementName, const adtf::util::cVariant &oValue)
 
- Public Member Functions inherited from cCodec
 cCodec ()=default
 Default constructor.
 
 cCodec (cCodec &&)=default
 Move constructor.
 
cCodecoperator= (cCodec &&)=default
 Move assignment operator.
 
tResult SetElementValue (size_t nIndex, const void *pValue)
 Sets the current value of the given element by copying its data from the passed-in location. More...
 
tResult SetElementValue (size_t nIndex, const A_UTILS_NS::cVariant &oValue)
 Sets the current value of the given element to the given value. More...
 
void * GetElementAddress (size_t nIndex)
 
tResult SetConstants ()
 Sets all elements to their constant values defined in the DDL. More...
 
const void * GetElementAddress (size_t nIndex) const
 
- Public Member Functions inherited from cDecoder
 cDecoder ()=default
 Default constructor.
 
 cDecoder (cDecoder &&)=default
 Move constructor.
 
cDecoderoperator= (cDecoder &&)=default
 Move assignment operator.
 
virtual tResult IsValid () const override
 
virtual size_t GetElementCount () const override
 
size_t GetBufferSize (tDataRepresentation eRep=tDataRepresentation::Deserialized) const
 
cCodec MakeCodecFor (void *pData, size_t nDataSize, tDataRepresentation eRep) const
 Create a new codec with the current dynamic structure layout for a new data buffer. More...
 
- Public Member Functions inherited from cStaticDecoder
 cStaticDecoder ()
 Default constructor.
 
 cStaticDecoder (cStaticDecoder &&)=default
 Move constructor.
 
cStaticDecoderoperator= (cStaticDecoder &&)=default
 Move assignment operator.
 
tResult GetElement (size_t nIndex, const tStructElement *&pElement) const
 Access information about an element. More...
 
tResult GetElementValue (size_t nIndex, void *pValue) const
 Returns the current value of the given element by copying its data to the passed-in location. More...
 
tResult GetElementValue (size_t nIndex, A_UTILS_NS::cVariant &oValue) const
 Returns the current value of the given element as a variant. More...
 
const void * GetElementAddress (size_t nIndex) const
 
size_t GetStaticBufferSize (tDataRepresentation eRep=tDataRepresentation::Deserialized) const
 
tDataRepresentation GetRepresentation () const
 
A_UTILS_NS::cString GetElementValueString (size_t nIndex) const
 Returns the current value of the given element as a string. More...
 

Private Attributes

ucom::ant::object_ptr< const streaming::ant::ISamplem_pSample
 

Additional Inherited Members

- Public Types inherited from cCodec
typedef adtf_ddl::tStructElement DefinedStructElementType
 
- Public Types inherited from cDecoder
typedef adtf_ddl::tStructElement DefinedStructElementType
 
- Public Types inherited from cStaticDecoder
typedef adtf_ddl::tStructElement DefinedStructElementType
 
- Static Public Member Functions inherited from cStaticDecoder
static const char * GetStructElementName (const tStructElement *pElement)
 Access information about an element. More...
 
- Protected Member Functions inherited from cCodec
 cCodec (std::shared_ptr< const cStructLayout > pLayout, void *pData, size_t nDataSize, tDataRepresentation eRep)
 For internal use only.
 
 cCodec (const cDecoder &oDecoder, void *pData, size_t nDataSize, tDataRepresentation eRep)
 For internal use only.
 
- Protected Member Functions inherited from cDecoder
 cDecoder (std::shared_ptr< const cStructLayout > pLayout, const void *pData, size_t nDataSize, tDataRepresentation eRep)
 For internal use only.
 
 cDecoder (const cDecoder &oDecoder, const void *pData, size_t nDataSize, tDataRepresentation eRep)
 For internal use only.
 
virtual const tStructLayoutElement * GetLayoutElement (size_t nIndex) const override
 For internal use only.
 
- Protected Member Functions inherited from cStaticDecoder
 cStaticDecoder (std::shared_ptr< const cStructLayout > pLayout, const void *pData, size_t nDataSize, tDataRepresentation eRep)
 For internal use only.
 
- Protected Attributes inherited from cDecoder
std::shared_ptr< std::vector< tStructLayoutElement > > m_pDynamicElements
 For internal use only.
 
tOffsets m_sBufferSizes
 For internal use only.
 
- Protected Attributes inherited from cStaticDecoder
std::shared_ptr< const cStructLayout > m_pLayout
 For internal use only.
 
const void * m_pData
 For internal use only.
 
size_t m_nDataSize
 For internal use only.
 
const cElementAccessor * m_pElementAccessor
 For internal use only.
 

Detailed Description

Helper class that combines a Sample Codec with a Sample instance.

Definition at line 158 of file codec_sample_streamer_legacy.h.

Constructor & Destructor Documentation

◆ cSampleWithCodec()

Constructor that initializes a valid object.

Parameters
[in]oCodecThe codec the encodes values into the sample.
[in]pSampleThe sample.

Member Function Documentation

◆ Release()

Retrieve the sample instance.

Call this when you're done updating the sample data in order to write it via streaming::flash::ISampleWriter::Write.

Do not call any other methods of the object after you have called this method.

Returns
A Pointer to the sample.

Referenced by encoding_sample_writer< WriterImplementation >::Write().