ADTF  3.15.1
ddl::access_element Namespace Reference

definition of the access_element namespace (codecs) More...

Classes

class  StructElementLegacy
 Legacy helper for the ddl::StructElement. More...
 

Functions

template<typename T >
a_util::result::Result findIndex (const T &decoder, const std::string &element_name, size_t &index)
 find the index of an element by name. More...
 
template<typename T >
a_util::result::Result findStructIndex (const T &decoder, const std::string &struct_name, size_t &index)
 find the index of the first element of a sub-structure by name. More...
 
template<typename T >
a_util::result::Result findArrayIndex (const T &decoder, const std::string &array_name, size_t &index)
 find the index of the first element of an array by name. More...
 
template<typename T >
a_util::result::Result findArrayEndIndex (const T &decoder, const std::string &array_name, size_t &index)
 find the index of the first element after an array by name. More...
 
template<typename T >
a_util::result::Result getValue (const T &decoder, const std::string &element_name, void *value)
 Get the value of an element by name. More...
 
template<typename T >
a_util::result::Result setValue (T &codec, const std::string &element_name, const void *value)
 Set the value of an element by name. More...
 
template<typename T >
a_util::variant::Variant getValue (const T &decoder, const std::string &element_name)
 Get the value of an element by name. More...
 
template<typename T >
a_util::result::Result setValue (T &codec, const std::string &element_name, const a_util::variant::Variant &value)
 Set the value of an element by name. More...
 
template<typename T >
a_util::variant::Variant getValue (const T &decoder, size_t element_index)
 Get the value of an element by index. More...
 
template<typename T >
const void * getValueAddress (const T &decoder, const std::string &element_name)
 Get a pointer to an element by name. More...
 
template<typename T >
void * getValueAddress (T &codec, const std::string &element_name)
 Get a pointer to an element by name. More...
 
template<typename STRUCT , typename T >
const STRUCT * getStructAddress (const T &decoder, const std::string &struct_name)
 Get a pointer to a sub-structure by name. More...
 
template<typename STRUCT , typename T >
STRUCT * getStructAddress (T &codec, const std::string &struct_name)
 Get a pointer to a sub-structure by name. More...
 
template<typename T , typename CODEC >
a_util::result::Result getStructValue (const CODEC &decoder, const std::string &struct_name, T *struct_value)
 Copy a sub-structure out of the structure. More...
 
template<typename T , typename CODEC >
a_util::result::Result setStructValue (CODEC &codec, const std::string &struct_name, const T *struct_value)
 Copy a sub-structure into the structure. More...
 
template<typename ARRAY_TYPE , typename T >
const ARRAY_TYPE * getArrayAddress (const T &decoder, const std::string &array_name)
 Get a pointer to an array by name. More...
 
template<typename ARRAY_TYPE , typename T >
ARRAY_TYPE * getArrayAddress (T &codec, const std::string &array_name)
 Get a pointer to an array by name. More...
 
template<typename CODEC >
a_util::result::Result getArray (const CODEC &decoder, const std::string &array_name, const void *&start_address, size_t &size)
 Get information about an array. More...
 
template<typename T , typename CODEC >
a_util::result::Result getArrayValue (const CODEC &decoder, const std::string &array_name, T *array_value)
 Copy an array out of the structure. More...
 
template<typename T >
a_util::result::Result reset (T &codec, const std::string &element_name)
 Set the value of the requested element to zero. More...
 
template<typename T >
std::string getValueAsString (const T &decoder, size_t element_index)
 Get the value of an element as a string, using enum value names if available. More...
 
template<typename T >
std::string getValueAsString (const T &decoder, const std::string &element_name)
 Get the value of an element as a string, using enum value names if available. More...
 
 _MAKE_RESULT (-20, ERR_STRUCT_ELEMENT_NOT_FOUND)
 Creates an a_util error ERR_AUTIL_NOT_FOUND.
 

Detailed Description

definition of the access_element namespace (codecs)

Function Documentation

◆ findArrayEndIndex()

a_util::result::Result ddl::access_element::findArrayEndIndex ( const T &  decoder,
const std::string &  array_name,
size_t &  index 
)

find the index of the first element after an array by name.

Parameters
[in]decoderThe decoder or factory.
[in]array_nameThe name of the array.
[out]indexThe index of the found element.
Return values
ERR_NOT_FOUNDNo element with the requested name was found.

Definition at line 167 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References a_util::strings::compare(), a_util::result::isFailed(), and StructElement::name.

Referenced by getArray().

◆ findArrayIndex()

a_util::result::Result ddl::access_element::findArrayIndex ( const T &  decoder,
const std::string &  array_name,
size_t &  index 
)

find the index of the first element of an array by name.

Parameters
[in]decoderThe decoder or factory.
[in]array_nameThe name of the array.
[out]indexThe index of the found element.
Return values
ERR_NOT_FOUNDNo element with the requested name was found.

Definition at line 152 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

Referenced by getArray(), and getArrayAddress().

◆ findIndex()

a_util::result::Result ddl::access_element::findIndex ( const T &  decoder,
const std::string &  element_name,
size_t &  index 
)

find the index of an element by name.

Parameters
[in]decoderThe decoder or factory.
[in]element_nameThe name of the element.
[out]indexThe index of the found element.
Return values
ERR_NOT_FOUNDNo element with the requested name was found.

Definition at line 113 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References a_util::result::isOk(), and StructElement::name.

Referenced by getValue(), getValueAddress(), getValueAsString(), reset(), and setValue().

◆ findStructIndex()

a_util::result::Result ddl::access_element::findStructIndex ( const T &  decoder,
const std::string &  struct_name,
size_t &  index 
)

find the index of the first element of a sub-structure by name.

Parameters
[in]decoderThe decoder or factory.
[in]struct_nameThe name of the sub-structure.
[out]indexThe index of the found element.
Return values
ERR_NOT_FOUNDNo element with the requested name was found.

Definition at line 137 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

Referenced by getStructAddress().

◆ getArray()

a_util::result::Result ddl::access_element::getArray ( const CODEC &  decoder,
const std::string &  array_name,
const void *&  start_address,
size_t &  size 
)

Get information about an array.

Parameters
[in]decoderThe decoder.
[in]array_nameThe name of the array.
[out]start_addressThe address of the first element of the array.
[out]sizeThe byte size of all elements of that array.
Return values
ERR_NOT_FOUNDNo array with the requested name was found.

Definition at line 431 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References findArrayEndIndex(), findArrayIndex(), and a_util::result::isFailed().

Referenced by getArrayValue().

◆ getArrayAddress() [1/2]

const ARRAY_TYPE* ddl::access_element::getArrayAddress ( const T &  decoder,
const std::string &  array_name 
)

Get a pointer to an array by name.

Parameters
[in]decoderThe decoder.
[in]array_nameThe name of the array.
Returns
Address of the array.

Definition at line 395 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References adtf_ddl::access_element::find_array_index(), and a_util::result::isOk().

◆ getArrayAddress() [2/2]

ARRAY_TYPE* ddl::access_element::getArrayAddress ( T &  codec,
const std::string &  array_name 
)

Get a pointer to an array by name.

Parameters
[in]codecThe codec.
[in]array_nameThe name of the array.
Returns
Address of the array.

Definition at line 412 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References findArrayIndex(), and a_util::result::isOk().

◆ getArrayValue()

a_util::result::Result ddl::access_element::getArrayValue ( const CODEC &  decoder,
const std::string &  array_name,
T *  array_value 
)

Copy an array out of the structure.

Parameters
[in]decoderThe decoder.
[in]array_nameThe name of the array.
[out]array_valueThe location the array will be copied to.
Return values
ERR_NOT_FOUNDNo array with the requested name was found.

Definition at line 473 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References a_util::memory::copy(), getArray(), and a_util::result::isFailed().

◆ getStructAddress() [1/2]

const STRUCT* ddl::access_element::getStructAddress ( const T &  decoder,
const std::string &  struct_name 
)

Get a pointer to a sub-structure by name.

Parameters
[in]decoderThe codec.
[in]struct_nameThe name of the structure.
Returns
Address of the sub-structure.

Definition at line 319 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References findStructIndex(), and a_util::result::isOk().

◆ getStructAddress() [2/2]

STRUCT* ddl::access_element::getStructAddress ( T &  codec,
const std::string &  struct_name 
)

Get a pointer to a sub-structure by name.

Parameters
[in]codecThe codec.
[in]struct_nameThe name of the structure.
Returns
Address of the sub-structure.

Definition at line 336 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References findStructIndex(), and a_util::result::isOk().

◆ getStructValue()

a_util::result::Result ddl::access_element::getStructValue ( const CODEC &  decoder,
const std::string &  struct_name,
T *  struct_value 
)

Copy a sub-structure out of the structure.

Parameters
[in]decoderThe decoder.
[in]struct_nameThe name of the structure.
[out]struct_valueThe location the sub-structure will be copied to.
Return values
ERR_NOT_FOUNDNo structure with the requested name was found.

Definition at line 354 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References a_util::memory::copy().

◆ getValue() [1/3]

a_util::variant::Variant ddl::access_element::getValue ( const T &  decoder,
const std::string &  element_name 
)

Get the value of an element by name.

Parameters
[in]decoderThe decoder.
[in]element_nameThe name of the element.
Return values
Thevalue of the element.

Definition at line 231 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References findIndex(), and a_util::result::isOk().

◆ getValue() [2/3]

a_util::result::Result ddl::access_element::getValue ( const T &  decoder,
const std::string &  element_name,
void *  value 
)

Get the value of an element by name.

Parameters
[in]decoderThe decoder.
[in]element_nameThe name of the element.
[out]valueThe location where the value should be copied to.
Return values
ERR_NOT_FOUNDNo element with the requested name was found.

Definition at line 196 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References findIndex(), and a_util::result::isFailed().

◆ getValue() [3/3]

a_util::variant::Variant ddl::access_element::getValue ( const T &  decoder,
size_t  element_index 
)

Get the value of an element by index.

Parameters
[in]decoderThe decoder.
[in]element_indexThe index of the element.
Return values
Thevalue of the element.

Definition at line 268 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References a_util::result::isOk().

◆ getValueAddress() [1/2]

const void* ddl::access_element::getValueAddress ( const T &  decoder,
const std::string &  element_name 
)

Get a pointer to an element by name.

Parameters
[in]decoderThe decoder.
[in]element_nameThe name of the element.
Returns
Address of the element.

Definition at line 285 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References adtf_ddl::access_element::find_index(), and a_util::result::isOk().

◆ getValueAddress() [2/2]

void* ddl::access_element::getValueAddress ( T &  codec,
const std::string &  element_name 
)

Get a pointer to an element by name.

Parameters
[in]codecThe codec.
[in]element_nameThe name of the element.
Returns
Address of the element.

Definition at line 302 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References findIndex(), and a_util::result::isOk().

◆ getValueAsString() [1/2]

std::string ddl::access_element::getValueAsString ( const T &  decoder,
const std::string &  element_name 
)

Get the value of an element as a string, using enum value names if available.

Parameters
[in]decoderThe decoder.
[in]element_nameThe name of the element.
Returns
A string representation of the value.

Definition at line 562 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References findIndex(), getValueAsString(), and a_util::result::isOk().

◆ getValueAsString() [2/2]

std::string ddl::access_element::getValueAsString ( const T &  decoder,
size_t  element_index 
)

Get the value of an element as a string, using enum value names if available.

Parameters
[in]decoderThe decoder.
[in]element_indexThe index of the element.
Returns
A string representation of the value.

Definition at line 526 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References Variant::asString(), DDL_GET_ENUM_CASE, Variant::getType(), a_util::result::isOk(), and StructElement::p_enum.

Referenced by getValueAsString().

◆ reset()

a_util::result::Result ddl::access_element::reset ( T &  codec,
const std::string &  element_name 
)

Set the value of the requested element to zero.

Parameters
[in]codecThe codec.
[in]element_nameThe name of the element.
Return values
ERR_NOT_FOUNDNo element with the requested name was found.

Definition at line 494 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References findIndex(), a_util::result::isFailed(), and a_util::memory::zero().

◆ setStructValue()

a_util::result::Result ddl::access_element::setStructValue ( CODEC &  codec,
const std::string &  struct_name,
const T *  struct_value 
)

Copy a sub-structure into the structure.

Parameters
[in]codecThe codec.
[in]struct_nameThe name of the structure.
[in]struct_valueThe location the sub-structure will be copied from.
Return values
ERR_NOT_FOUNDNo structure with the requested name was found.

Definition at line 375 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References a_util::memory::copy().

◆ setValue() [1/2]

a_util::result::Result ddl::access_element::setValue ( T &  codec,
const std::string &  element_name,
const a_util::variant::Variant value 
)

Set the value of an element by name.

Parameters
[in]codecThe codec.
[in]element_nameThe name of the element.
[in]valueThe new value.
Return values
ERR_NOT_FOUNDNo element with the requested name was found.

Definition at line 249 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References findIndex(), and a_util::result::isFailed().

◆ setValue() [2/2]

a_util::result::Result ddl::access_element::setValue ( T &  codec,
const std::string &  element_name,
const void *  value 
)

Set the value of an element by name.

Parameters
[in]codecThe codec.
[in]element_nameThe name of the element.
[in]valueThe location where the value should be copied from.
Return values
ERR_NOT_FOUNDNo element with the requested name was found.

Definition at line 214 of file conan_home_relwithdebinfo/.conan/data/dev_essential/1.2.1/fep/stable/package/5bba22a1f4e8057d230d54fdd86f43a9aa5ca5fe/include/ddl/codec/legacy/access_element.h.

References findIndex(), and a_util::result::isFailed().