Dev Essential  1.6.3
Loading...
Searching...
No Matches
ddl::codec::DecoderElement< ElementAccessType, ChildElementsType > Class Template Reference

A DecoderElement to get values. More...

#include <codec_iterator.h>

Inherits ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >.

Inherited by ddl::codec::CodecElement< ElementAccessType, ChildElementsType >.

Public Types

using base_type = FactoryElement<ElementAccessType, ChildElementsType>
 base type
 
using self_type = DecoderElement<ElementAccessType, ChildElementsType>
 
using access_type = typename ElementAccessType::access_type
 access type from concept template
 
using child_elements_type = typename base_type::child_elements_type
 allowed container type
 
using iterator_type = typename child_elements_type::iterator
 
using const_iterator_type = typename child_elements_type::const_iterator
 allowed const iterator type
 
- Public Types inherited from ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >
using self_type = FactoryElement<ElementAccessType, ChildElementsType>
 self type
 
using access_type = typename ElementAccessType::access_type
 access type
 
using child_elements_type = ChildElementsType
 allowed container type
 
using iterator_type = typename child_elements_type::iterator
 
using const_iterator_type = typename child_elements_type::const_iterator
 allowed const iterator type
 

Public Member Functions

 DecoderElement ()=delete
 CTOR.
 
template<typename T>
getValue () const
 Get the value as type T.
 
a_util::variant::Variant getVariantValue () const
 Get the value as variant.
 
std::string getStringValue () const
 Get the value as string.
 
void getRawValue (void *value, size_t value_size) const
 Get the as copy to the value buffer.
 
const void * getAddress () const
 Get the address of the element.
 
self_type getChildElement (std::string_view path) const
 Get the child element with the given name.
 
self_type getArrayElement (size_t array_pos=0) const
 Get the array element of the given array_pos.
 
- Public Member Functions inherited from ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >
 FactoryElement ()=delete
 no CTOR
 
 FactoryElement (FactoryElement &&other)
 move CTOR
 
FactoryElementoperator= (FactoryElement &&other)
 copy assignment operator
 
 FactoryElement (const FactoryElement &other)
 copy CTOR
 
FactoryElementoperator= (const FactoryElement &other)
 move assignment operator
 
 ~FactoryElement ()=default
 DTOR.
 
const CodecIndexgetIndex () const
 Get the codec index of the element.
 
size_t getArraySize () const
 Get the array size.
 
ddl::codec::ElementType getType () const
 Get the type of the element.
 
std::string getFullName () const
 Get the full name of the element. If the element is an array you get the elements array name representation: "main_element.element_name[0]" or main_element.element_name[1] ... etc. If the element is not an array you get the elements name representation: "main_element.element_name".
 
std::string getName () const
 Get the name of the element If the element is an array you get the elements array name representation: "element_name[0]" or element_name[1] ... etc. If the element is not an array you get the elements name representation: "element_name".
 
std::string getBaseName () const
 Get the base name of the element. If the element is an array you get the elements base name representation : "element_name" for each array element. If the element is not an array you get the elements name representation is also the base name representation: "element_name" .
 
bool isArray () const
 Get array information.
 
bool hasChildren () const
 Get children information.
 
const child_elements_typegetChildElements () const
 Get the ChildElements.
 
self_type getChildElement (std::string_view path) const
 Get the child element with the given name.
 
self_type getArrayElement (size_t array_pos=0) const
 Get the array element of the given array_pos.
 
bool isValid () const
 Get validation indormation.
 

Public Attributes

friend child_elements_type
 friend declaration for child_elements_type
 
friend iterator_type
 friend declaration for iterator_type
 
friend const_iterator_type
 friend declaration for const_iterator_type
 
friend access_type
 friend declaration for access_type
 
friend base_type
 friend declaration for base_type
 
friend CodecElement< ElementAccessType, ChildElementsType >
 friend declaration for CodecElement
 
- Public Attributes inherited from ddl::codec::FactoryElement< ElementAccessType, ChildElementsType >
friend child_elements_type
 friend declaration for child_elements_type
 
friend iterator_type
 friend declaration for iterator_type
 
friend const_iterator_type
 friend declaration for child_elements_type
 
friend access_type
 friend declaration for access_type
 
friend DecoderElement< ElementAccessType, ChildElementsType >
 friend declaration for DecoderElement
 
friend CodecElement< ElementAccessType, ChildElementsType >
 friend declaration for CodecElement
 

Detailed Description

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
class ddl::codec::DecoderElement< ElementAccessType, ChildElementsType >

A DecoderElement to get values.

Template Parameters
ElementAccessTypeThe element access concept type. (see concept templates DecoderElementAccess, CodecElementAccess)

Member Typedef Documentation

◆ iterator_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
using ddl::codec::DecoderElement< ElementAccessType, ChildElementsType >::iterator_type = typename child_elements_type::iterator

allowed iterator type

◆ self_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
using ddl::codec::DecoderElement< ElementAccessType, ChildElementsType >::self_type = DecoderElement<ElementAccessType, ChildElementsType>

self type

Member Function Documentation

◆ getAddress()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
const void * ddl::codec::DecoderElement< ElementAccessType, ChildElementsType >::getAddress ( ) const
inline

Get the address of the element.

Returns
const void*

◆ getArrayElement()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
self_type ddl::codec::DecoderElement< ElementAccessType, ChildElementsType >::getArrayElement ( size_t array_pos = 0) const
inline

Get the array element of the given array_pos.

Parameters
array_posThe array pos of the element to retrieve
Returns
self_type

◆ getChildElement()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
self_type ddl::codec::DecoderElement< ElementAccessType, ChildElementsType >::getChildElement ( std::string_view path) const
inline

Get the child element with the given name.

Parameters
pathName of the child element.
Returns
self_type

◆ getRawValue()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
void ddl::codec::DecoderElement< ElementAccessType, ChildElementsType >::getRawValue ( void * value,
size_t value_size ) const
inline

Get the as copy to the value buffer.

Parameters
valueThe value buffer to copy to
value_sizeThe size of the value buffer (if 0 its unsafe usage without size check!, the size is only retrieved from the codec information)

◆ getStringValue()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
std::string ddl::codec::DecoderElement< ElementAccessType, ChildElementsType >::getStringValue ( ) const
inline

Get the value as string.

Returns
value as string (the value is returned as enum element name in case of enum type)

◆ getValue()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
template<typename T>
T ddl::codec::DecoderElement< ElementAccessType, ChildElementsType >::getValue ( ) const
inline

Get the value as type T.

Template Parameters
TType of the value to return
Returns
value in type T (supported types: all int types, bool, float, double, std::string)
Remarks
for T = std::string the value is returned as element name in case of enum type
See also
StaticCodec::getElementValue

◆ getVariantValue()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
a_util::variant::Variant ddl::codec::DecoderElement< ElementAccessType, ChildElementsType >::getVariantValue ( ) const
inline

Get the value as variant.

Returns
value as variant (supported types: all int types, bool, float, double, std::string)

The documentation for this class was generated from the following file: