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

Decoder for samples with static and/or dynamic data. More...

#include <sample_codec.h>

Inheritance diagram for cSampleDecoder:
[legend]

Public Member Functions

 cSampleDecoder ()=default
 Default constructor.
 
 cSampleDecoder (cSampleDecoder &&)
 Move constructor.
 
cSampleDecoderoperator= (cSampleDecoder &&)
 Move assignment operator.
 
size_t GetBufferSize () const
 Gets the buffer size in bytes for the main structure.
 
size_t GetBufferSize (ddl::tDataRepresentation eRep) const
 Gets the buffer size in bytes for the main structure.
 
const void * GetData () const
 Get the current data pointer.
 
size_t GetDataSize () const
 Get the current data size.
 
- Public Member Functions inherited from cSampleDecoderBase
 cSampleDecoderBase (cSampleDecoderBase &&)
 
cSampleDecoderBaseoperator= (cSampleDecoderBase &&)
 
tResult IsValid () const
 Returns the validation state of the coder.
 
tElement GetElement (const tCodecIndex &oCodecIndex) const
 Retrieves an element for the codec index.
 
tElement GetElement (const std::string &strElementFullName) const
 Retrieves an element for the given name.
 
const tElementsGetElements () const
 Retrieves the elements of the decoder to get element information and the values.
 
size_t GetElementChildCount (const tCodecIndex &oCodecIndex) const
 Retrieves the amount of child elements for the given codec index.
 
std::string GetElementFullName (const tCodecIndex &oCodecIndex) const
 Retrieves the full name of the element within its main structure.
 
std::string GetElementName (const tCodecIndex &oCodecIndex) const
 Retrieves the name of the element within its structured element.
 
const std::string & GetElementBaseName (const tCodecIndex &oCodecIndex) const
 Retrieves the base name of the element within its structured element.
 
size_t GetStaticBufferSize () const
 Gets the static buffer size in bytes for the main structure.
 
size_t GetStaticBufferSize (ddl::tDataRepresentation oRep) const
 Gets the static buffer size in bytes for the main structure.
 
ddl::tDataRepresentation GetRepresentation () const
 Returns the current data representation the decoder decodes from.
 
template<typename T>
GetElementValue (const tCodecIndex &oCodecIndex) const
 Gets the elements value as value of type T.
 
template<typename T>
GetElementValue (const penguin::tLeafCodecIndex &oLeafCodecIndex) const
 Gets the elements value as value of type T.
 
a_util::variant::Variant GetElementVariantValue (const tCodecIndex &oCodecIndex) const
 Returns the current value of the given element as a variant.
 
void GetElementVariantValue (const tCodecIndex &oCodecIndex, a_util::variant::Variant &oValue) const
 Returns the current value of the given element as a variant.
 
std::string GetElementStringValue (const tCodecIndex &oCodecIndex) const
 Returns the current value of the given element as a string.
 
void GetElementRawValue (const tCodecIndex &oCodecIndex, void *pValue, size_t szValueSize) const
 Copies the elements value to the given memory pointer in @pValue.
 
const void * GetElementAddress (const tCodecIndex &oCodecIndex) const
 Gets the elements value memory pointer into the given data.
 
void Resolve (tCodecIndex &oCodecIndex) const
 retrieves the lyoutinformation for the given codec index.
 
tResult GetElement (tCodecLeafIndex nElementLeafIndex, const ddl::StructElement *&pElement) const
 Get the Element StructElement information.
 
adtf_util::cVariant GetElementValue (tCodecLeafIndex nElementLeafIndex) const
 Legacy: Get the Element Value.
 
tResult GetElementValue (tCodecLeafIndex nElementLeafIndex, adtf_util::cVariant &oValue) const
 Legacy: Get the Element Value.
 
tResult GetElementValue (const char *strElementName, adtf_util::cVariant &oValue) const
 Legacy: Get the Element Value.
 
tResult GetElementValue (tCodecLeafIndex nElementLeafIndex, void *pValue) const
 Legacy: Copies the Element Value memory into the memory pointer.
 
tResult GetElementValue (const char *strElementName, void *pValue) const
 Legacy: Get the Element Value pointer.
 
const void * GetElementAddress (tCodecLeafIndex nElementIndex) const
 Legacy: Get the Element StructElement information.
 
tCodecIndex Resolve (tCodecLeafIndex nElementLeafIndex) const
 Legacy: Retrieves a codec index with element information for the given leaf index.
 
