ADTF
Loading...
Searching...
No Matches
ddl::StaticDecoder Class Reference

#include <static_codec_legacy.h>

Inherited by ddl::Decoder, and ddl::StaticCodec.

Public Member Functions

 ~StaticDecoder ()=default
 virtual DTOR
 
DEV_ESSENTIAL_DEPRECATED_STATIC_DECODER StaticDecoder ()
 
 StaticDecoder (const StaticDecoder &)=delete
 
StaticDecoderoperator= (const StaticDecoder &)=delete
 
 StaticDecoder (StaticDecoder &&)=default
 
DEV_ESSENTIAL_DEPRECATED_STATIC_DECODER StaticDecoderoperator= (StaticDecoder &&)=default
 
virtual a_util::result::Result isValid () const
 
virtual size_t getElementCount () const
 
a_util::result::Result getElement (size_t index, const StructElement *&element) const
 
a_util::result::Result getElementValue (size_t index, void *value) const
 
a_util::result::Result getElementValue (size_t index, a_util::variant::Variant &value) const
 
const void * getElementAddress (size_t index) const
 
size_t getStaticBufferSize (DataRepresentation rep=deserialized) const
 
DataRepresentation getRepresentation () const
 

Protected Member Functions

 StaticDecoder (std::shared_ptr< const StructLayout > layout, const void *data, size_t data_size, DataRepresentation rep)
 
 StaticDecoder (const std::shared_ptr< LegacyCodecAccess > &legacy_codec_access)
 For internal use only.
 

Protected Attributes

std::shared_ptr< LegacyCodecAccess > _legacy_access
 For internal use only.
 
const void * _compat_data
 
size_t _compat_data_size
 
const void * _compat_element_accessor
 

Friends

class CodecFactory
 

Detailed Description

Decoder for static structures defined by a DataDefinition definition.

Deprecated
Use the new ddl::codec::StaticDecoder() instead.

Constructor & Destructor Documentation

◆ StaticDecoder() [1/4]

DEV_ESSENTIAL_DEPRECATED_STATIC_DECODER ddl::StaticDecoder::StaticDecoder ( )

Default constructor

◆ StaticDecoder() [2/4]

ddl::StaticDecoder::StaticDecoder ( const StaticDecoder & )
delete

Noncopyable

◆ StaticDecoder() [3/4]

ddl::StaticDecoder::StaticDecoder ( StaticDecoder && )
default

Move constructor.

◆ StaticDecoder() [4/4]

ddl::StaticDecoder::StaticDecoder ( std::shared_ptr< const StructLayout > layout,
const void * data,
size_t data_size,
DataRepresentation rep )
protected

For internal use only.

Member Function Documentation

◆ getElement()

a_util::result::Result ddl::StaticDecoder::getElement ( size_t index,
const StructElement *& element ) const

Access information about an element.

Parameters
[in]indexThe index of the element.
[out]elementPointer that will be updated to point to the element information.
Return values
ERR_INVALID_INDEXInvalid element index.

◆ getElementAddress()

const void * ddl::StaticDecoder::getElementAddress ( size_t index) const
Parameters
[in]indexThe index of the element.
Returns
A pointer to the element or NULL in case of an error.

◆ getElementCount()

virtual size_t ddl::StaticDecoder::getElementCount ( ) const
virtual
Returns
The amount of elements contained in the data structure.

Reimplemented in ddl::Decoder.

◆ getElementValue() [1/2]

a_util::result::Result ddl::StaticDecoder::getElementValue ( size_t index,
a_util::variant::Variant & value ) const

Returns the current value of the given element as a variant.

Parameters
[in]indexThe index of the element.
[out]valueThe will be set to the current value.
Return values
ERR_INVALID_INDEXInvalid element index.

◆ getElementValue() [2/2]

a_util::result::Result ddl::StaticDecoder::getElementValue ( size_t index,
void * value ) const

Returns the current value of the given element by copying its data to the passed-in location.

Parameters
[in]indexThe index of the element.
[out]valueThe location where the value should be copied to.
Return values
ERR_INVALID_INDEXInvalid element index.

◆ getRepresentation()

DataRepresentation ddl::StaticDecoder::getRepresentation ( ) const
Returns
The data representation which this decoder handles.

◆ getStaticBufferSize()

size_t ddl::StaticDecoder::getStaticBufferSize ( DataRepresentation rep = deserialized) const
Parameters
[in]repThe data representation for which the buffer size should be returned.
Returns
The size of the structure in the requested data representation.

◆ isValid()

virtual a_util::result::Result ddl::StaticDecoder::isValid ( ) const
virtual
Returns
Whether or not the decoder is valid.
Return values
ERR_INVALID_ARGThe passed data is not large enough.

Reimplemented in ddl::Decoder.

◆ operator=() [1/2]

StaticDecoder & ddl::StaticDecoder::operator= ( const StaticDecoder & )
delete

Noncopyable

◆ operator=() [2/2]

DEV_ESSENTIAL_DEPRECATED_STATIC_DECODER StaticDecoder & ddl::StaticDecoder::operator= ( StaticDecoder && )
default

Move assignment operator.

Member Data Documentation

◆ _compat_data

const void* ddl::StaticDecoder::_compat_data
protected

For internal use only.

◆ _compat_data_size

size_t ddl::StaticDecoder::_compat_data_size
protected

For internal use only.

◆ _compat_element_accessor

const void* ddl::StaticDecoder::_compat_element_accessor
protected

For internal use only.


The documentation for this class was generated from the following file: