ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DecoderElement< ElementAccessType, ChildElementsType >

A DecoderElement to get values. More...

#include <codec_iterator.h>

Inheritance diagram for DecoderElement< ElementAccessType, ChildElementsType >:
[legend]

Public Types

using base_type = FactoryElement<ElementAccessType, ChildElementsType>
 base type
 
using self_type = DecoderElement<ElementAccessType, ChildElementsType>
 self type
 
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
 allowed iterator type
 
using const_iterator_type = typename child_elements_type::const_iterator
 allowed const iterator type
 
- Public Types inherited from 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
 allowed iterator type
 
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 (const std::string &name) 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 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.
 
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.
 
std::string getBaseName () const
 Get the base name of the element.
 
bool isArray () const
 Get array information.
 
bool hasChildren () const
 Get children information.
 
const child_elements_typegetChildElements () const
 Get the ChildElements.
 
self_type getChildElement (const std::string &name) 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 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
 

Private Member Functions

 DecoderElement (CodecIndex &&index, size_t end_element_index, size_t child_elements_count, access_type &access)
 
 DecoderElement (CodecIndex &&index, size_t end_element_index, access_type &access)
 
 DecoderElement (const std::string &element_name, access_type &access)
 
 DecoderElement (CodecIndex &&index, access_type &access)
 
 DecoderElement (access_type &access)
 
void next ()
 

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)

Definition at line 938 of file codec_iterator.h.

Member Typedef Documentation

◆ access_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
using access_type = typename ElementAccessType::access_type

access type from concept template

Definition at line 943 of file codec_iterator.h.

◆ base_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
using base_type = FactoryElement<ElementAccessType, ChildElementsType>

base type

Definition at line 940 of file codec_iterator.h.

◆ child_elements_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
using child_elements_type = typename base_type::child_elements_type

allowed container type

Definition at line 944 of file codec_iterator.h.

◆ const_iterator_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
using const_iterator_type = typename child_elements_type::const_iterator

allowed const iterator type

Definition at line 947 of file codec_iterator.h.

◆ iterator_type

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

allowed iterator type

Definition at line 945 of file codec_iterator.h.

◆ self_type

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

self type

Definition at line 941 of file codec_iterator.h.

Constructor & Destructor Documentation

◆ DecoderElement() [1/5]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
DecoderElement ( CodecIndex && index,
size_t end_element_index,
size_t child_elements_count,
access_type & access )
inlineprivate

Definition at line 1050 of file codec_iterator.h.

◆ DecoderElement() [2/5]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
DecoderElement ( CodecIndex && index,
size_t end_element_index,
access_type & access )
inlineprivate

Definition at line 1057 of file codec_iterator.h.

◆ DecoderElement() [3/5]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
DecoderElement ( const std::string & element_name,
access_type & access )
inlineprivate

Definition at line 1061 of file codec_iterator.h.

◆ DecoderElement() [4/5]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
DecoderElement ( CodecIndex && index,
access_type & access )
inlineprivate

Definition at line 1065 of file codec_iterator.h.

◆ DecoderElement() [5/5]

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
DecoderElement ( access_type & access)
inlineprivate

Definition at line 1068 of file codec_iterator.h.

Member Function Documentation

◆ getAddress()

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

Get the address of the element.

Returns
const void*

Definition at line 1022 of file codec_iterator.h.

◆ getArrayElement()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
self_type 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

Definition at line 1043 of file codec_iterator.h.

◆ getChildElement()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
self_type getChildElement ( const std::string & name) const
inline

Get the child element with the given name.

Parameters
nameName of the child element.
Returns
self_type

Definition at line 1031 of file codec_iterator.h.

◆ getRawValue()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
void 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)

Definition at line 1013 of file codec_iterator.h.

◆ getStringValue()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
std::string 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)

Definition at line 1003 of file codec_iterator.h.

◆ getValue()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
template<typename T>
T 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
getElementValue

Definition at line 986 of file codec_iterator.h.

Referenced by DecoderElement< DecoderElementAccess< const Decoder > >::getValue().

◆ getVariantValue()

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

Get the value as variant.

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

Definition at line 995 of file codec_iterator.h.

◆ next()

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
void next ( )
inlineprivate

Definition at line 1071 of file codec_iterator.h.

Member Data Documentation

◆ access_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
friend access_type

friend declaration for access_type

Definition at line 964 of file codec_iterator.h.

◆ base_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
friend base_type

friend declaration for base_type

Definition at line 968 of file codec_iterator.h.

◆ child_elements_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
friend child_elements_type

friend declaration for child_elements_type

Definition at line 952 of file codec_iterator.h.

◆ CodecElement< ElementAccessType, ChildElementsType >

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
friend CodecElement< ElementAccessType, ChildElementsType >

friend declaration for CodecElement

Definition at line 972 of file codec_iterator.h.

◆ const_iterator_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
friend const_iterator_type

friend declaration for const_iterator_type

Definition at line 960 of file codec_iterator.h.

◆ iterator_type

template<typename ElementAccessType, typename ChildElementsType = ChildElements<ElementAccessType>>
friend iterator_type

friend declaration for iterator_type

Definition at line 956 of file codec_iterator.h.