15 #ifndef DDL_CODEC_CLASS_HEADER
16 #define DDL_CODEC_CLASS_HEADER
19 #include <ddl/codec/static_codec.h>
127 Decoder(std::shared_ptr<const StructAccess> codec_access,
223 template <
typename T>
237 template <
typename T>
296 Codec(std::shared_ptr<const StructAccess> codec_access,
313 #include <ddl/codec/legacy/codec_legacy.h>
A common result class usable as return value throughout.
Container type, able to store any primitive data type (and arrays thereof)
Iteratable container type for the given Element type in ElementAccessType::element_type.
A CodecElement to get and set values.
Factory class for ddl codecs.
Decoder for dynamic structures defined by a DataDefinition definition.
void setElementValue(const LeafCodecIndex &leaf_codec_index, const T &value)
Sets the current value of the given element from given value in type T.
Element getElement(const CodecIndex &codec_index)
Retrieves an element instance based on the codec index of that element.
void setElementVariantValue(const CodecIndex &codec_index, const a_util::variant::Variant &value)
Sets the current value of the given element from the given variant.
Codec()
Default constructor.
ChildElements< CodecElementAccess< Codec > > Elements
Iterator container to iterate all elements of the codec.
void * getElementAddress(const CodecIndex &codec_index)
Codec & operator=(Codec &&)
Move assignment operator.
Codec(Codec &&)
Move constructor.
void resetValues(bool zero_values=false)
Sets all elements to their default values, constant values defined in the data definition or zero if ...
CodecElement< CodecElementAccess< Codec > > Element
Codec element.
void setElementValue(const CodecIndex &codec_index, const T &value)
Sets the current value of the given element from given value in type T.
Element getElement(const std::string &full_element_name)
Retrieves an element instance based on the full name of the element.
Codec(const Codec &)=delete
No copy constructor.
void setElementRawValue(const CodecIndex &codec_index, const void *value, size_t value_size)
Sets the current value of the given element by copying its data from the passed-in location.
void * getData() noexcept
Get the current set data.
Elements & getElements()
Retrieves the elements of the codec to get element information.
void setElementStringValue(const CodecIndex &codec_index, const std::string &value)
Sets the current value of the given element from the given string.
Codec & operator=(const Codec &)=delete
No copy assignment operator.
Fast Access Index Type for the coders.
A DecoderElement to get values.
Decoder for dynamic structures defined by a DataDefinition definition.
DecoderElement< DecoderElementAccess< const Decoder > > Element
Decoder element.
Decoder(const Decoder &decoder, const void *data, size_t data_size, DataRepresentation representation)
For internal use only.
Element getElement(const CodecIndex &codec_index) const
Retrieves an element instance based on the codec index of that element.
Element getElement(const std::string &full_element_name) const
Retrieves an element instance based on the full name of the element.
Decoder(Decoder &&)
Move constructor.
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.
Decoder(const Decoder &)=delete
No copy constructor.
Decoder & operator=(const Decoder &)=delete
No copy assignment operator.
a_util::result::Result isValid() const override
Decoder(std::shared_ptr< const StructAccess > codec_access, const void *data, size_t data_size, DataRepresentation representation)
For internal use only.
size_t getBufferSize() const
Gets the buffer size in bytes for the main structure.
Decoder & operator=(Decoder &&)
Move assignment operator.
ChildElements< DecoderElementAccess< const Decoder > > Elements
Iterator container to iterate all elements of the decoder and get values.
const Elements & getElements() const
Retrieves the elements of the decoder to get element information and get values.
size_t getBufferSize(DataRepresentation representation) const
Gets the buffer size in bytes for the main structure.
Decoder()
Default constructor.
A factory element access type concept template to retrieve element information from the AccessType.
The Leaf codec index is a small layout information index to access the decoders/codecs data very fast...
const LeafLayout & getLayout() const noexcept
Get the leaf layout.
Decoder for static structures defined by a DataDefinition definition.
size_t getDataSize() const noexcept
Get the current size (in bytes) of the data.
const void * getData() const noexcept
Get the current set data.
const void * getElementAddress(const CodecIndex &index) const
definition of the ddl namespace
DataRepresentation
Enumeration for the data representation.
static void setValue(void *data, const size_t data_size, const LeafLayout &leaf_layout, const ValueType &value)
Sets the current value if the given element as a ValueType if supported.
static void setValue(CodecType &codec, const CodecIndex &codec_index, const ValueType &value)
Sets the current value of the given element as a ValueType if supported.
Common include for component a_util::result.