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

#include <static_codec_legacy.h>

Inherits ddl::StaticDecoder.

Public Member Functions

DEV_ESSENTIAL_DEPRECATED_STATIC_CODEC StaticCodec ()
 
 StaticCodec (const StaticCodec &)=delete
 
StaticCodecoperator= (const StaticCodec &)=delete
 
 StaticCodec (StaticCodec &&)=default
 
DEV_ESSENTIAL_DEPRECATED_STATIC_CODEC StaticCodecoperator= (StaticCodec &&)=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::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
 
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

 StaticCodec (std::shared_ptr< const StructLayout > layout, 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

Codec for static structures defined by a DataDefinition definition.

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

Constructor & Destructor Documentation

◆ StaticCodec() [1/4]

DEV_ESSENTIAL_DEPRECATED_STATIC_CODEC ddl::StaticCodec::StaticCodec ( )

Default constructor

◆ StaticCodec() [2/4]

ddl::StaticCodec::StaticCodec ( const StaticCodec & )
delete

Noncopyable

◆ StaticCodec() [3/4]

ddl::StaticCodec::StaticCodec ( StaticCodec && )
default

Move constructor.

◆ StaticCodec() [4/4]

ddl::StaticCodec::StaticCodec ( 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::StaticCodec::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=() [1/2]

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

Noncopyable

◆ operator=() [2/2]

DEV_ESSENTIAL_DEPRECATED_STATIC_CODEC StaticCodec & ddl::StaticCodec::operator= ( StaticCodec && )
default

Move assignment operator.

◆ setConstants()

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

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

Returns
Standard result.

◆ setElementValue() [1/2]

a_util::result::Result ddl::StaticCodec::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::StaticCodec::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: