|
Dev Essential
|
The DDL (Data Definition Language) was introduced with the software ADTF (Automotive Data- and Time-Triggered Framework).
The intension was to have a common dynamic description for byte positions and value types for any structured data and memory blocks. Since the software was designed for C++ applications the DDL is similar to it and uses there data types by default.
DDL description for data of following struct:
Description in DDL 4.1 as is (in XML):
| deserialized representation(12 bytes in memory) | |||||||||||
| byte 0 | byte 1 | byte 2 | byte 3 | byte 4 | byte 5 | byte 6 | byte 7 | byte 8 | byte 9 | byte 10 | byte 11 |
| uint8_t value_1 | (padding) | uint16_t value_2 | uint8_t value_3 | (padding) | uint32_t value_4 | ||||||
| serialized representation (8 bytes in network or file) | |||||||
| byte 0 | byte 1 | byte 2 | byte 3 | byte 4 | byte 5 | byte 6 | byte 7 |
| uint8_t value_1 | uint16_t value_2 | uint8_t value_3 | uint32_t value_4 | ||||
To facilitate the handling of DDL hierarchies there is a datamodel provided (ddl::dd::datamodel::DataDefinition). This datamodel is validated by a ddl::dd::DataDefinition which keeps the datamodel clean and well-formed.
The datamodel itself and its specification is described within DDL - XML Datamodel specification.
Use the datamodel to handle the model by yourself. We recommend to use following DataDefinition creation API.
There are 3 ways to create a valid DataDefinition.
| DDL Tag/Attribute | DDL Class |
|---|---|
<ddl:ddl> | ddl::dd::DataDefinition |
<header> | ddl::dd::Header |
<baseunit> | ddl::dd::BaseUnit |
<prefix> | ddl::dd::UnitPrefix |
<unit> | ddl::dd::Unit |
<datatype> | ddl::dd::DataType |
<enum> | ddl::dd::EnumType |
<struct> | ddl::dd::StructType |
<streammetatype> | ddl::dd::StreamMetaType |
<stream> | ddl::dd::Stream |