ADTF
|
Decoder for dynamic structures defined by a DataDefinition definition. More...
Public Types | |
typedef DecoderElement< DecoderElementAccess< const Decoder > > | Element |
Decoder element. | |
typedef ChildElements< DecoderElementAccess< const Decoder > > | Elements |
Iterator container to iterate all elements of the decoder and get values. More... | |
Public Types inherited from StaticDecoder | |
typedef DecoderElement< DecoderElementAccess< const StaticDecoder > > | Element |
Static decoder element. | |
typedef ChildElements< DecoderElementAccess< const StaticDecoder > > | Elements |
Iterator container to iterate all elements of the static decoder. More... | |
Public Member Functions | |
Decoder () | |
Default constructor. | |
Decoder (Decoder &&) | |
Move constructor. | |
Decoder & | operator= (Decoder &&) |
Move assignment operator. | |
Decoder (const Decoder &)=delete | |
No copy constructor. | |
Decoder & | operator= (const Decoder &)=delete |
No copy assignment operator. | |
a_util::result::Result | isValid () const override |
Element | getElement (const CodecIndex &codec_index) const |
Retrieves an element instance based on the codec index of that element. More... | |
Element | getElement (const std::string &full_element_name) const |
Retrieves an element instance based on the full name of the element. More... | |
const Elements & | getElements () const |
Retrieves the elements of the decoder to get element information and get values. More... | |
size_t | getBufferSize () const |
Gets the buffer size in bytes for the main structure. More... | |
size_t | getBufferSize (DataRepresentation representation) const |
Gets the buffer size in bytes for the main structure. More... | |
Codec | makeCodecFor (void *data, size_t data_size, DataRepresentation representation) 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 | |
DTOR. | |
StaticDecoder () | |
Default constructor. | |
StaticDecoder (const StaticDecoder &)=delete | |
Noncopyable. | |
StaticDecoder & | operator= (const StaticDecoder &)=delete |
Noncopyable. | |
StaticDecoder (StaticDecoder &&) | |
Move constructor. | |
StaticDecoder & | operator= (StaticDecoder &&) |
Move assignment operator. | |
Element | getElement (const CodecIndex &codec_index) const |
Retrieves an element instance based on the codec index of that element. More... | |
Element | getElement (const std::string &full_element_name) const |
Retrieves an element instance based on the full name of the element. More... | |
const Elements & | getElements () const |
Retrieves the elements of the static decoder to get element information. More... | |
size_t | getElementChildCount (const CodecIndex &codec_index=CodecIndex()) const |
Retrieves the amount of child elements for the given codec index. More... | |
std::string | getElementFullName (const CodecIndex &codec_index) const |
Retrieves the full name of the element within its main structure. More... | |
std::string | getElementName (const CodecIndex &codec_index) const |
Retrieves the name of the element within its structured element. More... | |
const std::string & | getElementBaseName (const CodecIndex &codec_index) const |
Retrieves the base name of the element within its structured element. More... | |
template<typename T > | |
T | getElementValue (const CodecIndex &codec_index) const |
Returns the current value of the given element as a T if supported. More... | |
template<typename T > | |
T | getElementValue (const LeafCodecIndex &leaf_codec_index) const |
Returns the current value of the given element as a T if supported. More... | |
a_util::variant::Variant | getElementVariantValue (const CodecIndex &codec_index) const |
Returns the current value of the given element as a variant. More... | |
void | getElementVariantValue (const CodecIndex &codec_index, a_util::variant::Variant &value) const |
Returns the current value of the given element as a variant. More... | |
std::string | getElementStringValue (const CodecIndex &codec_index) const |
Returns the current value of the given element as a string. More... | |
void | getElementRawValue (const CodecIndex &index, void *value, size_t value_size) const |
Returns the current value of the given element as a variant. More... | |
const void * | getElementAddress (const CodecIndex &index) const |
size_t | getStaticBufferSize () const |
Gets the static buffer size in bytes for the main structure. More... | |
size_t | getStaticBufferSize (DataRepresentation rep) const |
Gets the static buffer size in bytes for the main structure. More... | |
DataRepresentation | getRepresentation () const |
Returns the current data representation the decoder decodes from. More... | |
CodecIndex | resolve (size_t leaf_index) const |
CodecIndex | resolve (size_t leaf_index, std::string &element_full_name) const |
size_t | getElementCount () const |
is the leaf count More... | |
a_util::result::Result | getElement (size_t leaf_index, const ddl::StructElement *&legacy_struct_element) const |
Returns the StructElement of the element with given leaf index. More... | |
void | resolve (CodecIndex &codec_index) const |
The codec index will be resolved for fast access (layout will be set) More... | |
const void * | getData () const noexcept |
Get the current set data. More... | |
size_t | getDataSize () const noexcept |
Get the current size (in bytes) of the data. More... | |
Protected Member Functions | |
Decoder (std::shared_ptr< const StructAccess > codec_access, const void *data, size_t data_size, DataRepresentation representation) | |
For internal use only. | |
Decoder (const Decoder &decoder, const void *data, size_t data_size, DataRepresentation representation) | |
For internal use only. | |
Protected Member Functions inherited from StaticDecoder | |
StaticDecoder (std::shared_ptr< const StructAccess > codec_access, const void *data, size_t data_size, DataRepresentation representation) | |
For internal use only. | |
Private Attributes | |
Element | _first_element |
Additional Inherited Members | |
Protected Attributes inherited from StaticDecoder | |
std::shared_ptr< const StructAccess > | _codec_access |
For internal use only. | |
const void * | _data = nullptr |
For internal use only. | |
size_t | _data_size = 0 |
For internal use only. | |
const ddl::codec::ElementAccessor * | _element_accessor |
For internal use only. | |
Decoder for dynamic structures defined by a DataDefinition definition.
Definition at line 30 of file workspace/conan/dev_essential/1.4.3/dw/stable/package/aef85909f792a5a628750d25016a24323084963f/include/ddl/codec/codec.h.
typedef ChildElements<DecoderElementAccess<const Decoder> > Elements |
Iterator container to iterate all elements of the decoder and get values.
Definition at line 95 of file workspace/conan/dev_essential/1.4.3/dw/stable/package/aef85909f792a5a628750d25016a24323084963f/include/ddl/codec/codec.h.
size_t getBufferSize | ( | ) | const |
Gets the buffer size in bytes for the main structure.
size_t | of the structure depending on the current representation (getRepresentation) |
size_t getBufferSize | ( | DataRepresentation | representation | ) | const |
Gets the buffer size in bytes for the main structure.
[in] | representation | The data representation for which the buffer size should be returned. |
Element getElement | ( | const CodecIndex & | codec_index | ) | const |
Retrieves an element instance based on the codec index of that element.
[in] | codec_index | The codec index. |
throws | std::runtime_error if not found. |
Element getElement | ( | const std::string & | full_element_name | ) | const |
Retrieves an element instance based on the full name of the element.
[in] | full_element_name | The full name of the element in point notation (i.e. "element1.child_element[4].element_value" ). |
By using an empty string the deserialized decoding information within CodecIndex will retrieve the buffers first address and whole buffersize. By refering an array without dedicated array index position the deserialized decoding information within CodecIndex will be set to the arrays first address and the whole array size. By refering an structured value (not a leaf value) the deserialized decoding information within CodecIndex will be set to the structs first address and the whole struct size.
throws | std::runtime_error if not found. |
const Elements& getElements | ( | ) | const |
Retrieves the elements of the decoder to get element information and get values.
|
overridevirtual |
ERR_INVALID_ARG | The passed data is not large enough. |
Reimplemented from StaticDecoder.
Codec makeCodecFor | ( | void * | data, |
size_t | data_size, | ||
DataRepresentation | representation | ||
) | const |
Create a new codec with the current dynamic structure layout for a new data buffer.
[in] | data | The pointer to the new raw data. |
[in] | data_size | The size of the new raw data. |
[in] | representation | The representation that the data should be encoded in. |