ADTF  3.18.2
StaticCodec

Codec for static structures defined by a DataDefinition definition. More...

Inheritance diagram for StaticCodec:
[legend]

Public Member Functions

DEV_ESSENTIAL_DEPRECATED_STATIC_CODEC StaticCodec ()
 Default constructor.
 
 StaticCodec (const StaticCodec &)=delete
 Noncopyable.
 
StaticCodecoperator= (const StaticCodec &)=delete
 Noncopyable.
 
 StaticCodec (StaticCodec &&)=default
 Move constructor.
 
DEV_ESSENTIAL_DEPRECATED_STATIC_CODEC StaticCodecoperator= (StaticCodec &&)=default
 Move assignment operator.
 
a_util::result::Result setElementValue (size_t index, const void *value)
 Sets the current value of the given element by copying its data from the passed-in location. More...
 
a_util::result::Result setElementValue (size_t index, const a_util::variant::Variant &value)
 Sets the current value of the given element to the given value. More...
 
void * getElementAddress (size_t index)
 
a_util::result::Result setConstants ()
 Sets all elements to their constant values defined in the DataDefinition. More...
 
const void * getElementAddress (size_t index) const
 
- Public Member Functions inherited from StaticDecoder
 ~StaticDecoder ()=default
 virtual DTOR
 
DEV_ESSENTIAL_DEPRECATED_STATIC_DECODER StaticDecoder ()
 Default constructor.
 
 StaticDecoder (const StaticDecoder &)=delete
 Noncopyable.
 
StaticDecoderoperator= (const StaticDecoder &)=delete
 Noncopyable.
 
 StaticDecoder (StaticDecoder &&)=default
 Move constructor.
 
DEV_ESSENTIAL_DEPRECATED_STATIC_DECODER StaticDecoderoperator= (StaticDecoder &&)=default
 Move assignment operator.
 
virtual a_util::result::Result isValid () const
 
virtual size_t getElementCount () const
 
a_util::result::Result getElement (size_t index, const StructElement *&element) const
 Access information about an element. More...
 
a_util::result::Result getElementValue (size_t index, void *value) const
 Returns the current value of the given element by copying its data to the passed-in location. More...
 
a_util::result::Result getElementValue (size_t index, a_util::variant::Variant &value) const
 Returns the current value of the given element as a variant. More...
 
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)
 For internal use only.
 
- Protected Member Functions inherited from StaticDecoder
 StaticDecoder (std::shared_ptr< const StructLayout > layout, const void *data, size_t data_size, DataRepresentation rep)
 For internal use only.
 
 StaticDecoder (const std::shared_ptr< LegacyCodecAccess > &legacy_codec_access)
 For internal use only.
 

Additional Inherited Members

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

Detailed Description

Codec for static structures defined by a DataDefinition definition.

@dev_essential_deprecated Use the new ddl::codec::StaticCodec() instead.

Definition at line 153 of file static_codec_legacy.h.

Member Function Documentation

◆ getElementAddress() [1/2]

void* 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* getElementAddress
Parameters
[in]indexThe index of the element.
Returns
A pointer to the element or NULL in case of an error.

◆ setConstants()

a_util::result::Result setConstants ( )

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

Returns
Standard result.

◆ setElementValue() [1/2]

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