Accessing class for a instance of a struct. This will calculate the byte positions can be used for serialialization and deserialization.
More...
#include <dd_struct_access.h>
|
|
class | DataDefinition |
| |
|
class | StructElementAccess |
| |
|
class | ElementTypeInfo |
| |
Accessing class for a instance of a struct. This will calculate the byte positions can be used for serialialization and deserialization.
◆ StructTypeAccess()
| ddl::dd::StructTypeAccess::StructTypeAccess |
( |
const std::shared_ptr< const datamodel::StructType > & | struct_type | ) |
|
Construct a new Struct Type Access object.
- Parameters
-
| struct_type | the struct type it refers to. |
◆ begin()
◆ cbegin()
◆ cend()
◆ end()
◆ getElementByPath()
| StructElementAccess ddl::dd::StructTypeAccess::getElementByPath |
( |
std::string_view | name_path | ) |
const |
Get the StructElementAccess information class by path. Separator is "." or "/"
Following element access paths are possible:
- "element_1" -> access to a element with the name "element_1"
- "element_1.sub_2" -> access to a element with the name "element_1" which is a structtype that has a element with the name "sub_2"
- "element_1/sub_2" -> same as before
- "element_2[3]" -> access to a element with the name "element_2" which is a array element with an possible array pos [3]
- "element_2[3].sub_2[24]" -> access to a element with the name "element_2" which is a array element with an possible array pos [3], this array pos contains a structtype with an element named sub_2 that is an array with an valid position [24]
- "element_2[3]/sub_2[24]" -> same as before
Following element access paths are NOT possible:
- "element_1.sub_2/subsub_3" -> invalid. No mixture of separator possible!
- "element_2[24]" -> invalid, if the element_2 is no array or arraysize is below 24!
- Parameters
-
| name_path | The path to the element. |
- Returns
- StructElementAccess
◆ getStaticSerializedBitSize()
| size_t ddl::dd::StructTypeAccess::getStaticSerializedBitSize |
( |
| ) |
const |
Get the known bitsize of this instance (this is usually the last position + sizeof last element)
- Returns
- size_t serialized bitsize of the instance (without dynamic content)
◆ getStaticStructSize()
| size_t ddl::dd::StructTypeAccess::getStaticStructSize |
( |
| ) |
const |
Get the known Static Struct Size of this instance.
- Returns
- size_t size of the instance (without dynamic content)
◆ getStaticUnalignedStructSize()
| size_t ddl::dd::StructTypeAccess::getStaticUnalignedStructSize |
( |
| ) |
const |
Get the known unaligned Static Struct Size of this instance (this is usually the last position + sizeof last element)
- Returns
- size_t size of the instance (without dynamic content)
◆ getStructType()
◆ isDynamic()
| bool ddl::dd::StructTypeAccess::isDynamic |
( |
| ) |
const |
retrieves information if it contains dynamic elements and so has dynamic size.
- Return values
-
| true | has dynamic elements |
| false | has no dynamic elements |
◆ operator bool()
| ddl::dd::StructTypeAccess::operator bool |
( |
| ) |
const |
The Struct access is a valid access type.
- Returns
- true the access is valid.
-
false the access is not valid.
◆ operator=()
The documentation for this class was generated from the following file:
- /workspace/conan/dev_essential/1.6.3/dw/stable/package/65324bff46e457721a7ba250afe9d61dc2b0e57a/include/ddl/dd/dd_struct_access.h