- Public Member Functions inherited from cDecoderLegacy
tCodecIndex Resolve (tCodecLeafIndex nElementLeafIndex) const
 Legacy: Retrieves a codec index with element information for the given leaf index.
 
adtf_util::cVariant GetElementValue (tCodecLeafIndex nElementLeafIndex) const
 Legacy: Get the Element Value.
 
tResult GetElementValue (tCodecLeafIndex nElementLeafIndex, adtf_util::cVariant &oValue) const
 Legacy: Get the Element Value.
 
tResult GetElementValue (const char *strElementName, adtf_util::cVariant &oValue) const
 Legacy: Get the Element Value.
 
tResult GetElementValue (tCodecLeafIndex nElementLeafIndex, void *pValue) const
 Legacy: Copies the Element Value memory into the memory pointer.
 
tResult GetElementValue (const char *strElementName, void *pValue) const
 Legacy: Get the Element Value pointer.
 
adtf_util::cString GetElementValueString (tCodecLeafIndex nElementLeafIndex) const
 Legacy: Get the Element Value as string (resolved to the enum element name if is enum type)
 
tResult GetElement (tCodecLeafIndex nElementLeafIndex, const ddl::StructElement *&pElement) const
 Get the Element StructElement information.
 
const void * GetElementAddress (tCodecLeafIndex nElementIndex) const
 Legacy: Get the Element StructElement information.
 
size_t GetElementCount () const
 Legacy: Get the Element Leaf count.
 

Private Member Functions

 cSampleDecoder (ddl::codec::Decoder &&oDecoder, adtf::ucom::object_ptr_shared_locked< const adtf::streaming::ISampleBuffer > &&pBuffer)
 For internal use only.
 
const ddl::codec::StaticDecodergetDecoder () const override
 For internal use only.
 

Private Attributes

ddl::codec::Decoder m_oDecoder
 For internal use only.
 
adtf::ucom::object_ptr_shared_locked< const adtf::streaming::ISampleBufferm_pBuffer
 For internal use only.
 

Additional Inherited Members

- Public Types inherited from cSampleDecoderBase
typedef ddl::codec::DecoderElement< sample_decoder_access< const cSampleDecoderBase > > tElement
 Iterator value element type for the codec to get value, set value and get element information.
 
typedef ddl::codec::ChildElements< sample_decoder_access< const cSampleDecoderBase > > tElements
 Iterator container to iterate all elements of the decoder.
 
- Public Types inherited from cDecoderLegacy
typedef ddl::StructElement DefinedStructElementType
 type definition for the old access_element API.
 
- Static Public Member Functions inherited from cDecoderLegacy
static const char * GetStructElementName (const ddl::StructElement *pElement)
 Legacy: Get the Struct Element Name for access_element legacy support.
 
- Protected Member Functions inherited from cSampleDecoderBase
void ResetFirst ()
 

Detailed Description

Decoder for samples with static and/or dynamic data.

Definition at line 604 of file sample_codec.h.

Constructor & Destructor Documentation

◆ cSampleDecoder()

For internal use only.

Definition at line 655 of file sample_codec.h.

References m_oDecoder, and m_pBuffer.

Member Function Documentation

◆ GetBufferSize() [1/2]

size_t GetBufferSize ( ) const

Gets the buffer size in bytes for the main structure.

Return values
size_tsize in bytes of the structure depending on the current representation (GetRepresentation)

◆ GetBufferSize() [2/2]

size_t GetBufferSize ( ddl::tDataRepresentation eRep) const

Gets the buffer size in bytes for the main structure.

Parameters
eRepoption to retrieve size in bytes for the deserialized or serialized representation.
Return values
size_tsize in bytes of the structure depending on the given representation eRep

◆ GetData()

const void * GetData ( ) const
inline

Get the current data pointer.

Returns
const void*

Definition at line 638 of file sample_codec.h.

References m_pBuffer.

◆ GetDataSize()

size_t GetDataSize ( ) const
inline

Get the current data size.

Returns
const void*

Definition at line 647 of file sample_codec.h.

References m_pBuffer.

◆ getDecoder()

const ddl::codec::StaticDecoder * getDecoder ( ) const
overrideprivatevirtual

For internal use only.

Implements cDecoderLegacy.

Member Data Documentation

◆ m_oDecoder

ddl::codec::Decoder m_oDecoder
private

For internal use only.

Definition at line 665 of file sample_codec.h.

Referenced by cSampleDecoder().

◆ m_pBuffer

For internal use only.

Definition at line 667 of file sample_codec.h.

Referenced by cSampleDecoder(), GetData(), and GetDataSize().