ADTF  3.14.3
Decoder

Decoder for dynamic structures defined by a DataDefinition definition. More...

Inheritance diagram for Decoder:
[legend]

Public Member Functions

 Decoder ()=default
 Default constructor.
 
 Decoder (Decoder &&)=default
 Move constructor.
 
Decoderoperator= (Decoder &&)=default
 Move assignment operator.
 
 Decoder (const Decoder &)=delete
 No copy constructor.
 
Decoderoperator= (const Decoder &)=delete
 No copy assignment operator.
 
virtual a_util::result::Result isValid () const
 
virtual size_t getElementCount () const
 
size_t getBufferSize (DataRepresentation rep=deserialized) const
 
Codec 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. More...
 
- Public Member Functions inherited from StaticDecoder
 StaticDecoder ()=default
 Default constructor.
 
 StaticDecoder (const StaticDecoder &)=delete
 Noncopyable.
 
StaticDecoderoperator= (const StaticDecoder &)=delete
 Noncopyable.
 
 StaticDecoder (StaticDecoder &&)=default
 Move constructor.
 
StaticDecoderoperator= (StaticDecoder &&)=default
 Move assignment operator.
 
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

 Decoder (a_util::memory::shared_ptr< const StructLayout > layout, const void *data, size_t data_size, DataRepresentation rep)
 For internal use only.
 
 Decoder (const Decoder &decoder, const void *data, size_t data_size, DataRepresentation rep)
 For internal use only.
 
virtual const StructLayoutElement * getLayoutElement (size_t index) const
 For internal use only.
 
- Protected Member Functions inherited from StaticDecoder
 StaticDecoder (a_util::memory::shared_ptr< const StructLayout > layout, const void *data, size_t data_size, DataRepresentation rep)
 For internal use only.
 

Protected Attributes

a_util::memory::shared_ptr< std::vector< StructLayoutElement > > _dynamic_elements
 For internal use only.
 
Offsets _buffer_sizes
 For internal use only.
 
- Protected Attributes inherited from StaticDecoder
a_util::memory::shared_ptr< const StructLayout > _layout
 For internal use only.
 
const void * _data
 For internal use only.
 
size_t _data_size
 For internal use only.
 
const ElementAccessor * _element_accessor
 For internal use only.
 

Private Member Functions

a_util::result::Result calculateDynamicElements ()
 For internal use only.
 
a_util::result::Result addDynamicElements (const DynamicStructLayoutElement &dynamic_element, Offsets &overall_offsets, const std::string &prefix)
 For internal use only.
 
a_util::result::Result addDynamicElement (const DynamicStructLayoutElement &dynamic_element, const std::string &array_index, Offsets &overall_offsets, const std::string &prefix)
 For internal use only.
 
a_util::result::Result addStaticStructElements (const DynamicStructLayoutElement &dynamic_element, const std::string &array_index, Offsets &overall_offsets, const std::string &prefix)
 For internal use only.
 
a_util::result::Result addDynamicStructElements (const DynamicStructLayoutElement &dynamic_element, const std::string &array_index, Offsets &overall_offsets, const std::string &prefix)
 For internal use only.
 
a_util::result::Result addDynamicStructElement (const StructLayoutElement &element)
 For internal use only.
 
void moveToAlignment (size_t &bit_offset, size_t alignment)
 For internal use only.
 

Detailed Description

Member Function Documentation

◆ getBufferSize()

size_t 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()

virtual size_t getElementCount ( ) const
virtual

Returns
The amount of elements contained in the data structure.

Reimplemented from StaticDecoder.

◆ isValid()

virtual a_util::result::Result isValid ( ) const
virtual

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

Reimplemented from StaticDecoder.

◆ makeCodecFor()

Codec 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.

Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Thu Jun 9 2022 by doxygen 1.9.1)