|
ADTF
|
definition of the dd namespace More...
Namespaces | |
| namespace | datamodel |
| definition of the datamodel namespace | |
| namespace | utility |
| definition of the old compatibility utility namespace | |
Classes | |
| class | AlignmentConversion |
| Alignment Conversion utility. More... | |
| class | AlignmentValidation |
| Alignment ConvValidation utility. More... | |
| class | ArraySize |
| class | ByteOrderConversion |
| ByteOrder Conversion utility. More... | |
| class | ByteOrderDefault |
| Default ByteOrder Discovery utility class. More... | |
| class | DataDefinition |
| The Data Definiton class uses the validation model to keep a Data Definition datamodel (ddl::dd::datamodel::DataDefinition) valid or inform about inconsitence: See: More... | |
| struct | DDFromXMLFactory |
| Factory to create a DataDefinition out of a XML based description. This factory uses a template type DOM_NODE_TYPE which is design to follow the a concept class type definition of the a_util::DOMElement. More... | |
| struct | DDToXMLFactory |
| Template class to create DD DOM nodes with the help of the type DOM_NODE_TYPE. More... | |
| struct | DDXmlLiterals |
| Singleton for strings used frequently with DD XML serialization. More... | |
| class | Error |
| Exception helper class to collect information while parsing, adding DD Objects or other failed operatons. More... | |
| struct | Problem |
| Problem to report to find the corresponding item name in a simple way. More... | |
| class | StructArrayElementAccessIterator |
| class | StructElementAccess |
| Class to access and obtain the byte position and other information of a instance of this element within a struct (see StructTypeAccess). More... | |
| class | StructElementAccessIterator |
| Iterator to iterate thru the StructTypeAccess. More... | |
| class | StructTypeAccess |
| Accessing class for a instance of a struct. This will calculate the byte positions can be used for serialialization and deserialization. More... | |
| class | Version |
| DDL Version. More... | |
| class | VersionConversion |
| Version conversion utility class. More... | |
Typedefs | |
| using | Header = datamodel::Header |
| using | BaseUnit = datamodel::BaseUnit |
| using | UnitPrefix = datamodel::UnitPrefix |
| using | Unit = datamodel::Unit |
| using | DataType = datamodel::DataType |
| using | EnumType = datamodel::EnumType |
| using | StructType = datamodel::StructType |
| using | StreamMetaType = datamodel::StreamMetaType |
| using | Stream = datamodel::Stream |
| using | DataDescription = dd::DataDefinition |
| Alias Name for DataDefinition, formally known as DataDescription. | |
| using | OptionalSize = utility::Optional<size_t> |
| Optional Size Type. | |
| using | CallbackStructElementAccess |
| Callback function type definitions for struct element access traversal. | |
| using | CallbackStructElementAccessControl |
| Callback function type definitions for struct element access traversal. The return value indicates if the traversal should continue into the child or further array elements. | |
Enumerations | |
| enum | TypeOfType : uint8_t { invalid_type , data_type , enum_type , struct_type , stream_meta_type } |
| Classification of a Type. More... | |
| enum | TypeOfUnit : uint8_t { invalid_unit , unit , base_unit } |
| Classification of unit. More... | |
| enum | Alignment : size_t { e0 = 1 , e1 = 1 , e2 = 2 , e4 = 4 , e8 = 8 , e16 = 16 , e32 = 32 , e64 = 64 , e_invalid = 255 } |
| Alignment defintion. More... | |
| enum | ByteOrder { platform_not_supported = 0x00 , plattform_little_endian_8 = 0x01 , platform_big_endian_8 = 0x02 , e_noe = platform_not_supported , e_le = plattform_little_endian_8 , e_be = platform_big_endian_8 } |
| enum | InfoType : uint8_t { validation_info , validation_service_info , type_info , element_type_info , named_container_info = element_type_info , last_info , last_info_last_index = 200 , additional_compatible_members = 201 } |
| The Info model type defines the kind of infomodel and interface. More... | |
| enum class | ValidationLevel : uint8_t { dont_know , invalid , good_enough , valid } |
| Validation level. More... | |
Functions | |
| bool | addTypeByName (const std::string &type_name, const DataDefinition &source_dd, DataDefinition &destination_dd) |
Helper function which merges or adds the type with the name of type_name. If there are dependencies, they will be retrieved from source_dd. following types are considered: | |
| bool | addStreamTypeByName (const std::string &stream_type_name, const DataDefinition &source_dd, DataDefinition &destination_dd) |
Merges or add the streamtype with the name of stream_type_name. If there are dependencies, they will be retrieved from source_dd. following types are considered: | |
| bool | addUnitByName (const std::string &unit_name, const DataDefinition &source_dd, DataDefinition &destination_dd) |
Merges or add the unit with the name of unit_name. If there are dependencies, they will be retrieved from source_dd. following types are considered: | |
| std::vector< std::string > | transformValidationProblemList (const std::vector< ddl::dd::Problem > &problems) |
| transforms the validation protocol of problems to a simple vrctor of strings. Simple usage: | |
| void | forEachElementInfix (const StructTypeAccess &parent, const CallbackStructElementAccess &access_leaf_callback, const CallbackStructElementAccessControl &enter_element_member_callback=[](auto &, auto &) { return true;}, const CallbackStructElementAccess &leave_element_member_callback=[](auto &, auto &) {}, const CallbackStructElementAccessControl &enter_array_element_member_callback=[](auto &, auto &) { return true;}, const CallbackStructElementAccess &leave_array_element_member_callback=[](auto &, auto &) {}, bool filter_padding_elements=true) |
| Traverse all elements of a struct type access in infix order and calls the callbacks. | |
| void | forEachElementInPathInfix (const StructTypeAccess &parent, std::string_view path, const CallbackStructElementAccess &target_element_callback, const CallbackStructElementAccess &enter_element_member_callback=[](auto &, auto &) {}, const CallbackStructElementAccess &leave_element_member_callback=[](auto &, auto &) {}, const CallbackStructElementAccess &enter_array_element_member_callback=[](auto &, auto &) {}, const CallbackStructElementAccess &leave_array_element_member_callback=[](auto &, auto &) {}) |
| Traverse all elements along a given path in struct type access in infix order and calls the callbacks. | |
| ddl::codec::LeafLayout | getLeafLayout (const ddl::dd::StructElementAccess &element_access, ddl::DataRepresentation rep) |
| std::vector< std::string > | transformProblemList (const std::vector< Problem > &problems) |
| transforms the Problem List to a simple vector of strings. Simple usage: | |
definition of the dd namespace
| using ddl::dd::BaseUnit = datamodel::BaseUnit |
Reuse of datamodel base unit class - ddl::dd::datamodel::BaseUnit.
Callback function type definitions for struct element access traversal.
Callback function type definitions for struct element access traversal. The return value indicates if the traversal should continue into the child or further array elements.
| using ddl::dd::DataType = datamodel::DataType |
Reuse of datamodel datatype class - ddl::dd::datamodel::DataType.
| using ddl::dd::EnumType = datamodel::EnumType |
Reuse of datamodel enumtype class - ddl::dd::datamodel::EnumType.
| using ddl::dd::Header = datamodel::Header |
Reuse of datamodel header class - ddl::dd::datamodel::Header.
| using ddl::dd::Stream = datamodel::Stream |
Reuse of datamodel stream class - ddl::dd::datamodel::Stream.
Reuse of datamodel streammetatype class - ddl::dd::datamodel::StreamMetaType.
Reuse of datamodel structtype class - ddl::dd::datamodel::StructType.
| using ddl::dd::Unit = datamodel::Unit |
Reuse of datamodel unit class - ddl::dd::datamodel::Unit.
Reuse of datamodel unit prefix class - ddl::dd::datamodel::UnitPrefix.
| enum ddl::dd::Alignment : size_t |
Alignment defintion.
| Enumerator | |
|---|---|
| e0 | for backward compatibility |
| e1 | Default alignment |
| enum ddl::dd::ByteOrder |
Representation of the byteorder enumeration
| enum ddl::dd::InfoType : uint8_t |
The Info model type defines the kind of infomodel and interface.
| enum ddl::dd::TypeOfType : uint8_t |
Classification of a Type.
| Enumerator | |
|---|---|
| invalid_type | the type is unknown |
| data_type | the type is a data type (DataType) |
| enum_type | the type is a enum type (EnumType) |
| struct_type | the type is a struct type (StructType) |
| stream_meta_type | the type is an stream meta type (StreamMetaType) |
| enum ddl::dd::TypeOfUnit : uint8_t |
|
strong |
Validation level.
| Enumerator | |
|---|---|
| dont_know | The validation is not known. This means it is not calculated yet. Use i.e. ddl::dd::DataDefinition::validate. |
| invalid | the validation level is invalid, dependencies can not be obtained or the dependency "to" is invalid (struct to struct i.e.). |
| good_enough | Structs and elements can be "good_enough" for the TypeInfo. This means the Coder and Decoder can calculate the sizes and the all access Functions can obtain values. Usually this should be the valid state. The problem is, that there are DataDefinition out there (in the users world) using i.e. units, but does not define the unit within that DD. At this point we do not want to break that code! So good enough means: Not well defined in some cases, but good enough for calculate byte positions and TypeInfo. Only structs, enums and datatypes may have a validationlevel of "good_enough" if there are any other DD Objects used in a DataDefinition and they are "invalid", the DD will also set to "invalid"! |
| valid | every thing is well defined. |
| bool ddl::dd::addStreamTypeByName | ( | const std::string & | stream_type_name, |
| const DataDefinition & | source_dd, | ||
| DataDefinition & | destination_dd ) |
Merges or add the streamtype with the name of stream_type_name. If there are dependencies, they will be retrieved from source_dd.
following types are considered:
| stream_type_name | the typename of the type to add. |
| source_dd | dependencies will be obtained from this DataDefinition reference (streammetatype, structtype, etc.) |
| destination_dd | where to add or merge |
| ddl::dd::Error | throws if the type already exists and is not equal to the given one. Will also check dependencies. |
| true | a type was found and added |
| false | a type was NOT found and so NOT added |
| bool ddl::dd::addTypeByName | ( | const std::string & | type_name, |
| const DataDefinition & | source_dd, | ||
| DataDefinition & | destination_dd ) |
Helper function which merges or adds the type with the name of type_name. If there are dependencies, they will be retrieved from source_dd.
following types are considered:
| type_name | the typename of the type to add. |
| source_dd | dependencies will be obtained from this DataDefinition reference (other streammetatype) |
| destination_dd | where to add or merge |
| ddl::dd::Error | throws if the type already exists and is not equal to the given one. Will also check dependencies. |
| true | a type was found and added |
| false | a type was NOT found and so NOT added |
| bool ddl::dd::addUnitByName | ( | const std::string & | unit_name, |
| const DataDefinition & | source_dd, | ||
| DataDefinition & | destination_dd ) |
Merges or add the unit with the name of unit_name. If there are dependencies, they will be retrieved from source_dd.
following types are considered:
| unit_name | the unitname of the unit to add. |
| source_dd | dependencies will be obtained from this DataDefinition reference (baseunit, unitprefix) |
| destination_dd | where to add or merge |
| ddl::dd::Error | throws if the unit already exists and is not equal to the given one. Will also check dependencies. |
| true | a unit was found and added |
| false | a unit was NOT found and so NOT added |
| void ddl::dd::forEachElementInfix | ( | const StructTypeAccess & | parent, |
| const CallbackStructElementAccess & | access_leaf_callback, | ||
| const CallbackStructElementAccessControl & | enter_element_member_callback = [](auto &, auto &) { return true;}, | ||
| const CallbackStructElementAccess & | leave_element_member_callback = [](auto &, auto &) {}, | ||
| const CallbackStructElementAccessControl & | enter_array_element_member_callback = [](auto &, auto &) { return true;}, | ||
| const CallbackStructElementAccess & | leave_array_element_member_callback = [](auto &, auto &) {}, | ||
| bool | filter_padding_elements = true ) |
Traverse all elements of a struct type access in infix order and calls the callbacks.
| parent | The struct type access to traverse. |
| access_leaf_callback | The callback function to call for each leaf elements found. |
| enter_element_member_callback | The callback function to call when entering a struct member, indepentent of it being a leaf or not. You must return true for further entering the members children or array elements. Otherwise it will skip all children and array elements of this element. |
| leave_element_member_callback | The callback function to call when leaving a struct member, indepentent of it being a leaf or not. It will be only called, if the enter_element_member_callback has returned true for the same child element. |
| enter_array_element_member_callback | The callback function to call when entering the array members of an elements member that is an array indepentent of it being a leaf or not. You must return true for further entering the array member and its children. |
| leave_array_element_member_callback | The callback function to call when leaving an array element. It will only be called, if the enter_array_element_member_callback has returned true for the same child element. |
| filter_padding_elements | If true, padding elements are filtered out. |
Callbacks may terminate traversal with an exception. No further callbacks are called after any exception is thrown.
| void ddl::dd::forEachElementInPathInfix | ( | const StructTypeAccess & | parent, |
| std::string_view | path, | ||
| const CallbackStructElementAccess & | target_element_callback, | ||
| const CallbackStructElementAccess & | enter_element_member_callback = [](auto &, auto &) {}, | ||
| const CallbackStructElementAccess & | leave_element_member_callback = [](auto &, auto &) {}, | ||
| const CallbackStructElementAccess & | enter_array_element_member_callback = [](auto &, auto &) {}, | ||
| const CallbackStructElementAccess & | leave_array_element_member_callback = [](auto &, auto &) {} ) |
Traverse all elements along a given path in struct type access in infix order and calls the callbacks.
| parent | The struct type access to traverse. |
| path | The child name of the target element in point notation (i.e. "child_element[4].element_value"). |
| target_element_callback | The callback function to call once when the target element is reached. The target element is not required to be a leaf. Called only before leave_element_member_callback and leave_array_element_member_callback. Never called if the target element is unreachable. |
| enter_element_member_callback | The callback function to call when entering a struct member. Called only before target_element_callback. |
| leave_element_member_callback | The callback function to call when leaving a struct member. |
| enter_array_element_member_callback | The callback function to call when entering the selected array member of an elements member that is an array. Called only before target_element_callback. |
| leave_array_element_member_callback | The callback function to call when leaving an array element. |
Exceptions may be thrown if the path is semantically invalid (e.g. invalid characters). Callbacks may terminate traversal with an exception. No further callbacks are called after any exception is thrown.
| ddl::codec::LeafLayout ddl::dd::getLeafLayout | ( | const ddl::dd::StructElementAccess & | element_access, |
| ddl::DataRepresentation | rep ) |
Retrieve the ddl::codec::LeafLayout for the given ddl::dd::StructElementAccess and ddl::DataRepresentation. This will only work for leaf elements and POD types. Dynamic elements or elements after dynamic arrays are not supported.
| element_access | the valid StructElementAccess to retrieve the LeafLayout for |
| rep | the data representation to retrieve the LeafLayout for |
| std::runtime_error | if the element access is not valid, not a leaf POD type, after a dynamic part or a dynamic element. |
| std::vector< std::string > ddl::dd::transformProblemList | ( | const std::vector< Problem > & | problems | ) |
transforms the Problem List to a simple vector of strings.
Simple usage:
| problems | the problems to tranform. |
| std::vector< std::string > ddl::dd::transformValidationProblemList | ( | const std::vector< ddl::dd::Problem > & | problems | ) |
transforms the validation protocol of problems to a simple vrctor of strings.
Simple usage:
| problems | the problems to tranform. |