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

#include <codec_legacy.h>

Inherits ddl::Decoder.

Public Member Functions

DEV_ESSENTIAL_DEPRECATED_CODEC Codec ()=default
 
 Codec (Codec &&)=default
 
DEV_ESSENTIAL_DEPRECATED_CODEC Codecoperator= (Codec &&)=default
 
a_util::result::Result setElementValue (size_t index, const void *value)
 
a_util::result::Result setElementValue (size_t index, const a_util::variant::Variant &value)
 
void * getElementAddress (size_t index)
 
a_util::result::Result setConstants ()
 
const void * getElementAddress (size_t index) const
 
- Public Member Functions inherited from ddl::Decoder
DEV_ESSENTIAL_DEPRECATED_DECODER Decoder ()=default
 
 Decoder (Decoder &&)=default
 
DEV_ESSENTIAL_DEPRECATED_DECODER Decoderoperator= (Decoder &&)=default
 
 Decoder (const Decoder &)=delete
 
Decoderoperator= (const Decoder &)=delete
 
a_util::result::Result isValid () const override
 
size_t getElementCount () const override
 
size_t getBufferSize (DataRepresentation rep=deserialized) const
 
Codec makeCodecFor (void *data, size_t data_size, DataRepresentation rep) const
 
- Public Member Functions inherited from ddl::StaticDecoder
 ~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
 
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

 Codec (std::shared_ptr< const StructLayout > layout, void *data, size_t data_size, DataRepresentation rep)
 
 Codec (codec::Codec &&codec)
 For internal use only.
 
- Protected Member Functions inherited from ddl::Decoder
virtual const void * getLayoutElement (size_t index) const
 this virtual pointer must stay for binary compatiblity.
 
 Decoder (const std::shared_ptr< LegacyCodecAccess > &legacy_codec_access)
 For internal use only.
 
 Decoder (std::shared_ptr< const StructLayout >, const void *data, size_t data_size, DataRepresentation rep)
 
- Protected Member Functions inherited from ddl::StaticDecoder
 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.
 

Friends

class CodecFactory
 
class Decoder
 

Additional Inherited Members

- Protected Attributes inherited from ddl::StaticDecoder
std::shared_ptr< LegacyCodecAccess > _legacy_access
 For internal use only.
 
const void * _compat_data
 
size_t _compat_data_size
 
const void * _compat_element_accessor
 

Detailed Description

Decoder for dynamic structures defined by a DataDefinition definition. Currently the amount of dynamic elements is determined during construction only (by the current values in the structure).

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

Constructor & Destructor Documentation

◆ Codec() [1/3]

DEV_ESSENTIAL_DEPRECATED_CODEC ddl::Codec::Codec ( )
default

Default constructor.

◆ Codec() [2/3]

ddl::Codec::Codec ( Codec && )
default

Move constructor.

◆ Codec() [3/3]

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

For internal use only.

Member Function Documentation

◆ getElementAddress() [1/2]

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

◆ getElementAddress() [2/2]

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.

◆ operator=()

DEV_ESSENTIAL_DEPRECATED_CODEC Codec & ddl::Codec::operator= ( Codec && )
default

Move assignment operator.

◆ setConstants()

a_util::result::Result ddl::Codec::setConstants ( )

Sets all elements to their constant values defined in the DataDefinition.

Returns
Standard result.

◆ setElementValue() [1/2]

a_util::result::Result ddl::Codec::setElementValue ( size_t index,
const a_util::variant::Variant & value )

Sets the current value of the given element to the given value.

Parameters
[in]indexThe index of the element.
[in]valueThe value.
Return values
ERR_INVALID_INDEXInvalid element index.

◆ setElementValue() [2/2]

a_util::result::Result ddl::Codec::setElementValue ( size_t index,
const void * value )

Sets the current value of the given element by copying its data from the passed-in location.

Parameters
[in]indexThe index of the element.
[in]valueThe location where the data should be copied from.
Return values
ERR_INVALID_INDEXInvalid element index.

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