A CodecElement to get and set values. More...
#include <codec_iterator.h>
Public Types | |
using | factory_base_type = FactoryElement<ElementAccessType, ChildElementsType> |
factory base type | |
using | base_type = DecoderElement<ElementAccessType, ChildElementsType> |
base type | |
using | self_type = CodecElement<ElementAccessType, ChildElementsType> |
self type | |
using | access_type = typename ElementAccessType::access_type |
access type from the concept | |
using | child_elements_type = typename factory_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 | |
![]() | |
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 | |
![]() | |
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 | |
CodecElement ()=delete | |
CTOR. | |
template<typename T> | |
void | setValue (const T &value) |
Sets the value from value of type T . | |
void | setVariantValue (const a_util::variant::Variant &value) |
Sets the value from value as variant. | |
void | setStringValue (const std::string &value) |
Sets the value from value as string. | |
void | setRawValue (const void *value, size_t value_size) |
Set the value by copying from a value buffer. | |
void | reset (bool zero_value_of_known_type=false) |
Reset the elements value to their default values, constant values defined in the data definition or zero if zero_value is set. | |
void * | getAddress () |
Get the address (with writing access) | |
child_elements_type & | getChildElements () |
Gets an reference to the child elements. | |
self_type | getChildElement (const std::string &name) const |
Get a dedicated ChildElement by name. | |
self_type | getChildElement (const std::string &name) |
Get a dedicated ChildElement by name. | |
self_type | getArrayElement (size_t array_pos=0) const |
Get the array element of the given array_pos . | |
self_type | getArrayElement (size_t array_pos=0) |
Get the array element of the given array_pos . | |
const void * | getAddress () const |
Get the address of the element. | |
const child_elements_type & | getChildElements () const |
Get the ChildElements. | |
![]() | |
DecoderElement ()=delete | |
CTOR. | |
template<typename T> | |
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 . | |
![]() | |
FactoryElement ()=delete | |
no CTOR | |
FactoryElement (FactoryElement &&other) | |
move CTOR | |
FactoryElement & | operator= (FactoryElement &&other) |
copy assignment operator | |
FactoryElement (const FactoryElement &other) | |
copy CTOR | |
FactoryElement & | operator= (const FactoryElement &other) |
move assignment operator | |
~FactoryElement ()=default | |
DTOR. | |
const CodecIndex & | getIndex () 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_type & | getChildElements () 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. | |
Private Member Functions | |
CodecElement (CodecIndex &&index, size_t end_element_index, size_t child_elements_count, access_type &access) | |
CodecElement (CodecIndex &&index, size_t end_element_index, access_type &access) | |
CodecElement (const std::string &element_name, access_type &access) | |
CodecElement (CodecIndex &&index, access_type &access) | |
CodecElement (access_type &access) | |
void | next () |
A CodecElement to get and set values.
ElementAccessType | The element access concept type. (see concept templates CodecElementAccess) |
Definition at line 1191 of file codec_iterator.h.
using access_type = typename ElementAccessType::access_type |
access type from the concept
Definition at line 1197 of file codec_iterator.h.
using base_type = DecoderElement<ElementAccessType, ChildElementsType> |
base type
Definition at line 1195 of file codec_iterator.h.
using child_elements_type = typename factory_base_type::child_elements_type |
allowed container type
Definition at line 1199 of file codec_iterator.h.
using const_iterator_type = typename child_elements_type::const_iterator |
allowed const iterator type
Definition at line 1202 of file codec_iterator.h.
using factory_base_type = FactoryElement<ElementAccessType, ChildElementsType> |
factory base type
Definition at line 1194 of file codec_iterator.h.
using iterator_type = typename child_elements_type::iterator |
allowed iterator type
Definition at line 1200 of file codec_iterator.h.
using self_type = CodecElement<ElementAccessType, ChildElementsType> |
self type
Definition at line 1196 of file codec_iterator.h.
|
inlineprivate |
Definition at line 1384 of file codec_iterator.h.
|
inlineprivate |
Definition at line 1391 of file codec_iterator.h.
|
inlineprivate |
Definition at line 1395 of file codec_iterator.h.
|
inlineprivate |
Definition at line 1399 of file codec_iterator.h.
|
inlineprivate |
Definition at line 1402 of file codec_iterator.h.
|
inline |
Get the address (with writing access)
Definition at line 1319 of file codec_iterator.h.
|
inline |
Get the address of the element.
Definition at line 1022 of file codec_iterator.h.
|
inline |
Get the array element of the given array_pos
.
array_pos | The array pos of the element to retrieve |
Definition at line 1377 of file codec_iterator.h.
|
inline |
Get the array element of the given array_pos
.
array_pos | The array pos of the element to retrieve |
Definition at line 1366 of file codec_iterator.h.
|
inline |
Get a dedicated ChildElement by name.
name | The name if point notation. |
std::runtime_error | if name is not valid or not found |
Definition at line 1354 of file codec_iterator.h.
|
inline |
Get a dedicated ChildElement by name.
name | The name if point notation. |
std::runtime_error | if name is not valid or not found |
Definition at line 1340 of file codec_iterator.h.
|
inline |
Gets an reference to the child elements.
Definition at line 1330 of file codec_iterator.h.
|
inline |
Get the ChildElements.
std::runtime_error | if index is invalid |
Definition at line 710 of file codec_iterator.h.
|
inlineprivate |
Definition at line 1405 of file codec_iterator.h.
|
inline |
Reset the elements value to their default values, constant values defined in the data definition or zero if zero_value
is set.
[in] | zero_value_of_known_type | set the value to 0 if no constant or default value set in data definition. |
Definition at line 1284 of file codec_iterator.h.
|
inline |
Set the value by copying from a value
buffer.
[in] | value | The value buffer |
[in] | value_size | the size of the value buffer in bytes. |
Definition at line 1272 of file codec_iterator.h.
|
inline |
Sets the value from value
as string.
[in] | value | The value to set as string. string will be converted to the elements type. |
Definition at line 1261 of file codec_iterator.h.
|
inline |
Sets the value from value
of type T
.
T | Type of the value |
[in] | value | The value in type T |
Definition at line 1241 of file codec_iterator.h.
Referenced by CodecElement< CodecElementAccess< Codec > >::setValue().
|
inline |
Sets the value from value
as variant.
[in] | value | The value to set as variant |
Definition at line 1251 of file codec_iterator.h.
friend access_type |
friend declaration for access_type
Definition at line 1219 of file codec_iterator.h.
friend base_type |
friend declaration for base_type
Definition at line 1223 of file codec_iterator.h.
friend child_elements_type |
friend declaration for child_elements_type
Definition at line 1207 of file codec_iterator.h.
friend const_iterator_type |
friend declaration for const_iterator_type
Definition at line 1215 of file codec_iterator.h.
friend factory_base_type |
friend declaration for factory_base_type
Definition at line 1227 of file codec_iterator.h.
friend iterator_type |
friend declaration for iterator_type
Definition at line 1211 of file codec_iterator.h.