initial commit for github
This commit is contained in:
commit
60968612de
370 changed files with 68427 additions and 0 deletions
114
doc/input/codec.md
Normal file
114
doc/input/codec.md
Normal file
|
@ -0,0 +1,114 @@
|
|||
# DDL Decoder/Codec {#page_codec}
|
||||
|
||||
# Accessing Data with a Decoder/Codec
|
||||
|
||||
Let's take a look at a basic structure:
|
||||
|
||||
````xml
|
||||
<struct alignment="4" name="tTest" version="1" ddlversion="2.0">
|
||||
<element name="bBool" type="tBool" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="0" bitpos="0" numbits="8"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="nInt8" type="tInt8" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="1" bitpos="0" numbits="8"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="nUInt32" type="tUInt32" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="2" bitpos="0" numbits="32"/>
|
||||
<deserialized alignment="4"/>
|
||||
</element>
|
||||
<element name="fFloat32" type="tFloat32" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="6" bitpos="0" numbits="32"/>
|
||||
<deserialized alignment="4"/>
|
||||
</element>
|
||||
</struct>
|
||||
````
|
||||
|
||||
# Decoding
|
||||
|
||||
Read access is handled with the ddl::Decoder class:
|
||||
|
||||
````cpp
|
||||
tFloat64 readData(const void* const_data, size_t data_size)
|
||||
{
|
||||
// this should of course be cached (as a member etc.)
|
||||
ddl::CodecFactory factory("tTest", "<adtf:ddl>....");
|
||||
|
||||
auto decoder = factory.makeDecoderFor(const_data, data_size);
|
||||
|
||||
adtf_util::cVariant value;
|
||||
|
||||
// for name based lookup use the access_element namespace
|
||||
{
|
||||
value = ddl::access_element::get_value(decoder, "fFloat32");
|
||||
}
|
||||
|
||||
// alternativley you can of course use indexed based lookup
|
||||
{
|
||||
decoder.getElementValue(3, value);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
````
|
||||
|
||||
|
||||
# Encoding
|
||||
|
||||
Write access is handled with the ddl::Codec class:
|
||||
|
||||
````cpp
|
||||
void writeData(void* data, size_t data_size, tFloat64 value)
|
||||
{
|
||||
// this should of course be cached (as a member etc.)
|
||||
ddl::CodecFactory factory("tTest", "<adtf:ddl>....");
|
||||
|
||||
auto codec = factory.makeCodecFor(data, data_size);
|
||||
|
||||
// name based lookup
|
||||
ddl::access_element::set_value(codec, "fFloat32", value);
|
||||
// or index based
|
||||
codec.setElementValue(3, value);
|
||||
}
|
||||
````
|
||||
|
||||
# Selecting the Data Representation
|
||||
|
||||
By default decoders/codecs are created for the deserialized representation.
|
||||
To create them for the serialized representation pass the correct parameters to the make... methods.
|
||||
|
||||
````cpp
|
||||
auto decoder = factory.makeDecoderFor(const_data, data_size,
|
||||
DataRepresentation::serialized);
|
||||
````
|
||||
|
||||
# Inspection
|
||||
|
||||
You can inspect the struct handled by a decoder/codec with the help of ddl::StaticDecoder::getElement:
|
||||
|
||||
````cpp
|
||||
void dumstruct_elements(const ddl::StaticDecoder& decoder)
|
||||
{
|
||||
for (size_t element = 0; element < decoder.getElementCount(); ++element)
|
||||
{
|
||||
const ddl::StructElement* struct_element;
|
||||
decoder.GetElement(element, struct_element);
|
||||
std::cout << struct_element->strName << std::endl;
|
||||
}
|
||||
}
|
||||
````
|
||||
|
||||
# Transformation
|
||||
|
||||
Converting between the representations can be done with ddl::serialization::transform:
|
||||
|
||||
````cpp
|
||||
tSize serialized_size = decoder.getBufferSize(ddl::DataRepresentation::serialized);
|
||||
uint8_t* buffer = new uint8_t[serialized_size];
|
||||
auto Codec = decoder.makeCodecFor(buffer, serialized_size, ddl::DataRepresentation::serialized);
|
||||
ddl::serialization::transform(decoder, codec);
|
||||
````
|
||||
|
||||
There is also a convienence method ddl::serialization::transform_to_buffer that handles the allocation of memory for you with the help of an adtf_util::cMemoryBlock.
|
||||
|
200
doc/input/ddl3.xsd
Normal file
200
doc/input/ddl3.xsd
Normal file
|
@ -0,0 +1,200 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema attributeFormDefault="unqualified"
|
||||
elementFormDefault="unqualified"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="adtf"
|
||||
xmlns:adtf="adtf">
|
||||
|
||||
<xs:element name="ddl" type="adtf:ddl"></xs:element>
|
||||
|
||||
<xs:complexType name="ddl">
|
||||
<xs:sequence>
|
||||
<xs:element name="header" type="adtf:header" />
|
||||
<xs:element name="units" type="adtf:units" />
|
||||
<xs:element name="datatypes" type="adtf:datatypes" />
|
||||
<xs:element name="enums" type="adtf:enums" />
|
||||
<xs:element name="structs" type="adtf:structs" />
|
||||
<xs:element name="streams" type="adtf:streams" />
|
||||
<xs:any namespace="##other" processContents="skip"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<!-- currently not used, we need to improve the pattern if we want-->
|
||||
<xs:simpleType name="date">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="\d{2}(\.|-)\d{2}(\.|-)\d{4}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="string">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([a-zA-Z0-9\.\-_\+ ])+"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="string_or_empty">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([a-zA-Z0-9\.\-_\+])*"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="language_version">
|
||||
<xs:restriction base="xs:decimal">
|
||||
<xs:fractionDigits value="2"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:complexType name="header">
|
||||
<xs:sequence>
|
||||
<xs:element name="language_version" type="adtf:language_version" />
|
||||
<xs:element name="author" type="adtf:string" />
|
||||
<xs:element name="date_creation" type="xs:string" />
|
||||
<xs:element name="date_change" type="xs:string" />
|
||||
<xs:element name="description" type="xs:string" />
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="ext_declaration" type="adtf:ext_declaration"/>
|
||||
<xs:any namespace="##other" processContents="skip"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="ext_declaration">
|
||||
<xs:attribute name="key" type="adtf:string" use="required" />
|
||||
<xs:attribute name="value" type="xs:string" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="units">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="baseunit" type="adtf:baseunit"/>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="prefixes" type="adtf:prefixes"/>
|
||||
<xs:any namespace="##other" processContents="skip"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="baseunit">
|
||||
<xs:attribute name="description" type="xs:string" use="required" />
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="symbol" type="adtf:string_or_empty" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="prefixes">
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="power" type="xs:integer" use="required" />
|
||||
<xs:attribute name="symbol" type="adtf:string_or_empty" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="datatypes">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="datatype" type="adtf:datatype"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="datatype">
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="size" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="description" type="xs:string" />
|
||||
<xs:attribute name="arraysize" type="xs:unsignedInt" />
|
||||
<xs:attribute name="unit" type="adtf:string" />
|
||||
<xs:attribute name="max" type="adtf:string" />
|
||||
<xs:attribute name="min" type="adtf:string" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="enums">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="enum" type="adtf:enum"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="enum">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="element" type="adtf:enum_element"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="type" type="adtf:string" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="enum_element">
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="value" type="xs:string" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="structs">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="struct" type="adtf:struct"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:simpleType name="alignment">
|
||||
<xs:restriction base="xs:unsignedInt">
|
||||
<xs:enumeration value="0"/>
|
||||
<xs:enumeration value="1"/>
|
||||
<xs:enumeration value="2"/>
|
||||
<xs:enumeration value="4"/>
|
||||
<xs:enumeration value="8"/>
|
||||
<xs:enumeration value="16"/>
|
||||
<xs:enumeration value="32"/>
|
||||
<xs:enumeration value="64"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:complexType name="struct">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="element" type="adtf:element"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="version" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="comment" type="xs:string" />
|
||||
<xs:attribute name="alignment" type="adtf:alignment" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:simpleType name="byteorder">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="LE"/>
|
||||
<xs:enumeration value="BE"/>
|
||||
<xs:enumeration value="Motorola"/>
|
||||
<xs:enumeration value="Intel"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:complexType name="element">
|
||||
<xs:attribute name="type" type="adtf:string" use="required" />
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="bytepos" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="bitpos" type="xs:unsignedInt" />
|
||||
<xs:attribute name="numbits" type="xs:unsignedInt" />
|
||||
<xs:attribute name="description" type="adtf:string" />
|
||||
<xs:attribute name="unit" type="adtf:string" />
|
||||
<xs:attribute name="byteorder" type="adtf:byteorder" />
|
||||
<xs:attribute name="alignment" type="adtf:alignment" />
|
||||
<xs:attribute name="comment" type="xs:string" />
|
||||
<xs:attribute name="arraysize" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="value" type="xs:string" />
|
||||
<xs:attribute name="min" type="adtf:string" />
|
||||
<xs:attribute name="max" type="adtf:string" />
|
||||
<xs:attribute name="default" type="adtf:string" />
|
||||
<xs:attribute name="scale" type="adtf:string" />
|
||||
<xs:attribute name="offset" type="adtf:string" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="streams">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="stream" type="adtf:stream"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="stream">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="struct" type="adtf:stream_struct"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="type" type="adtf:string" use="required" />
|
||||
<xs:attribute name="description" type="adtf:string" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="stream_struct">
|
||||
<xs:attribute name="bytepos" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="name" type="adtf:string" />
|
||||
<xs:attribute name="type" type="adtf:string" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
234
doc/input/ddl4.xsd
Normal file
234
doc/input/ddl4.xsd
Normal file
|
@ -0,0 +1,234 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema attributeFormDefault="unqualified"
|
||||
elementFormDefault="unqualified"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="adtf"
|
||||
xmlns:adtf="adtf">
|
||||
|
||||
<xs:element name="ddl" type="adtf:ddl"></xs:element>
|
||||
|
||||
<xs:complexType name="ddl">
|
||||
<xs:sequence>
|
||||
<xs:element name="header" type="adtf:header" />
|
||||
<xs:element name="units" type="adtf:units" />
|
||||
<xs:element name="datatypes" type="adtf:datatypes" />
|
||||
<xs:element name="enums" type="adtf:enums" />
|
||||
<xs:element name="structs" type="adtf:structs" />
|
||||
<xs:element name="streams" type="adtf:streams" />
|
||||
<xs:element name="streammetatypes" type="adtf:streammetatypes" />
|
||||
<xs:any namespace="##other" processContents="skip"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<!-- currently not used, we need to improve the pattern if we want-->
|
||||
<xs:simpleType name="date">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="\d{2}(\.|-)\d{2}(\.|-)\d{4}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="string">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([a-zA-Z0-9\.\-_\+ ])+"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="string_or_empty">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([a-zA-Z0-9\.\-_\+])*"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="language_version">
|
||||
<xs:restriction base="xs:decimal">
|
||||
<xs:fractionDigits value="2"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:complexType name="header">
|
||||
<xs:sequence>
|
||||
<xs:element name="language_version" type="adtf:language_version" />
|
||||
<xs:element name="author" type="adtf:string" />
|
||||
<xs:element name="date_creation" type="xs:string" />
|
||||
<xs:element name="date_change" type="xs:string" />
|
||||
<xs:element name="description" type="xs:string" />
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="ext_declaration" type="adtf:ext_declaration"/>
|
||||
<xs:any namespace="##other" processContents="skip"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="ext_declaration">
|
||||
<xs:attribute name="key" type="adtf:string" use="required" />
|
||||
<xs:attribute name="value" type="xs:string" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="units">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="baseunit" type="adtf:baseunit"/>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="prefixes" type="adtf:prefixes"/>
|
||||
<xs:any namespace="##other" processContents="skip"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="baseunit">
|
||||
<xs:attribute name="description" type="xs:string" use="required" />
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="symbol" type="adtf:string_or_empty" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="prefixes">
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="power" type="xs:integer" use="required" />
|
||||
<xs:attribute name="symbol" type="adtf:string_or_empty" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="datatypes">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="datatype" type="adtf:datatype"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="datatype">
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="size" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="description" type="xs:string" />
|
||||
<xs:attribute name="arraysize" type="xs:unsignedInt" />
|
||||
<xs:attribute name="unit" type="adtf:string" />
|
||||
<xs:attribute name="max" type="adtf:string" />
|
||||
<xs:attribute name="min" type="adtf:string" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="enums">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="enum" type="adtf:enum"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="enum">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="element" type="adtf:enum_element"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="type" type="adtf:string" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="enum_element">
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="value" type="xs:string" use="required" />
|
||||
</xs:complexType>
|
||||
<xs:complexType name="structs">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="struct" type="adtf:struct"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:simpleType name="alignment">
|
||||
<xs:restriction base="xs:unsignedInt">
|
||||
<xs:enumeration value="0"/>
|
||||
<xs:enumeration value="1"/>
|
||||
<xs:enumeration value="2"/>
|
||||
<xs:enumeration value="4"/>
|
||||
<xs:enumeration value="8"/>
|
||||
<xs:enumeration value="16"/>
|
||||
<xs:enumeration value="32"/>
|
||||
<xs:enumeration value="64"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:complexType name="struct">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="element" type="adtf:structelement"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="version" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="comment" type="xs:string" />
|
||||
<xs:attribute name="alignment" type="adtf:alignment" />
|
||||
<xs:attribute name="ddlversion" type="xs:string" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:simpleType name="byteorder">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="LE"/>
|
||||
<xs:enumeration value="BE"/>
|
||||
<xs:enumeration value="Motorola"/>
|
||||
<xs:enumeration value="Intel"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:complexType name="structelement">
|
||||
<xs:sequence>
|
||||
<xs:element name="serialized" type="adtf:serialized"/>
|
||||
<xs:element name="deserialized" type="adtf:deserialized"/>
|
||||
<xs:any namespace="##other" processContents="skip"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="type" type="adtf:string" use="required" />
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="arraysize" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="description" type="adtf:string" />
|
||||
<xs:attribute name="unit" type="adtf:string" />
|
||||
<xs:attribute name="comment" type="xs:string" />
|
||||
<xs:attribute name="value" type="xs:string" />
|
||||
<xs:attribute name="min" type="adtf:string" />
|
||||
<xs:attribute name="max" type="adtf:string" />
|
||||
<xs:attribute name="default" type="adtf:string" />
|
||||
<xs:attribute name="scale" type="adtf:string" />
|
||||
<xs:attribute name="offset" type="adtf:string" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="serialized">
|
||||
<xs:attribute name="byteorder" type="adtf:byteorder" use="required" />
|
||||
<xs:attribute name="bytepos" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="bitpos" type="xs:unsignedInt" />
|
||||
<xs:attribute name="numbits" type="xs:unsignedInt" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="deserialized">
|
||||
<xs:attribute name="alignment" type="adtf:alignment" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="streams">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="stream" type="adtf:stream"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="stream">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="struct" type="adtf:stream_struct"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="type" type="adtf:string" use="required" />
|
||||
<xs:attribute name="description" type="adtf:string" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="stream_struct">
|
||||
<xs:attribute name="bytepos" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="name" type="adtf:string" />
|
||||
<xs:attribute name="type" type="adtf:string" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="streammetatypes">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="streammetatype" type="adtf:streammetatype"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="streammetatype">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="property" type="adtf:property"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="version" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="parent" type="xs:string" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="property">
|
||||
<xs:attribute name="name" type="adtf:string" use="required" />
|
||||
<xs:attribute name="type" type="xs:unsignedInt" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
</xs:schema>
|
77
doc/input/ddl_generators.md
Normal file
77
doc/input/ddl_generators.md
Normal file
|
@ -0,0 +1,77 @@
|
|||
# DDL Generators (ddl2header, header2ddl) {#page_ddl_generators}
|
||||
|
||||
ddl2header and header2ddl are command line utilites to automatically generate
|
||||
C/C++ header files from DDL desriptions and vice versa.
|
||||
|
||||
# Usage
|
||||
|
||||
## ddl2header
|
||||
|
||||
````
|
||||
ddl2header [options]
|
||||
|
||||
+++++++++++++++++++++++++++++
|
||||
+++ Command line option: +++
|
||||
+++++++++++++++++++++++++++++
|
||||
|
||||
To create a header file from an existing description file. You have to set the
|
||||
following options:
|
||||
|
||||
-headerfile=<PATH> - [Mandatory] The path to the header
|
||||
file (target).
|
||||
|
||||
-descriptionfile=<PATH> - [Mandatory] The path to the description
|
||||
file (source).
|
||||
|
||||
-struct=<StructNameInHeader> - [Optional] Just create the header
|
||||
file for the given struct
|
||||
of the description file.
|
||||
|
||||
++++++++++++++++
|
||||
+++ Example +++
|
||||
++++++++++++++++
|
||||
-headerfile=c:/myHeaderFile.h -descriptionfile=c:/myDescriptionFile.description
|
||||
or-headerfile=c:/myHeaderFile.h -descriptionfile=c:/myDescriptionFile.description -struct=
|
||||
tMyStruct
|
||||
````
|
||||
|
||||
## header2ddl
|
||||
|
||||
````
|
||||
header2ddl [options]
|
||||
|
||||
+++++++++++++++++++++++++++++
|
||||
+++ Command line option: +++
|
||||
+++++++++++++++++++++++++++++
|
||||
|
||||
To create a header file from an existing description file. You have to set the
|
||||
following options:
|
||||
|
||||
-headerfile=<PATH> - [Mandatory] The path to the header
|
||||
file (source).
|
||||
|
||||
-descriptionfile=<PATH> - [Mandatory] The path to the description
|
||||
file (target).
|
||||
|
||||
-struct=<StructNameInHeader> - [Optional] Just create the description
|
||||
file for the given struct
|
||||
of the header file.
|
||||
|
||||
-ddlversion=<VersionOfDDLFile> - [Optional] Default value is ddl4.
|
||||
Supported formats are
|
||||
3.0 and 4.0
|
||||
|
||||
++++++++++++++++
|
||||
+++ Example +++
|
||||
++++++++++++++++
|
||||
-headerfile=c:/myHeaderFile.h -descriptionfile=c:/myDescriptionFile.description
|
||||
or-headerfile=c:/myHeaderFile.h -descriptionfile=c:/myDescriptionFile.description -struct=
|
||||
tMyStruct
|
||||
````
|
||||
|
||||
## Notes
|
||||
|
||||
- Target files are never just overwritten (independent of conversion direction).
|
||||
If the target file exists the generators will try to merge the contents of source and target.
|
||||
**Warning:** If the target file contains content that can not be parsed by the ddl library
|
||||
it might be missing from the result file. **Keep a backup!**
|
758
doc/input/ddl_specification.md
Normal file
758
doc/input/ddl_specification.md
Normal file
|
@ -0,0 +1,758 @@
|
|||
# DDL Definition File Format {#page_ddl_specification}
|
||||
|
||||
With ADTF a default DDL Definition File 'adtf.description' is provided. The
|
||||
format of this file is XML and it contains all common datatypes and structs
|
||||
which are used within ADTF.
|
||||
|
||||
Which DDL Definition File is used in ADTF can be specified either in global
|
||||
settings or in configuration settings. *It is possible to specify more than
|
||||
one DDL Definition File within the property 'media_descripton_files' by
|
||||
separating them with a semicolon (;)*. If more than one DDL Definition
|
||||
File is provided, the contained information will be merged.
|
||||
|
||||
The DDL were released with several versions. This table will show the
|
||||
the supported DDL versions of different ADTF releases.
|
||||
|
||||
**Warning:**
|
||||
Keep in mind, that the DDL language version 1.0 is not supported
|
||||
within ADTF.
|
||||
|
||||
*The currently valid version is DDL 3.0.*
|
||||
|
||||
|ADTF Version|DDL Version supported|
|
||||
|--- |--- |
|
||||
|2.4.x|1.0+|
|
||||
|2.5.x|1.0+|
|
||||
|2.6.x|1.0+|
|
||||
|2.7.x|1.0+ and 1.02|
|
||||
|2.8.x|1.0+, 1.02, and 2.0|
|
||||
|2.9.x|1.0+, 1.02, and 2.0|
|
||||
|2.10.x and newer|1.0+, 1.02, 2.0, and 3.0|
|
||||
|3.0.x and newer|1.0+, 1.02, 2.0, 3.0 and 4.0|
|
||||
|
||||
Changes to definitions between the language versions are explicitly explained in the tables below.
|
||||
|
||||
|
||||
|
||||
# Specification
|
||||
|
||||
The newer versions of the DDL Definition File Format are also specified by a XSD specification file.
|
||||
See the XSD specification for further details:
|
||||
- [DDL 3 XSD specification](../ddl3.xsd)
|
||||
- [DDL 4 XSD specification](../ddl4.xsd)
|
||||
|
||||
# Description of General Datatypes in this specification
|
||||
|
||||
There are several types that are used in attributes and as tag data in the
|
||||
DDL. The following table lists the types with a description of the values
|
||||
and/or their formatting.
|
||||
|
||||
|Type|Allowed values|
|
||||
|--- |--- |
|
||||
|Char|Single character of [a-z][A-Z][0-9] _.-+/|
|
||||
|String|Characters of [a-z][A-Z][0-9] _.-+/|
|
||||
|Text|All visible ASCII characters|
|
||||
|UInt|Unsigned integer values|
|
||||
|Int|signed integer values|
|
||||
|Float|signed float values|
|
||||
|Date|Allowed formats: yyyymmdd, dd-mm-yyyy, yyyy-mm-dd or dd.mm.yyyy|
|
||||
|Class|any name value of another DDL element|
|
||||
|Enum|A predefined value from the description of the attribute|
|
||||
|
||||
|
||||
ADTF provides several predefined baseunits, prefixes, datatypes and enums.
|
||||
|
||||
|
||||
|
||||
# header
|
||||
The header section contains meta information about the document and version
|
||||
information. Example:
|
||||
````xml
|
||||
<header>
|
||||
<language_version>2.0</language_version>
|
||||
<author>AUDI Electronics Venture GmbH</author>
|
||||
<date_creation>20100407</date_creation>
|
||||
<date_change />
|
||||
<description>ADTF Common Description File</description>
|
||||
</header>
|
||||
````
|
||||
|
||||
|
||||
|
||||
|Tag|Type|Description|
|
||||
|--- |--- |--- |
|
||||
|language_version|Float|Version number of the file|
|
||||
|author|String|Author|
|
||||
|date_creation|Date|Creation date|
|
||||
|date_change|Date|Last modification date|
|
||||
|description|Text|Short description|
|
||||
|
||||
|
||||
All previously mentioned header tags are *mandatory*.
|
||||
|
||||
Additional information can be added by using the `ext_declaration` tag.
|
||||
Example:
|
||||
|
||||
````xml
|
||||
<header>
|
||||
...
|
||||
<ext_declaration key="AnyKey" value="Any value for this key"/>
|
||||
</header>
|
||||
````
|
||||
|
||||
|
||||
|
||||
|Attribute|Type|Description|
|
||||
|--- |--- |--- |
|
||||
|key|String|Name of the additional information|
|
||||
|Value|Text|Value of the additional information|
|
||||
|
||||
|
||||
|
||||
# units
|
||||
|
||||
The definition of units will be divided in SI-base units and own units. The
|
||||
SI-based units are the following ones:
|
||||
|
||||
|SI (see ISO 1000)|no SI, but needed for daily usage|
|
||||
|--- |--- |
|
||||
|Metre|Degree|
|
||||
|Gram|Radiant|
|
||||
|Second|Unitless|
|
||||
|Ampere| |
|
||||
|Candela| |
|
||||
|Kelvin| |
|
||||
|Mole| |
|
||||
|
||||
Units are defined within the tags `<units>` and `</units>`.
|
||||
Example:
|
||||
````xml
|
||||
<units>
|
||||
<baseunit description="Fundamental unit for electric current" name="Ampere" symbol="A" />
|
||||
<baseunit description="Fundamental unit for luminous intensity" name="Candela" symbol="cd" />
|
||||
<baseunit description="Non-SI standard unit for angle" name="Degree" symbol="deg" />
|
||||
<baseunit description="Fundamental unit for thermodynamic temperature" name="Kelvin" symbol="K" />
|
||||
<baseunit description="Fundamental unit for mass" name="Kilogram" symbol="kg" />
|
||||
<baseunit description="Fundamental unit for length" name="Metre" symbol="m" />
|
||||
<baseunit description="Fundamental unit for amount of substance" name="Mole" symbol="mol" />
|
||||
<baseunit description="Non-SI standard unit for angle" name="Radiant" symbol="rad" />
|
||||
<baseunit description="Fundamental unit for time" name="Second" symbol="s" />
|
||||
<baseunit description="No SI, but needed for own unit definitions" name="Unitless" symbol="" />
|
||||
|
||||
<prefixes name="atto" power="-18" symbol="a" />
|
||||
<prefixes name="centi" power="-2" symbol="c" />
|
||||
<prefixes name="deca" power="1" symbol="da" />
|
||||
<prefixes name="deci" power="-1" symbol="d" />
|
||||
<prefixes name="exa" power="18" symbol="E" />
|
||||
<prefixes name="femto" power="-15" symbol="f" />
|
||||
<prefixes name="giga" power="9" symbol="G" />
|
||||
<prefixes name="hecto" power="2" symbol="h" />
|
||||
<prefixes name="kilo" power="3" symbol="k" />
|
||||
<prefixes name="mega" power="6" symbol="M" />
|
||||
<prefixes name="micro" power="-6" symbol="u" />
|
||||
<prefixes name="milli" power="-3" symbol="m" />
|
||||
<prefixes name="nano" power="-9" symbol="n" />
|
||||
<prefixes name="peta" power="15" symbol="P" />
|
||||
<prefixes name="pico" power="-12" symbol="p" />
|
||||
<prefixes name="tera" power="12" symbol="T" />
|
||||
<prefixes name="yocto" power="-24" symbol="y" />
|
||||
<prefixes name="yotta" power="24" symbol="Y" />
|
||||
<prefixes name="zepto" power="-21" symbol="z" />
|
||||
<prefixes name="zetta" power="21" symbol="Z" />
|
||||
</units>
|
||||
````
|
||||
|
||||
|
||||
## baseunits
|
||||
A concrete base unit definition will be specified by the tag
|
||||
`<baseunit>` and `</baseunit>`
|
||||
|
||||
The baseunit needs the following mandatory attributes:
|
||||
|
||||
|Name|Value|Description|
|
||||
|--- |--- |--- |
|
||||
|name|STRING|Name of the base unit e.g. metre|
|
||||
|symbol|STRING|Symbol of the base unit e.g. m|
|
||||
|description|TEXT|Description of the represented base unit|
|
||||
|
||||
|
||||
## prefixes
|
||||
Prefixes between 10 power(-24) and 10 power(24) are predefined.
|
||||
A prefix can be defined by the `<prefixes>` tag.
|
||||
|
||||
Every `<prefixes>` tag needs the following mandatory attributes:
|
||||
|
||||
|Name|Value|Description|changes between 1.02 and 1.0+|
|
||||
|--- |--- |--- |--- |
|
||||
|name|STRING|Name of the prefix| |
|
||||
|symbol|STRING|Represents a short symbol e.g. k|changed to STRING from CHAR in DDL1.02|
|
||||
|power|INT|Defines the power of the prefix| |
|
||||
|
||||
|
||||
## units
|
||||
A self defined unit is specified within the `<unit>` and `</unit>`
|
||||
tag and needs the following mandatory attributes:
|
||||
|
||||
|Name|Value|Description|
|
||||
|--- |--- |--- |
|
||||
|name|STRING|Name of the new unit|
|
||||
|
||||
|
||||
The `<unit>` tags needs the following mandatory sub-tags:
|
||||
|
||||
|Name|Value|Description|
|
||||
|--- |--- |--- |
|
||||
|numerator|STRING containing pi/PI or afloating-point value|Numerator of the new unit related to the baseunits|
|
||||
|denominator|STRING containing pi/PI or afloating-point value. The value '0' is not defined.|Denominator of the new unit related to the baseunits|
|
||||
|offset|FLOAT|Offset to the baseunits|
|
||||
|
||||
|
||||
The new unit is able to use several base units. To represent this, it is
|
||||
possible to specify the related base units by the `<refUnit>` tag. This
|
||||
tag uses the following mandatory attributes:
|
||||
|
||||
|Name|Value|Description|changes between 1.02 and 1.0+|
|
||||
|--- |--- |--- |--- |
|
||||
|name|CLASS|The referenced unit|changed to CLASS from STRING in DDL1.02|
|
||||
|power|INT|Power of the new unit related to the base one| |
|
||||
|prefix|CLASS|Reference to the prefix to use|changed to CLASS from STRING in DDL1.02|
|
||||
|
||||
|
||||
## Calculation of new unit
|
||||
|
||||
The newly defined unit relates to the SI base units like this:
|
||||
|
||||
newUnit = offset + (numerator / denominator) * Product (prefix(n) * baseUnit(n) ^ power(n))
|
||||
|
||||
|
||||
|
||||
# datatypes
|
||||
This section describes the primitive data types which can be used within the
|
||||
struct elements. Example:
|
||||
|
||||
````xml
|
||||
<datatypes>
|
||||
<datatype description="predefined ADTF tBool datatype" size="8" name="tBool" />
|
||||
<datatype description="predefined ADTF tChar datatype" size="8" name="tChar" />
|
||||
<datatype description="predefined ADTF tUInt8 datatype" size="8" name="tUInt8" />
|
||||
<datatype description="predefined ADTF tInt8 datatype" size="8" name="tInt8" />
|
||||
...
|
||||
</datatypes>
|
||||
````
|
||||
|
||||
|
||||
|
||||
|Name|Type|Required|Description|changes between 2.0 and 3.0|changes between 1.0+ and 1.0|
|
||||
|--- |--- |--- |--- |--- |--- |
|
||||
|name|String|mandatory|Name of the primitive data type|attribute name changed to "name" from "type"|
|
||||
|size|UInt|mandatory|Number of bits (relevant for serialization)| | |
|
||||
|description|String|optional|Description of the primitive data type| | |
|
||||
|arraysize|UInt|optional|= 1 -> primitive presentation> 1 -> array with number of elements. This feature is not supported within DDL.| | |
|
||||
|unit|Class|optional|Unit of the data type| | |
|
||||
|min|String|optional|Minimum value of the data type|introduced in DDL 3.0| |
|
||||
|max|String|optional|Maximum value of the data type|introduced in DDL 3.0| |
|
||||
|
||||
|
||||
The following predefined data types are provided with @c adtf.description:
|
||||
|
||||
|Type|Description|Number of bits|
|
||||
|--- |--- |--- |
|
||||
|tBool|Boolean|8 (C++ data type)|
|
||||
|tBit|Bit|1|
|
||||
|tChar|Character|8|
|
||||
|tInt8|Signed integer|8|
|
||||
|tUInt8|Unsigned integer|8|
|
||||
|tInt16|Signed integer|16|
|
||||
|tUInt16|Unsigned integer|16|
|
||||
|tInt32|Signed integer|32|
|
||||
|tUInt32|Unsigned integer|32|
|
||||
|tInt64|Signed integer|64|
|
||||
|tUInt64|Unsigned integer|64|
|
||||
|tFloat32|IEEE Float|32|
|
||||
|tFloat64|IEEE Float|64|
|
||||
|
||||
|
||||
# enums
|
||||
This section describes the enum type which can be used within the struct
|
||||
elements. Example:
|
||||
|
||||
````xml
|
||||
<enums>
|
||||
<enum name="tValueDefinitions" type="tUInt32">
|
||||
<element name="ELEMENT_ONE" value="10"/>
|
||||
<element name="ELEMENT_TWO" value="20"/>
|
||||
<element name="ELEMENT_THREE" value="5"/>
|
||||
</enum>
|
||||
...
|
||||
</enums>
|
||||
<struct alignment="1" name="tEnumData" version="1">
|
||||
<element alignment="1" arraysize="1" byteorder="LE" bytepos="0" name="enumData" type="tValueDefinitions" />
|
||||
</struct>
|
||||
````
|
||||
|
||||
|
||||
|
||||
Enum Attributes
|
||||
|
||||
|Name|Type|Required|Description|
|
||||
|--- |--- |--- |--- |
|
||||
|name|String|mandatory|Name of the enum|
|
||||
|type|String|mandatory|Data type of the enum|
|
||||
|
||||
|
||||
Enum Element Attributes
|
||||
|
||||
|Name|Type|Required|Description|
|
||||
|--- |--- |--- |--- |
|
||||
|name|String|mandatory|Name of the element|
|
||||
|value|Type specific|mandatory|Value of the element|
|
||||
|
||||
|
||||
**Remarks:**
|
||||
- An enum is also valid without enum elements.
|
||||
|
||||
|
||||
|
||||
# constants
|
||||
This section describes constants which are implemented using the enum type. Example:
|
||||
|
||||
````xml
|
||||
<enums>
|
||||
<enum name="tConstants" type="tUInt32">
|
||||
<element name="CONSTANT_ONE" value="42"/>
|
||||
<element name="CONSTANT_TWO" value="10"/>
|
||||
</enum>
|
||||
...
|
||||
</enums>
|
||||
<struct alignment="1" name="tEnumData" version="1">
|
||||
<element alignment="1" arraysize="1" byteorder="LE" bytepos="0" name="enumData" type="tConstants" value="CONSTANT_ONE" />
|
||||
</struct>
|
||||
````
|
||||
|
||||
|
||||
|
||||
# structs
|
||||
|
||||
The definition of structs allows to build complex data types. Example:
|
||||
|
||||
````xml
|
||||
<struct alignment="4" name="tTest" version="1" ddlversion="4.0">
|
||||
<element name="bBool" type="tBool" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="0" bitpos="0" numbits="8"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="nInt8" type="tInt8" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="1" bitpos="0" numbits="8"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="nUInt32" type="tUInt32" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="2" bitpos="0" numbits="32"/>
|
||||
<deserialized alignment="4"/>
|
||||
</element>
|
||||
<element name="fFloat32" type="tFloat32" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="6" bitpos="0" numbits="32"/>
|
||||
<deserialized alignment="4"/>
|
||||
</element>
|
||||
</struct>
|
||||
````
|
||||
|
||||
The tag `<struct>` uses the following attributes:
|
||||
|
||||
|Name|Type|Required|Description|changes between 2.0 and 3.0|changes between 1.0+ and 1.0|
|
||||
|--- |--- |--- |--- |--- |--- |
|
||||
|name|String|mandatory|Description of the data type| | |
|
||||
|version|UInt|mandatory|Version number of the specified data type| | |
|
||||
|comment|Text|optional|Additional comments| | |
|
||||
|alignment|Enum of 0/1/2/4/8/16/32/64 (defaut 1)|optional|Alignment value to get the whole packing of the complex data type which is important to get the calculated size of the structure (relevant for serialization)|From version 3.0 on, the alignment influences the size of the struct. The size will always be a multiple of the alignment.|introduced in DDL 1.0+|
|
||||
|ddlversion|String|optional|The version of the size calculation scheme, see alignment. If not specified the version from the containing definition will be used.| | |
|
||||
|
||||
|
||||
**Remarks:**
|
||||
- If the alignment is set to "0", the alignment will be set to the sum of the sizes of all types the struct contains!
|
||||
|
||||
The tag `<element>` uses the following attributes:
|
||||
|
||||
|Name|Type|Required|Description|changes between 3.0 and 4.0|changes between 2.0 and 3.0|changes between 1.02 and 2.0|changes between 1.02 and 1.0+|changes between 1.0+ and 1.0|
|
||||
|--- |--- |--- |--- |--- |--- |--- |--- |--- |
|
||||
|type|Class|mandatory|Reference to an existing data type| | | | | |
|
||||
|name|String|mandatory|Name of the created element| | | | | |
|
||||
|bytepos|UInt|deprecated|Byte position of the data in the serialized representation of the containing struct. This is NOT relevant for the struct layout in memory (deserialized)!Started with '0'Elements following a dynamic arraymust have a byte pos of '-1'|From version 4.0 on this information is specified within the `<serialized>` tag.| | | | |
|
||||
|bitpos|UInt|deprecated|Bit position of the data in the serialized representation of the containing struct. This is NOT relevant for the struct layout in memory (deserialized)!default = 0(in the range of 0 to 7) (relevant for serialization)|From version 4.0 on this information is specified within the `<serialized>` tag.| | | |default value changes from 1 to 0 in DDL1.0+|
|
||||
|numbits|UInt|deprecated|Specifies the amount of bits used in the serialized representation, if not set the size of the type will be used. e.g. tInt8 with numbits of 7 (numbits can only be used to non-arrays)This is NOT relevant for the struct layout in memory (deserialized)!|From version 4.0 on this information is specified within the `<serialized>` tag.| | | | |
|
||||
|byteorder|Enum of LE/BE/Motorola/Intel|deprecated|Defines the byte order in the serialized representation.|From version 4.0 on this information is specified within the `<serialized>` tag.| | | | |
|
||||
|alignment|Enum of 0/1/2/4/8/16/32/64|deprecated|Defines the alignment of the element in the deserialized representation.|From version 4.0 on this information is specified within the `<deserialized>` tag.|From version 3.0 on, the alignment influences the size of the element. The size will always be a the lowest common multiple of the alignment and the size of the type of the element.| | | |
|
||||
|description|String|optional|Description of the created data type| | | | | |
|
||||
|unit|Class|optional|Unit of the element|Changed to optional| | | | |
|
||||
|comment|Text|optional|Additional comments| | | | | |
|
||||
|arraysize|tUInt or String|mandatory|Defines the array size of the element. The default is arraysize="1". Starting with DDL 2.0 the name of a preceding struct element can be used to specify a dynamic array.arraysize="elementName" For a detailed explanation of dynamic arrays refer to *dynamic arrays*| | |Dynamic array support| | |
|
||||
|value|Enum element|optional|Constant value for element| | |introduced in DDL 2.0| | |
|
||||
|min|String|optional|Minimum value of the element| |introduced in DDL 3.0| | | |
|
||||
|max|String|optional|Maximum value of the element| |introduced in DDL 3.0| | | |
|
||||
|default|String|optional|Default value of the element| |introduced in DDL 3.0| | | |
|
||||
|scale|String|optional|Scaling value of the element| |introduced in DDL 3.0| | | |
|
||||
|offset|String|optional|Offset value of the element| |introduced in DDL 3.0| | | |
|
||||
|
||||
|
||||
The tag `<serialized>` uses the following attributes:
|
||||
|
||||
|Name|Type|Required|Description|changes between 2.0 and 3.0|changes between 1.02 and 2.0|changes between 1.02 and 1.0+|changes between 1.0+ and 1.0|
|
||||
|--- |--- |--- |--- |--- |--- |--- |--- |
|
||||
|bytepos|UInt|mandatory|Byte position of the data in the serialized representation of the containing struct. This is NOT relevant for the struct layout in memory (deserialized)!Started with '0'Elements following a dynamic arraymust have a byte pos of '-1'| | | | |
|
||||
|bitpos|UInt|optional|Bit position of the data in the serialized representation of the containing struct. This is NOT relevant for the struct layout in memory (deserialized)!default = 0(in the range of 0 to 7) (relevant for serialization)| | | |default value changes from 1 to 0 in DDL1.0+|
|
||||
|numbits|UInt|optional|Specifies the amount of bits used in the serialized representation, if not set the size of the type will be used. e.g. tInt8 with numbits of 7 (numbits can only be used to non-arrays)This is NOT relevant for the struct layout in memory (deserialized)!| | | | |
|
||||
|byteorder|Enum of LE/BE/Motorola/Intel|mandatory|Defines the byte order in the serialized representation.| | | | |
|
||||
|
||||
|
||||
The tag `<deserialized>` uses the following attributes:
|
||||
|
||||
|Name|Type|Required|Description|changes between 2.0 and 3.0|
|
||||
|--- |--- |--- |--- |--- |
|
||||
|alignment|Enum of 0/1/2/4/8/16/32/64|deprecated|Defines the alignment of the element in the deserialized representation.|From version 3.0 on, the alignment influences the size of the element. The size will always be a the lowest common multiple of the alignment and the size of the type of the element.|
|
||||
|
||||
**Remarks:**
|
||||
- The number of structs defined in a DDL description file is not limited.
|
||||
- If the name of another struct is used as type for an element, a hierarchical structure is created.
|
||||
- The maximum depth of such hierarchical structures is limited by the value of the define `ADTF_DDL_MAX_DESC_HIERARCHY`.
|
||||
- If the alignment is set to "0", the alignment will be set to the size of the elements type!
|
||||
|
||||
## Alignment of structs and in structs
|
||||
|
||||
This section will explain the different meanings of alignment used in the DDL. Since alignment
|
||||
is only needed for deserialized representation, this section will only consider this kind of
|
||||
representation.
|
||||
|
||||
Inside a struct, every element has a explicit alignment value. This value influences, at what
|
||||
position the element will be placed inside the struct. The memory placement is initially
|
||||
determined by the order of the element tags inside the struct. After that the alignment takes
|
||||
effect. An element inside a struct will only be placed at memory positions that are multiples
|
||||
of the alignment value. The considered memory address is always relative to the beginning of the
|
||||
struct (memory position 0).
|
||||
As an example we assume having the following struct definition:
|
||||
|
||||
````xml
|
||||
<struct alignment="4" name="tStruct" version="1">
|
||||
<element name="ui8Array" type="tUInt8" arraysize="5">
|
||||
<serialized byteorder="LE" bytepos="0"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="ui32Value" type="tUInt32" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="5"/>
|
||||
<deserialized alignment="4"/>
|
||||
</element>
|
||||
</struct>
|
||||
````
|
||||
|
||||
In this case, ui8Array will be placed at address 0. Because of the order of the element tags,
|
||||
ui32Value has to be placed after ui8Array. The next memory position after ui8Array is 5. But
|
||||
since the element ui32Value has an alignment of 4 and therfore the memory address has to be a
|
||||
multiple of 4, ui32Value will be placed at address 8 since this is the first address to matches
|
||||
all requirements. The attibute bytepos is only valid for serialized representation.
|
||||
|
||||
The alignment of a struct does not affect the alignment of its elements. A struct's alignment only
|
||||
determines the positioning of this struct inside of arrays.
|
||||
Assuming we have the following struct:
|
||||
|
||||
````xml
|
||||
<struct alignment="4" name="tInnerStruct" version="1">
|
||||
<element name="ui8Value1" type="tUInt8" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="0"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="ui8Value2" type="tUInt8" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="1"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
</struct>
|
||||
````
|
||||
|
||||
Lets now assume we have another struct `tOuterStruct`, that contains an array element and the
|
||||
element's type is the struct `tInnerStruct`:
|
||||
|
||||
````xml
|
||||
<struct alignment="1" name="tOuterStruct" version="1">
|
||||
<element name="aValue" type="tInnerStruct" arraysize="5">
|
||||
<serialized byteorder="LE" bytepos="0"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
</struct>
|
||||
````
|
||||
|
||||
Inside the array, the array element's positions are influenced by the alignment of the type
|
||||
(`tInnerStruct`). This means that the first array element is at position 0, in relation to the
|
||||
beginning of the array. The next free memory address would be 2, but since the alignment of the
|
||||
struct is 4, the memory address has to be a multiple of 4 and the second element of the array now
|
||||
is situated at memory address 4. The third will be at 8, the fourth at 12 and so on.
|
||||
|
||||
## Why should I use anything else but an alignment of 1?
|
||||
|
||||
If for example you are planning to describe data with DDL that was originally defined as a struct
|
||||
in a header file, you should also define the alignment values inside your DDL file accordingly.
|
||||
If on the other hand you are shure, that the data you are using is always interpreted using DDL,
|
||||
there is no need to use an alignment other than 1.
|
||||
|
||||
## What consequences do the changes in DDL 3.0 have regarding alignment?
|
||||
|
||||
The changes in DDL 3.0 regarding alignment are meant to make it more easy to describe structs
|
||||
defined in C(++). Since C(++) does not use alignment but packing for its structs, the alignment
|
||||
in DDL now also influences the size of a struct defined in DDL (see new definition of alignment
|
||||
in DDL 3.0). This means that arrays and structs may now become bigger in DDL 3.0 as they were in
|
||||
DDL 2.x. For example the struct
|
||||
|
||||
````xml
|
||||
<struct alignment="2" name="tFirstStruct" version="1" ddlversion="2.0/3.0">
|
||||
<element name="ui8Value" type="tUInt8" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="0"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
</struct>
|
||||
````
|
||||
|
||||
has the deserialized size of 1 byte in DDL 2.x and a deserialized size of 2 byte in DDL 3.0.
|
||||
The struct
|
||||
|
||||
````xml
|
||||
<struct alignment="1" name="tSecondStruct" version="1" ddlversion="2.0/3.0">
|
||||
<element name="aValue" type="tFirstStruct" arraysize="3">
|
||||
<serialized byteorder="LE" bytepos="0"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
</struct>
|
||||
````
|
||||
|
||||
has a size of 5 bytes in DDL 2.x and a size of 6 Bytes in DDL 3.0.
|
||||
This is due to the fact, that in 2.x the array looks like this:
|
||||
|
||||
|Bytepos|Element|
|
||||
|--- |--- |
|
||||
|0|aValue[0]|
|
||||
|1|padding Element|
|
||||
|2|aValue[1]|
|
||||
|3|padding Element|
|
||||
|4|aValue[2]|
|
||||
|
||||
|
||||
resulting in a size of 5 bytes.
|
||||
The padding elements are inserted, so that the *following* Element is correctly aligned.
|
||||
In DDL 3.0 the `tFirstStruct` has already a padding alement attached to its end so that its
|
||||
size matches the requirements of the alignment attribute (multiple of 2). Therefore, the array
|
||||
in 3.0 will look like this:
|
||||
|
||||
|Bytepos|Element|
|
||||
|--- |--- |
|
||||
|0 to 1|aValue[0]|
|
||||
|2 to 3|aValue[1]|
|
||||
|4 to 5|aValue[2]|
|
||||
|
||||
resulting in a size of 6 bytes.
|
||||
|
||||
## Changing from DDL 2.x to 3.0
|
||||
|
||||
Assuming you have a couple of structs defined in DDL 2.x, if you now plan to change the language
|
||||
version from 2.x to 3.0, that you are creating new structs, that may not be compatible to its
|
||||
namesakes defined in DDL 2.x. Its better to use new names for the structs to differentiate
|
||||
between the different versions.
|
||||
|
||||
## dynamic arrays
|
||||
|
||||
Detailed explanation of the dynamic array functionality.
|
||||
|
||||
|
||||
Dynamic arrays were introduced in DDL 2.0.
|
||||
|
||||
**Attention:**
|
||||
|
||||
The use of dynamic arrays will cause a severe performance drop
|
||||
compared to static arrays.
|
||||
It is therefore recommended to use static arrays whenever possible.
|
||||
|
||||
To minimize the performance impact of dynamic arrays the user should adhere
|
||||
to the following guidelines:<br>
|
||||
- Always place dynamic data the end of a structure or structure hirarchy so
|
||||
all static data precede the dynamic data.
|
||||
- Use the struct element directly preceding the dynamic array for array size.
|
||||
- Use dynamic arrays of primitive data types instead of complex data types.
|
||||
- Prefer flat data over deeply structured data.
|
||||
- Do not use nested dynamic arrays!
|
||||
- Use alignment=1 for all elements.
|
||||
- Use default values bitpos.
|
||||
- Use a bytepos that matches the position in memory when alignment=1.
|
||||
|
||||
Dynamic Arrays cannot be used with the ADTF Signal Registry.
|
||||
|
||||
### Fastest way to use dynamic arrays:
|
||||
|
||||
````xml
|
||||
<struct alignment="1" name="tDynStruct" version="1">
|
||||
<element name="ui32SomeData" type="tUInt32" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="0"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="ui32DynArraySize" type="tUInt32" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="4"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="f64DynamicArray" type="tFloat64" arraysize="ui32DynArraySize">
|
||||
<serialized byteorder="LE" bytepos="8"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
</struct>
|
||||
````
|
||||
|
||||
### When the dynamic data is not the last element the bytepos of the following elements must be -1
|
||||
|
||||
````xml
|
||||
<struct alignment="1" name="tDynStruct" version="1">
|
||||
<element name="ui32DynArraySize" type="tUInt32" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="0"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="f64DynamicArray" type="tFloat64" arraysize="ui32DynArraySize">
|
||||
<serialized byteorder="LE" bytepos="4"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="ui32SomeData" type="tUInt32" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="-1"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
</struct>
|
||||
````
|
||||
|
||||
### Dynamic array of complex data:
|
||||
|
||||
````xml
|
||||
<struct alignment="1" name="tVector" version="1">
|
||||
<element name="f64X" type="tFloat64" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="0"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="f64Y" type="tFloat64" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="8"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="f64Z" type="tFloat64" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="16"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
</struct>
|
||||
<struct alignment="1" name="tDynStruct" version="1">
|
||||
<element name="ui32SomeData" type="tUInt32" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="0"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="ui32DynArraySize" type="tUInt32" arraysize="1">
|
||||
<serialized byteorder="LE" bytepos="4"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
<element name="tVecDynamicArray" type="tVector" arraysize="ui32DynArraySize">
|
||||
<serialized byteorder="LE" bytepos="8"/>
|
||||
<deserialized alignment="1"/>
|
||||
</element>
|
||||
</struct>
|
||||
````
|
||||
|
||||
|
||||
# streammetatypes
|
||||
|
||||
Stream Meta Types are defined within the tags `<streammetatypes>` and `</streammetatypes>`.
|
||||
Example:
|
||||
|
||||
````xml
|
||||
<streammetatypes>
|
||||
<streammetatype name="adtf/default" version="1">
|
||||
<property name="md_struct" type="string"/>
|
||||
<property name="md_definitions" type="string"/>
|
||||
<property name="md_data_serialized" type="bool"/>
|
||||
</streammetatype>
|
||||
<streammetatype name="test" version="1" parent="adtf/default">
|
||||
<property name="test_prop" type="tInt32"/>
|
||||
</streammetatype>
|
||||
</streammetatypes>
|
||||
````
|
||||
|
||||
The tag `<streammetatype>` uses the following attributes:
|
||||
|
||||
|Name|Type|Required|Description|
|
||||
|--- |--- |--- |--- |
|
||||
|name|String|mandatory|The identifier of the stream meta type|
|
||||
|version|UInt|mandatory|Version number of the specified stream meta type|
|
||||
|parent|Text|optional|Identifier of a parent stream meta type|
|
||||
|
||||
The tag `<property>` uses the following attributes:
|
||||
|
||||
|Name|Type|Required|Description|
|
||||
|--- |--- |--- |--- |
|
||||
|name|String|mandatory|The name of the property|
|
||||
|type|UInt|mandatory|The type of the property|
|
||||
|
||||
|
||||
# predefined elements
|
||||
|
||||
The following base units are provided as default:
|
||||
|
||||
|Base Unit Name|Description|Symbol|
|
||||
|--- |--- |--- |
|
||||
|Metre|Fundamental unit for length|m|
|
||||
|Kilogram|Fundamental unit for mass|kg|
|
||||
|Second|Fundamental unit for time|s|
|
||||
|Ampere|Fundamental unit for electric current|A|
|
||||
|Kelvin|Fundamental unit for thermodynamic temperature|K|
|
||||
|Mole|Fundamental unit for amount of substance|mol|
|
||||
|Candela|Fundamental unit for luminous intensity|cd|
|
||||
|Degree|Non-SI standard unit for angle|deg|
|
||||
|Radiant|Non-SI standard unit for angle|rad|
|
||||
|Unitless|No SI, but needed for own unit definitions| |
|
||||
|nou|No SI, but needed for no unit definitions| |
|
||||
|
||||
The following prefixes are provided as default:
|
||||
|
||||
|Prefix Name|Power|Symbol|
|
||||
|--- |--- |--- |
|
||||
|yotta|24|Y|
|
||||
|zetta|21|Z|
|
||||
|exa|18|E|
|
||||
|peta|15|P|
|
||||
|tera|12|T|
|
||||
|giga|9|G|
|
||||
|mega|6|M|
|
||||
|kilo|3|k|
|
||||
|hecto|2|h|
|
||||
|deca|1|da|
|
||||
|deci|-1|d|
|
||||
|centi|-2|c|
|
||||
|milli|-3|m|
|
||||
|micro|-6|u|
|
||||
|nano|-9|n|
|
||||
|pico|-12|p|
|
||||
|femto|-15|f|
|
||||
|atto|-18|a|
|
||||
|zepto|-21|z|
|
||||
|yocto|-24|y|
|
||||
|
||||
The following data types are provided as default:
|
||||
|
||||
|Data Type Name|Description|Size|
|
||||
|--- |--- |--- |
|
||||
|tBool|predefined ADTF tBool datatype|8|
|
||||
|tChar|predefined ADTF tChar datatype|8|
|
||||
|tUInt8|Upredefined ADTF tUInt8 datatype|8|
|
||||
|tInt8|predefined ADTF tInt8 datatype|8|
|
||||
|tUInt16|predefined ADTF tUInt16 datatype|16|
|
||||
|tInt16|predefined ADTF tInt16 datatype|16|
|
||||
|tUInt32|predefined ADTF tUInt32 datatype|32|
|
||||
|tInt32|predefined ADTF tInt32 datatype|32|
|
||||
|tUInt64|predefined ADTF tUInt64 datatype|64|
|
||||
|tInt64|predefined ADTF tInt64 datatype|64|
|
||||
|tFloat32|predefined ADTF tFloat32 datatype|32|
|
||||
|tFloat64|predefined ADTF tFloat64 datatype|64|
|
||||
|
||||
|
||||
The following enums are provided as default:
|
||||
|
||||
|Enum Name|Type|
|
||||
|--- |--- |
|
||||
|tMediaTypeMajor|tUInt32|
|
||||
|tPixelFormat|tInt16|
|
||||
|
||||
|
||||
|
||||
|
122
doc/input/mapping_configuration.xsd
Normal file
122
doc/input/mapping_configuration.xsd
Normal file
|
@ -0,0 +1,122 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="mapping">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="header">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="language_version" type="NonEmptyString" />
|
||||
<xs:element name="author" type="xs:string" />
|
||||
<xs:element name="date_creation" type="xs:string" />
|
||||
<xs:element name="date_change" type="xs:string" />
|
||||
<xs:element name="description" type="xs:string" />
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="sources" minOccurs="0">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="source" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="name" type="NonEmptyString" use="required" />
|
||||
<xs:attribute name="type" type="NonEmptyString" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="targets" minOccurs="0">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="target" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="assignment" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="to" type="NonEmptyString" use="required" />
|
||||
<xs:attribute name="constant" type="xs:decimal" use="optional" />
|
||||
<xs:attribute name="function" type="function_type" use="optional" />
|
||||
<xs:attribute name="from" type="NonEmptyString" use="optional" />
|
||||
<xs:attribute name="transformation" type="xs:string" use="optional" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="trigger" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="type" type="trigger_type" use="required" />
|
||||
<xs:attribute name="period" type="xs:decimal" use="optional" />
|
||||
<xs:attribute name="unit" type="period_unit" use="optional" />
|
||||
<xs:attribute name="variable" type="xs:string" use="optional" />
|
||||
<xs:attribute name="operator" type="xs:string" use="optional" />
|
||||
<xs:attribute name="value" type="xs:string" use="optional" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="NonEmptyString" use="required" />
|
||||
<xs:attribute name="type" type="NonEmptyString" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="transformations" minOccurs="0">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="polynomial" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="name" type="xs:string" use="required" />
|
||||
<xs:attribute name="a" type="xs:decimal" use="optional" />
|
||||
<xs:attribute name="b" type="xs:decimal" use="optional" />
|
||||
<xs:attribute name="c" type="xs:decimal" use="optional" />
|
||||
<xs:attribute name="d" type="xs:decimal" use="optional" />
|
||||
<xs:attribute name="e" type="xs:decimal" use="optional" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="enum_table" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="conversion" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="from" type="xs:string" use="required" />
|
||||
<xs:attribute name="to" type="xs:string" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="xs:string" use="required" />
|
||||
<xs:attribute name="from" type="xs:string" use="required" />
|
||||
<xs:attribute name="to" type="xs:string" use="required" />
|
||||
<xs:attribute name="default" type="xs:string" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:simpleType name="function_type">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="simulation_time\(\)|trigger_counter\(\d+\)|received\(.*\)" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="trigger_type">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="periodic" />
|
||||
<xs:enumeration value="data" />
|
||||
<xs:enumeration value="signal" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="period_unit">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="us" />
|
||||
<xs:enumeration value="ms" />
|
||||
<xs:enumeration value="s" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="NonEmptyString">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:minLength value="1" />
|
||||
<xs:pattern value=".*[^\s].*" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:schema>
|
261
doc/input/mapping_specification.md
Normal file
261
doc/input/mapping_specification.md
Normal file
|
@ -0,0 +1,261 @@
|
|||
# Signal Mapping Format Specification {#page_signal_mapping_spec}
|
||||
|
||||
# Configuration format
|
||||
|
||||
The actual mapping of signals is configured using a xml-based configuration format.
|
||||
|
||||
## Overview
|
||||
A mapping configuration file contains a header with meta information about the file, source signal declarations, target signal definitions and transformation definitions. A source signal consists of a name and a signal type. Target signals also consist of a name and a signal type. They define any number of signal element assignments as well as any trigger conditions.
|
||||
|
||||
Conceptionally, signal element assignments define how the target signal is assembled while triggers define when the target signal buffer is submitted to the user.
|
||||
|
||||
A target signal element can be assigned a constant numeric value or a source signal element. In the later case, a transformation can be used to alter the source signal element value during assignment. For details see \ref subsec_features_types. Trigger conditions are optional, since it is always possible to actively get the current target signal buffer. For now, only periodic triggers can be defined, using a period and a unit of time.
|
||||
|
||||
## Specification
|
||||
|
||||
This specification contains the following parts:
|
||||
- Header
|
||||
- Sources
|
||||
- Targets
|
||||
- Transformations
|
||||
|
||||
These sections will be described in the following paragraphs, see the [XSD specification](../mapping_configuration.xsd) for more details.
|
||||
|
||||
|
||||
### Header
|
||||
|
||||
The header section contains meta information about the document and version information.
|
||||
It is similar to the header informations in the DDL Definition File Format.
|
||||
|
||||
|Tag|Type|Required|Description|
|
||||
|--- |--- |--- |--- |
|
||||
|language_version|Float|mandatory|Version number of the mapping format|
|
||||
|author|String|mandatory|Author|
|
||||
|date_creation|Date|mandatory|Creation date|
|
||||
|date_change|Date|mandatory|Last modification date|
|
||||
|description|Text|mandatory|Short description|
|
||||
|
||||
|
||||
### Sources
|
||||
|
||||
This section defines the source signals that can be used in assignments to any target signal elements(s).
|
||||
|
||||
The tag `<source>` supports the following attributes:
|
||||
|
||||
|Name|Type|Required|Description|
|
||||
|--- |--- |--- |--- |
|
||||
|name|String|mandatory|Name of the signal|
|
||||
|type|String|mandatory|DDL structured type of the signal|
|
||||
|
||||
|
||||
### Targets
|
||||
|
||||
This section contains definitions of target signals, assignement to their target elements as well as any trigger definitions.
|
||||
|
||||
The tag `<target>` supports the following attributes:
|
||||
|
||||
|Name|Type|Required|Description|
|
||||
|--- |--- |--- |--- |
|
||||
|name|String|mandatory|Name of the signal|
|
||||
|type|String|mandatory|DDL structured type of the signal|
|
||||
|
||||
The tag `<assignment>` supports the following attributes:
|
||||
|
||||
|Name|Type|Required|Description|
|
||||
|--- |--- |--- |--- |
|
||||
|to|String|mandatory|Name of the target signal element to be assign|
|
||||
|constant|String|optional*|Float value which will assigned during initialisation|
|
||||
|function|String|optional*|Macro to assign|
|
||||
|from|String|optional*|Source signal or source signal element to assign|
|
||||
|transformation|String|optional|Transformation to apply to the source element|
|
||||
|
||||
|
||||
__*__: The attributes _constant_, _function_ and _from_ are mutually exclusive but one of them is required.
|
||||
The attribute _transformation_ can only be applied when the attribute _from_ is defined.
|
||||
|
||||
The attribute _function_ can have the values:
|
||||
|
||||
|Function|Parameter|Description|
|
||||
|--- |--- |--- |
|
||||
|simulation_time()|None|Evaluates to the current simulation time|
|
||||
|trigger_counter()|None|Trigger counter, incremented whenever a trigger for the target fires|
|
||||
|trigger_counter()|Positive numeric value, modulo parameter|Trigger counter with wrap-around|
|
||||
|received()|Name of the source signal|Received indicator, evaluates to true if the source signal has been received|
|
||||
|
||||
|
||||
The tag `<trigger>` supports the following attributes:
|
||||
|
||||
|Name|Type|Required|Description|
|
||||
|--- |--- |--- |--- |
|
||||
|type|String|mandatory|Trigger type|
|
||||
|period|String|optional|Float value defining the length of the period|
|
||||
|unit|String|optional|unit to interpret the given _period_|
|
||||
|variable|String|optional|For _signal_ triggers: name of the source signal, for _data triggers: name of the source signal element|
|
||||
|operator|String|optional|Operator used for data triggers: less_than, greater_than, less_than_equal, greater_than_equal, equal or not_equal|
|
||||
|value|String|optional|Float value to compare with the source element|
|
||||
|
||||
|
||||
The attribute _type_ has three acceptable values:
|
||||
- _periodic_
|
||||
- _data_
|
||||
- _signal_
|
||||
|
||||
For the _periodic_ Trigger type, the attributes _period_ and _unit_ are mandatory.
|
||||
For the _data_ Trigger type, the attributes _variable_, _operator_ and _value_ are mandatory.
|
||||
For the _signal_ Trigger type, the attribute _variable_ is mandatory.
|
||||
|
||||
### Transformations
|
||||
|
||||
This section contains definitions of transformations that can be used in assignements.
|
||||
For the moment the only transformations available are polynomial tranformations and enum to enum transformations.
|
||||
|
||||
The tag `<polynomial>` supports the following attributes:
|
||||
|
||||
|Name|Type|Required|Description|
|
||||
|--- |--- |--- |--- |
|
||||
|name|String|mandatory|Name of the transformation|
|
||||
|a|String|optional|parameter of the polynom for X^0|
|
||||
|b|String|optional|parameter of the polynom for X^1|
|
||||
|c|String|optional|parameter of the polynom for X^2|
|
||||
|d|String|optional|parameter of the polynom for X^3|
|
||||
|e|String|optional|parameter of the polynom for X^4|
|
||||
|
||||
|
||||
The tag `<enum_table>` supports the following attributes:
|
||||
|
||||
|Name|Type|Required|Description|
|
||||
|--- |--- |--- |--- |
|
||||
|name|String|mandatory|Name of the transformation|
|
||||
|from|String|mandatory|Enumeration type used as transformation source|
|
||||
|to|String|mandatory|Enumeration type used as transformation target|
|
||||
|default|String|mandatory|Default value used when no conversion is defined. It must be an element of the target enumeration|
|
||||
|
||||
|
||||
The tag `<conversion>` supports the following attributes:
|
||||
|
||||
|Name|Type|Required|Description|
|
||||
|--- |--- |--- |--- |
|
||||
|from|String|mandatory|Element from the enumeration type used as transformation source|
|
||||
|to|String|mandatory|Element from the enumeration type used as transformation target|
|
||||
|
||||
|
||||
## Example
|
||||
The following example shows the mapping of the target signals `LightSource` and `Object`.
|
||||
`LightSource` elements are mapped from two source signals, `LightOrientation` and `LightPos`, as well as some constants.
|
||||
Two of its assignments are also transformed during mapping. The entire target is triggered by a periodic trigger with a period of 5s, and when LightPos is received and LightPos.f64X is lesser than 2.
|
||||
`Object` element is an enumeration, mapped with transformation from `SourceObject`.
|
||||
The Enumeration Type _tObjectType_ is mapped in an obsolete Enumeration created for the example.
|
||||
This Target is trigger when `LightOrientation` is received.
|
||||
|
||||
````xml
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<mapping>
|
||||
<header>
|
||||
<language_version>1.00</language_version>
|
||||
<author>AUDI Electronic Ventures GmbH</author>
|
||||
<date_creation>2016-Jun-08</date_creation>
|
||||
<date_change>2016-Jun-08</date_change>
|
||||
<description>Example mapping configuration</description>
|
||||
</header>
|
||||
<sources>
|
||||
<source name="LightOrientation" type="tFEP_VU_Coord" />
|
||||
<source name="LightPos" type="tFEP_VU_PointCartesian" />
|
||||
<source name="SourceObject" type="tObject" />
|
||||
</sources>
|
||||
<targets>
|
||||
<target name="LightSource" type="tFEP_VU_LightSource">
|
||||
<assignment to="f64SimTime" function="simulation_time()" />
|
||||
<assignment to="ui32Id" constant="1" />
|
||||
<assignment to="ui8State" function="trigger_counter(3)" />
|
||||
<assignment to="sPosIntertial.f64X" from="LightPos.f64X" transformation="cm_to_m" />
|
||||
<assignment to="sPosIntertial.f64Y" from="LightPos.f64Y" transformation="cm_to_m" />
|
||||
<assignment to="sPosIntertial.f64Z" constant="0" />
|
||||
<assignment to="sPosIntertial.f64H" from="LightOrientation.f64H" />
|
||||
<assignment to="sPosIntertial.f64P" from="LightOrientation.f64P" />
|
||||
<assignment to="sPosIntertial.f64R" from="LightOrientation.f64R" />
|
||||
<trigger type="periodic" period="5" unit="s"/>
|
||||
<trigger type="data" variable="LightPos.f64X" operator="greater_than" value="2"/>
|
||||
</target>
|
||||
<target name="Object" type="tObjectObsolete">
|
||||
<assignment to="objectType" from="SourceObject.objectType" transformation="table1" />
|
||||
<trigger type="signal" variable="LightOrientation"/>
|
||||
</target>
|
||||
</targets>
|
||||
<transformations>
|
||||
<polynomial name="cm_to_m" a="0" b="0.01" />
|
||||
<enum_table name="table1" from="tObjectType" to="tObjectTypeObsolete" default="OT_Undefined" >
|
||||
<conversion from="OT_Car" to="OT_Vehicle"/>
|
||||
<conversion from="OT_Truck" to="OT_Vehicle"/>
|
||||
<conversion from="OT_Van" to="OT_Vehicle"/>
|
||||
<conversion from="OT_Motorbike" to="OT_Vehicle"/>
|
||||
<conversion from="OT_Bicycle" to="OT_Vehicle"/>
|
||||
<conversion from="OT_Pedestrian" to="OT_Human"/>
|
||||
<conversion from="OT_Animal" to="OT_Animal"/>
|
||||
</enum_table>
|
||||
</transformations>
|
||||
</mapping>
|
||||
````
|
||||
|
||||
# Features
|
||||
|
||||
## Constants and Macros
|
||||
|
||||
A target signal element can be assigned a constant numeric value. This value will be parsed as a floating point number and casted to the target element type.
|
||||
|
||||
A target signal element can also be assigned the simulation time, a trigger counter or a received flag.
|
||||
|
||||
**Note:**
|
||||
|
||||
Constants and Macros can only be used to initialize scalar as well as arrays of scalar elements
|
||||
Any unassigned target elements will be assigned the default value configured in the DDL definition of the target signal type
|
||||
|
||||
## Transformations
|
||||
|
||||
Transformations can be used to alter the value of an assignment during runtime.
|
||||
Polynomial and enum to enum transformations are supported.
|
||||
|
||||
Polynomial transformations use the following polynomial to transform the assignments:
|
||||
|
||||
````
|
||||
value = a*value^0 + b*value^1 + c*value^2 + d*value^3 + e*value^4
|
||||
````
|
||||
|
||||
Any undefined coefficients are set to 0.
|
||||
|
||||
|
||||
**Note:**
|
||||
|
||||
Transformations are only supported for scalar as well as arrays of scalar elements
|
||||
|
||||
## Supported types and cross-type assignments
|
||||
|
||||
Assignments from one type to another are supported in the following way
|
||||
|
||||
Source | Target | Specification
|
||||
------------- | ------------- | -------------
|
||||
Constant | Scalar | Datatype conversion using standard C++ casting methods
|
||||
Simulation time | Scalar | Datatype conversion using standard C++ casting methods
|
||||
Trigger counter | Scalar | Datatype conversion using standard C++ casting methods
|
||||
Received Flag | Scalar | Only for boolean
|
||||
Scalar | Scalar | Datatype conversion using standard C++ casting methods. Transformations allowed
|
||||
Array<Scalar> | Array<Scalar> | Only for arrays of same size. Datatype conversion using standard C++ casting methods. Transformations allowed
|
||||
Structure | Structure | Only for structures of same type
|
||||
Array<Structure> | Array<Structure> | Only for arrays of same size and structures of same type
|
||||
Enum | Enum | Datatype conversion to the underlying numerical datatype using standard C++ casting methods
|
||||
Array<Enum> | Array<Enum> | Only for arrays of same size. Datatype conversion using standard C++ casting methods.
|
||||
|
||||
Scalar datatypes are enumerations, `tBool`, `tChar`, `tUInt8`, `tInt8`, `tUInt16`, `tInt16`, `tUInt32`, `tInt32`, `tUInt64`, `tInt64`, `tFloat32` and `tFloat64`.
|
||||
|
||||
Array and structure elements can be used separately in assignments, for example:
|
||||
|
||||
````xml
|
||||
<assignment to="structMinimal.i64Val" from="InSignal.structMinimal.ui32Val" />
|
||||
<assignment to="structMinimalAry[0]" from="MinimalSignal" />
|
||||
````
|
||||
|
||||
**Note:**
|
||||
|
||||
A target element can only be assigned once. For instance, if one element in a substructure is already assigned, the whole substructure can not be assigned and reciprocally.
|
||||
|
||||
Target and source signals may only use structured types
|
||||
|
81
doc/input/migration_4_1.md
Normal file
81
doc/input/migration_4_1.md
Normal file
|
@ -0,0 +1,81 @@
|
|||
# Migration to DDL 4.1 {#page_migration_4_1}
|
||||
|
||||
DDL version 4.1.0 introduced an updated coding style which led to changes in all APIs.
|
||||
This guide aims to make the migration as easy as possible.
|
||||
|
||||
# Changes in DDL 4.1
|
||||
|
||||
The updated coding style brought numerous changes. Relevant for the API are:
|
||||
|
||||
* No hungarian notation anymore: Class names are no longer preceded by 'c', i.e. `cDDLDescription` -> `DDLDescription`
|
||||
* Class methods and static functions are now lower case, i.e. `GetValue()` -> `getValue()`
|
||||
* Change of enum values to lower case, i.e. `PLATFORM_LITTLE_ENDIAN_8` -> `plattform_little_endian_8`
|
||||
|
||||
## Version variables changes
|
||||
|
||||
In DDL 4.1 all DDL Version variables were changed from a plain floating point value to objects of type `DDLVersion`.
|
||||
This change made `DDLVersionHelper` obsolete and incorporated most of its functionality in DDLVersion.
|
||||
The necessary adaptions in DDL user code for these changes can not be done automatically by the migration scripts
|
||||
and therefore have to be done manually.
|
||||
|
||||
|
||||
# Migration scripts
|
||||
|
||||
To assist in the migration process a new cmake function gets delivered with the DDL package.
|
||||
After having called `find_package(ddl)` somewhere in your CMake script, the CMake function `ddl_migrate_4_1()`
|
||||
is available. This function will create a migration script for the specified target. It should be called after
|
||||
a target was defined. Example call:
|
||||
|
||||
````cmake
|
||||
ddl_migrate_4_1(TARGET ddl_editor)
|
||||
````
|
||||
|
||||
This will create the migration script in the targets build dir
|
||||
(i.e. `build_Debug/src/ddl_editor/gui/ddl_editor_migrate_to_ddl_4_1.sh`)
|
||||
during the CMake build process.
|
||||
|
||||
## The migration script TARGET_migrate_to_ddl_4_1.sh
|
||||
|
||||
**Important** The resulting script is a `bash` script that uses POSIX tools like `find` and `sed`. Therefore the migration should either be done using a
|
||||
Linux operating system or using a Windows environment that offers a bash runtime and those tools (like MinGW or the Git Bash console)
|
||||
|
||||
The migration is done in two steps:
|
||||
|
||||
* Replacing all DDL class names and enum values with the changed ones. This is a simple text replacement,
|
||||
without any syntax awareness. Therefore it will replace these symbols even in disabled code etc.
|
||||
* Running clang-tidy to automatically fix the remaining issues. This will basically compile the code
|
||||
and tries to fix the arising problems.
|
||||
|
||||
The process will run automatically when executing the migrate script.
|
||||
|
||||
**Warning:** There are several things to note:
|
||||
|
||||
* clang-tidy is called several times, since there will be a lot of issues which obscure each other.
|
||||
*This can take quite some time.*
|
||||
* clang-tidy is very strict concerning include directories. While the 'normal' build process might not
|
||||
have problems discovering header files in sub folder of include directories, clang-tidy will not find
|
||||
them. You have to correctly specify all include directories for your target in the CMake script
|
||||
(which is a good idea anyways). This might happen for example if the target is not explicitly linked
|
||||
against Qt::Gui (but other Qt libs). Qt::Gui has to be added to the linked libraries for clang-tidy
|
||||
to find those headers.
|
||||
* If your target uses generated header files (like Qt applications usually do) those have to be
|
||||
generated before the migration script can do it's work. If the CMake build fails before those are
|
||||
generated you have to fix the dependant targets and run the CMake build process again. Also make sure
|
||||
that the destination of those headers is part of the include dirs.
|
||||
* After the migration is done, clang-tidy might output some remaining warnings. These might not be
|
||||
directly related to the migration process and originate from the static code analysis. While fixing
|
||||
them is probably a good idea, they are usually not build breaking.
|
||||
* The migration script changes your code. A lot. There might be things that get broken by it that are
|
||||
not even related to the DDL code. You should check the code after the migration is done. And of course
|
||||
have it under source control so that any changes can easily be reverted.
|
||||
* If you have serveral targets that depend on each other and use the DDL library, you should migrate
|
||||
them one-by-one along the dependency graph beginning at the leafes.
|
||||
|
||||
## Remaining issues
|
||||
|
||||
Not all issues will be fixed by the migration script. After the script is done try to build the
|
||||
application and fix any build errors manually. These are usually minor issues like `GetValue` or `IsEqual`
|
||||
instead of `getValue` and `isEqual`.
|
||||
|
||||
After the migration is done the calls to `ddl_migrate_4_1()` can be removed from the CMake scripts.
|
||||
|
376
doc/input/mpl.md
Normal file
376
doc/input/mpl.md
Normal file
|
@ -0,0 +1,376 @@
|
|||
Mozilla Public License Version 2.0 {#page_mpl}
|
||||
==================================
|
||||
|
||||
1. Definitions
|
||||
--------------
|
||||
|
||||
### 1.1. "Contributor"
|
||||
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
### 1.2. "Contributor Version"
|
||||
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
|
||||
### 1.3. "Contribution"
|
||||
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
### 1.4. "Covered Software"
|
||||
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
|
||||
### 1.5. "Incompatible With Secondary Licenses"
|
||||
|
||||
means
|
||||
|
||||
a. that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
|
||||
b. that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
|
||||
### 1.6. "Executable Form"
|
||||
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
### 1.7. "Larger Work"
|
||||
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
|
||||
### 1.8. "License"
|
||||
|
||||
means this document.
|
||||
|
||||
### 1.9. "Licensable"
|
||||
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
|
||||
### 1.10. "Modifications"
|
||||
|
||||
means any of the following:
|
||||
|
||||
a. any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
|
||||
b. any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
### 1.11. "Patent Claims" of a Contributor
|
||||
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
### 1.12. "Secondary License"
|
||||
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
|
||||
### 1.13. "Source Code Form"
|
||||
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
### 1.14. "You" (or "Your")
|
||||
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
|
||||
### 2.1. Grants
|
||||
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
a. under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
|
||||
b. under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
### 2.2. Effective Date
|
||||
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
### 2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
a. for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
|
||||
b. for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
|
||||
c. under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
### 2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
### 2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
### 2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
### 2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
|
||||
### 3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
### 3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
a. such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
|
||||
b. You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
|
||||
### 3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
### 3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
|
||||
### 3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
--------------
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under
|
||||
Section 2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
|
||||
6. Disclaimer of Warranty
|
||||
-------------------------
|
||||
|
||||
*Covered Software is provided under this License on an "as is" basis,
|
||||
without warranty of any kind, either expressed, implied, or statutory,
|
||||
including, without limitation, warranties that the Covered Software is
|
||||
free of defects, merchantable, fit for a particular purpose or
|
||||
non-infringing. The entire risk as to the quality and performance of the
|
||||
Covered Software is with You. Should any Covered Software prove
|
||||
defective in any respect, You (not any Contributor) assume the cost of
|
||||
any necessary servicing, repair, or correction. This disclaimer of
|
||||
warranty constitutes an essential part of this License. No use of any
|
||||
Covered Software is authorized under this License except under this
|
||||
disclaimer.*
|
||||
|
||||
7. Limitation of Liability
|
||||
--------------------------
|
||||
|
||||
*Under no circumstances and under no legal theory, whether tort
|
||||
(including negligence), contract, or otherwise, shall any Contributor,
|
||||
or anyone who distributes Covered Software as permitted above, be liable
|
||||
to You for any direct, indirect, special, incidental, or consequential
|
||||
damages of any character including, without limitation, damages for lost
|
||||
profits, loss of goodwill, work stoppage, computer failure or
|
||||
malfunction, or any and all other commercial damages or losses, even if
|
||||
such party shall have been informed of the possibility of such damages.
|
||||
This limitation of liability shall not apply to liability for death or
|
||||
personal injury resulting from such party's negligence to the extent
|
||||
applicable law prohibits such limitation. Some jurisdictions do not
|
||||
allow the exclusion or limitation of incidental or consequential
|
||||
damages, so this exclusion and limitation may not apply to You.*
|
||||
|
||||
8. Litigation
|
||||
-------------
|
||||
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
|
||||
### 10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in
|
||||
Section 10.3, no one other than the license steward has the right to
|
||||
modify or publish new versions of this License. Each version will be
|
||||
given a distinguishing version number.
|
||||
|
||||
### 10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
### 10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
|
||||
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
|
||||
> This Source Code Form is subject to the terms of the Mozilla Public
|
||||
> License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
> file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
|
||||
> This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
> defined by the Mozilla Public License, v. 2.0.
|
63
doc/input/oo-ddl.md
Normal file
63
doc/input/oo-ddl.md
Normal file
|
@ -0,0 +1,63 @@
|
|||
# Object-oriented representation of the DDL (OO-DDL) {#page_oo_ddl}
|
||||
|
||||
# Introduction
|
||||
To facilitate the handling of DDL hierarchies there is an object-oriented
|
||||
approach of representation, called OO-DDL.
|
||||
|
||||
Within the class structure of OO-DDL every node type inside the DDL definition
|
||||
is representated by an own class.
|
||||
|
||||
**Note:**
|
||||
|
||||
These classes are associated by using the GoF design patterns "Visitor",
|
||||
"Decorator", and "Factory Method".
|
||||
The main classes are described in the following section.
|
||||
|
||||
# Structure of classes
|
||||
The basic interface of nearly all classes of the OO-DDL is `ddl::IDDL`.
|
||||
The root element of every DDL structure is an instance of
|
||||
`ddl::cDDLDescription`. For example a DDL Definition File may be
|
||||
represented by `cDDLDescription`. This object holds references to the main
|
||||
parts like the header (`ddl::cDDLHeader`) or the datatypes
|
||||
(`ddl::IDDLDataType`). For further information on all available OO-DDL
|
||||
classes see the SDK documentation of `ddl::IDDL`.
|
||||
|
||||
Every link between DDL-representing objects is realized as pointer to the
|
||||
according object. So lots of string comparisons for matching e.g. child
|
||||
elements could be removed.
|
||||
|
||||
# Building up - using ddl::IDDLFactoryMethod
|
||||
For all creation tasks concerning OO-DDL implementations of the interface
|
||||
`IDDLFactoryMethod` are used. A basic implementation of `IDDLFactoryMethod`
|
||||
is `ddl::cDDLImporter`.
|
||||
|
||||
# Processing DDL - using ddl::IDDLVisitor
|
||||
For every task of processing DDL implementations of `ddl::IDDLVisitor` are
|
||||
used. Utilizing this interface the DDL-representing hierarchy can be walked
|
||||
through and appropriate actions may be taken. The basic implementation of
|
||||
`IDDLVisitor` is `ddl::cDDLPrinter`.
|
||||
|
||||
# The Correlation Between OO-DDL and DDL.
|
||||
Every tag and some attributes in the DDL have a correspondent in the OO-DDL.
|
||||
The following table shows the OO-DDL classes with their matching DDL tag or attribute:
|
||||
|
||||
|DDL Tag/Attribute|OO-DDL Class|
|
||||
|--- |--- |
|
||||
|`<adtf:ddl>`|cDDLDescription|
|
||||
|`<header>`|cDDLHeader|
|
||||
|`<ext_declaration>`|cDDLExtDeclaration|
|
||||
|`<baseunit>`|cDDLBaseunit|
|
||||
|`<prefix>`|cDDLPrefix|
|
||||
|`<unit>`|cDDLUnit|
|
||||
|`<refUnit>`|cDDLRefUnit|
|
||||
|`<datatype>`|cDDLDataType|
|
||||
|`<enum>`|cDDLEnum|
|
||||
|`<struct>`|cDDLComplex|
|
||||
|`<element>`|cDDLElement|
|
||||
|alignment=xxx|cDDLAlignment|
|
||||
|byteorder=xxx|cDDLByteorder|
|
||||
|`<stream>`|cDDLStream|
|
||||
|`<struct>` (within a `<stream>` tag)|cDDLStreamStruct|
|
||||
|
||||
|
||||
|
404
doc/input/used_licenses.md
Normal file
404
doc/input/used_licenses.md
Normal file
|
@ -0,0 +1,404 @@
|
|||
# 3rdparty Software we are very glad to use {#page_used_licenses}
|
||||
|
||||
# a_util Library
|
||||
|
||||
~~~~
|
||||
Mozilla Public License Version 2.0 {#page_mpl}
|
||||
==================================
|
||||
|
||||
1. Definitions
|
||||
--------------
|
||||
|
||||
### 1.1. "Contributor"
|
||||
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
### 1.2. "Contributor Version"
|
||||
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
|
||||
### 1.3. "Contribution"
|
||||
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
### 1.4. "Covered Software"
|
||||
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
|
||||
### 1.5. "Incompatible With Secondary Licenses"
|
||||
|
||||
means
|
||||
|
||||
a. that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
|
||||
b. that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
|
||||
### 1.6. "Executable Form"
|
||||
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
### 1.7. "Larger Work"
|
||||
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
|
||||
### 1.8. "License"
|
||||
|
||||
means this document.
|
||||
|
||||
### 1.9. "Licensable"
|
||||
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
|
||||
### 1.10. "Modifications"
|
||||
|
||||
means any of the following:
|
||||
|
||||
a. any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
|
||||
b. any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
### 1.11. "Patent Claims" of a Contributor
|
||||
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
### 1.12. "Secondary License"
|
||||
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
|
||||
### 1.13. "Source Code Form"
|
||||
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
### 1.14. "You" (or "Your")
|
||||
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
|
||||
### 2.1. Grants
|
||||
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
a. under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
|
||||
b. under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
### 2.2. Effective Date
|
||||
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
### 2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
a. for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
|
||||
b. for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
|
||||
c. under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
### 2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
### 2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
### 2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
### 2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
|
||||
### 3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
### 3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
a. such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
|
||||
b. You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
|
||||
### 3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
### 3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
|
||||
### 3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
--------------
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under
|
||||
Section 2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
|
||||
6. Disclaimer of Warranty
|
||||
-------------------------
|
||||
|
||||
*Covered Software is provided under this License on an "as is" basis,
|
||||
without warranty of any kind, either expressed, implied, or statutory,
|
||||
including, without limitation, warranties that the Covered Software is
|
||||
free of defects, merchantable, fit for a particular purpose or
|
||||
non-infringing. The entire risk as to the quality and performance of the
|
||||
Covered Software is with You. Should any Covered Software prove
|
||||
defective in any respect, You (not any Contributor) assume the cost of
|
||||
any necessary servicing, repair, or correction. This disclaimer of
|
||||
warranty constitutes an essential part of this License. No use of any
|
||||
Covered Software is authorized under this License except under this
|
||||
disclaimer.*
|
||||
|
||||
7. Limitation of Liability
|
||||
--------------------------
|
||||
|
||||
*Under no circumstances and under no legal theory, whether tort
|
||||
(including negligence), contract, or otherwise, shall any Contributor,
|
||||
or anyone who distributes Covered Software as permitted above, be liable
|
||||
to You for any direct, indirect, special, incidental, or consequential
|
||||
damages of any character including, without limitation, damages for lost
|
||||
profits, loss of goodwill, work stoppage, computer failure or
|
||||
malfunction, or any and all other commercial damages or losses, even if
|
||||
such party shall have been informed of the possibility of such damages.
|
||||
This limitation of liability shall not apply to liability for death or
|
||||
personal injury resulting from such party's negligence to the extent
|
||||
applicable law prohibits such limitation. Some jurisdictions do not
|
||||
allow the exclusion or limitation of incidental or consequential
|
||||
damages, so this exclusion and limitation may not apply to You.*
|
||||
|
||||
8. Litigation
|
||||
-------------
|
||||
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
|
||||
### 10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in
|
||||
Section 10.3, no one other than the license steward has the right to
|
||||
modify or publish new versions of this License. Each version will be
|
||||
given a distinguishing version number.
|
||||
|
||||
### 10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
### 10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
|
||||
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
|
||||
> This Source Code Form is subject to the terms of the Mozilla Public
|
||||
> License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
> file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
|
||||
> This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
> defined by the Mozilla Public License, v. 2.0.
|
||||
~~~~
|
||||
|
||||
# Google Test 1.8.0
|
||||
|
||||
## googletest
|
||||
|
||||
@include googletest/googletest-release-1.8.0/googletest/LICENSE
|
||||
|
||||
## googlemock
|
||||
|
||||
@include googletest/googletest-release-1.8.0/googlemock/LICENSE
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue