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

#include <codec_legacy.h>

Inherits ddl::StaticDecoder.

Inherited by ddl::Codec.

Public Member Functions

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

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
 

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.

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

Constructor & Destructor Documentation

◆ Decoder() [1/4]

DEV_ESSENTIAL_DEPRECATED_DECODER ddl::Decoder::Decoder ( )
default

Default constructor.

◆ Decoder() [2/4]

ddl::Decoder::Decoder ( Decoder && )
default

Move constructor.

◆ Decoder() [3/4]

ddl::Decoder::Decoder ( const Decoder & )
delete

No copy constructor.

◆ Decoder() [4/4]

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

This CTOR must stay there for binary compatible reason due to an inline usage within old CodecFactory

Member Function Documentation

◆ getBufferSize()

size_t ddl::Decoder::getBufferSize ( 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.

◆ getElementCount()

size_t ddl::Decoder::getElementCount ( ) const
overridevirtual

Returns
The amount of elements contained in the data structure.

Reimplemented from ddl::StaticDecoder.

◆ isValid()

a_util::result::Result ddl::Decoder::isValid ( ) const
overridevirtual

Returns
Whether or not the decoder is valid.
Return values
ERR_INVALID_ARGThe passed data is not large enough.

Reimplemented from ddl::StaticDecoder.

◆ makeCodecFor()

Codec ddl::Decoder::makeCodecFor ( void * data,
size_t data_size,
DataRepresentation rep ) const

Create a new codec with the current dynamic structure layout for a new data buffer.

Parameters
[in]dataThe pointer to the new raw data.
[in]data_sizeThe size of the new raw data.
[in]repThe representation that the data should be encoded in.
Returns
A codec.

◆ operator=() [1/2]

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

No copy assignment operator.

◆ operator=() [2/2]

DEV_ESSENTIAL_DEPRECATED_DECODER Decoder & ddl::Decoder::operator= ( Decoder && )
default

Move assignment operator.


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