Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16315] Improve XML documentation section #435

Merged
merged 41 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f028200
Refs #16315: fix example order to be consistent with the tags table
JLBuenoLopez Dec 16, 2022
459f3b6
Refs #16315: Fix XML example with every transport descriptor option d…
JLBuenoLopez Dec 16, 2022
7b822cb
Refs #16315: add TLS section to example
JLBuenoLopez Dec 16, 2022
f41a3b0
Refs #16315: clarify the address format: DNS name. Change table format
JLBuenoLopez Dec 16, 2022
d740657
Refs #16315: add external locator list example
JLBuenoLopez Dec 19, 2022
b2a190f
Refs #16315: fix typo
JLBuenoLopez Dec 19, 2022
8ccc730
Refs #16315: add DomainParticipant external unicast locators to compl…
JLBuenoLopez Dec 19, 2022
3cf3adf
Refs #16315: clarify ignoreParticipantFlags XML section
JLBuenoLopez Dec 19, 2022
3e1f5fa
Refs #16315: add options missing from complete example
JLBuenoLopez Dec 19, 2022
20f086b
Refs #16315: fix element order in example to be consistent with the d…
JLBuenoLopez Dec 19, 2022
13624e4
Refs #16315: improve DurationType section
JLBuenoLopez Dec 19, 2022
b86689c
Refs #16315: complete builtin discovery config
JLBuenoLopez Dec 19, 2022
ee826f9
Refs #16315: fix title level
JLBuenoLopez Dec 19, 2022
3e73f8a
Refs #16315: add missing builtin elements to complete example
JLBuenoLopez Dec 19, 2022
be5748f
Refs #16315: use correct link to Memory Management Policy
JLBuenoLopez Dec 19, 2022
7f4b79e
Refs #16315: add userData to DomainParticipant
JLBuenoLopez Dec 19, 2022
3505927
Refs #16315: remote locators allocations should have its own subsection
JLBuenoLopez Dec 19, 2022
714e01d
Refs #16315: update section order to be consistent with the table pre…
JLBuenoLopez Dec 19, 2022
cc3471b
Refs #16315: remove throughput controller (deprecated). Follow the sa…
JLBuenoLopez Dec 19, 2022
30a92dc
Refs #16315: remove ThroughputControllerDescriptor from API reference
JLBuenoLopez Dec 20, 2022
800080c
Refs #16315: remove throughput controller information as is deprecate…
JLBuenoLopez Dec 20, 2022
e5060a1
Refs #16315: fix table header
JLBuenoLopez Dec 20, 2022
13a7e42
Refs #16315: remove <domainId> and reestructure header levels
JLBuenoLopez Dec 20, 2022
a129019
Refs #16315: remove <publisher> and <subscriber>
JLBuenoLopez Dec 20, 2022
fd4c866
Refs #16315: remove Topic tags <kind>, <name> and <dataType>
JLBuenoLopez Dec 20, 2022
73b03ca
Refs #16315: avoid referencing again and again to the same section
JLBuenoLopez Dec 20, 2022
d4729de
Refs #16315: add <extra_samples> tag to examples
JLBuenoLopez Dec 20, 2022
5be63e4
Refs #16315: sort alphabetically QoS tags
JLBuenoLopez Dec 20, 2022
4a29fce
Refs #16315: fix Durability default values and constants read by XML …
JLBuenoLopez Dec 20, 2022
3b164db
Refs #16315: sort alphabetically XML QoS example
JLBuenoLopez Dec 20, 2022
3f688a2
Refs #16315: add missing DataWriter QoS from complete example and sor…
JLBuenoLopez Dec 20, 2022
94d3497
Refs #16315: clarify WriterTimes
JLBuenoLopez Dec 20, 2022
3973f7c
Refs #16315: complete datawriter profile example
JLBuenoLopez Dec 20, 2022
ade9353
Refs #16315: clarify ReaderTimes
JLBuenoLopez Dec 20, 2022
d42c8ab
Refs #16315: complete datareader profile example
JLBuenoLopez Dec 20, 2022
49fce55
Refs #16315: log configuration complete example
JLBuenoLopez Dec 20, 2022
434adc8
Refs #16315: complete dynamic primitive types information. Explain first
JLBuenoLopez Dec 20, 2022
a440ebf
Refs #16315: refactor XML dynamic types section
JLBuenoLopez Dec 21, 2022
c163508
Refs #16315: containers within containers must be defined with typede…
JLBuenoLopez Dec 22, 2022
1a7507d
Refs #16315: fix XML files. Remove example from Tester (already in Te…
JLBuenoLopez Dec 22, 2022
474cb95
Refs #16315: apply review suggestions
JLBuenoLopez Jan 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion code/XMLTester.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1272,9 +1272,23 @@
<!-->XML-GENERIC<-->
<struct name="primitive_types_example">
<!-- Primitive type definitions inside a struct -->
<member name="my_long" type="int64"/>
<member name="my_bool" type="boolean"/>
<member name="my_char" type="char8"/>
<member name="my_wchar" type="char16"/>
<member name="my_byte" type="byte"/>
<member name="my_octet" type="octet"/>
<member name="my_uint8" type="uint8"/>
<member name="my_short" type="int16"/>
<member name="my_long" type="int32"/>
<member name="my_unsignedshort" type="uint16"/>
<member name="my_unsignedlong" type="uint32"/>
<member name="my_longlong" type="int64"/>
<member name="my_unsignedlonglong" type="uint64"/>
<member name="my_float" type="float32"/>
<member name="my_double" type="float64"/>
<member name="my_longdouble" type="float128"/>
<member name="my_string" type="string"/>
<member name="my_wstring" type="wstring"/>
</struct>
<!--><-->
<struct name="MembersExample">
Expand Down
66 changes: 36 additions & 30 deletions code/XMLTesterExample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,42 @@
</enum>
</type>
<type>
<!-- All possible members struct type -->
<struct name="MyFullStruct">
<!-- Primitives & basic -->
<member name="my_bool" type="boolean"/>
<member name="my_char" type="char8"/>
<member name="my_wchar" type="char16"/>
<member name="my_byte" type="byte"/>
<member name="my_octet" type="octet"/>
<member name="my_uint8" type="uint8"/>
<member name="my_short" type="int16"/>
<member name="my_long" type="int32"/>
<member name="my_unsignedshort" type="uint16"/>
<member name="my_unsignedlong" type="uint32"/>
<member name="my_longlong" type="int64"/>
<member name="my_unsignedlonglong" type="uint64"/>
<member name="my_float" type="float32"/>
<member name="my_double" type="float64"/>
<member name="my_longdouble" type="float128"/>
<member name="my_string" type="string"/>
<member name="my_wstring" type="wstring"/>

<!-- string my_boundedString[41925] -->
<member name="my_boundedString" type="string" stringMaxLength="41925"/>
<!-- wstring my_boundedWString[41925] -->
<member name="my_boundedWString" type="wstring" stringMaxLength="41925"/>

<!-- long long_array[2][3][4]; -->
<member name="long_array" arrayDimensions="2,3,4" type="int32"/>

<!-- map<long,map<long,long,2>,2> my_map_map; -->
<member name="my_map_map" type="nonBasic" nonBasicTypeName="my_map_inner" key_type="int32" mapMaxLength="2"/>

<!-- Complex types -->
<member name="my_other_struct" type="nonBasic" nonBasicTypeName="OtherStruct"/>
</struct>

<enum name="MyEnum">
<enumerator name="A" value="0"/>
<enumerator name="B" value="1"/>
Expand Down Expand Up @@ -806,36 +842,6 @@
</case>
</union>

<!-- All possible members struct type -->
<struct name="MyFullStruct">
<!-- Primitives & basic -->
<member name="my_bool" type="boolean"/>
<member name="my_byte" type="byte"/>
<member name="my_char" type="char8"/>
<member name="my_wchar" type="char16"/>
<member name="my_short" type="int16"/>
<member name="my_long" type="int32"/>
<member name="my_longlong" type="int64"/>
<member name="my_unsignedshort" type="uint16"/>
<member name="my_unsignedlong" type="uint32"/>
<member name="my_unsignedlonglong" type="uint64"/>
<member name="my_float" type="float32"/>
<member name="my_double" type="float64"/>
<member name="my_longdouble" type="float128"/>
<member name="my_string" type="string"/>
<member name="my_wstring" type="wstring"/>
<member name="my_boundedString" type="string" stringMaxLength="41925"/>
<member name="my_boundedWString" type="wstring" stringMaxLength="41925"/>

<!-- long long_array[2][3][4]; -->
<member name="long_array" arrayDimensions="2,3,4" type="int32"/>

<!-- map<long,map<long,long,2>,2> my_map_map; -->
<member name="my_map_map" type="nonBasic" nonBasicTypeName="my_map_inner" key_type="int32" mapMaxLength="2"/>

<!-- Complex types -->
<member name="my_other_struct" type="nonBasic" nonBasicTypeName="OtherStruct"/>
</struct>
</type>
</types>
</dds>
169 changes: 89 additions & 80 deletions docs/fastdds/xml_configuration/dynamic_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,102 @@ Below, the types supported by *Fast DDS* are presented .
For further information about the supported |DynamicTypes|, please, refer to :ref:`dynamictypes_supportedtypes`.
For each of the types detailed below, an example of how to build the type's XML profile is provided.

* `Enum`_
* `Typedef`_
* `Struct`_
* `Union`_
* `Bitset`_
* `Bitmask`_
* `Member types`_

- `Primitive types`_
- `Arrays`_
- `Sequences`_
- `Maps`_

* `Enum`_
* `Typedef`_
* `Struct`_
* `Union`_
* `Bitset`_
* `Bitmask`_
* `Complex types`_

Member types
""""""""""""

Member types are defined as any type that can belong to a `Struct`_ or a `Union`_, or be aliased by a
`Typedef`_.
These can be defined by the ``<member>`` XML tag.

Primitive types
***************

The identifiers of the available basic types are listed in the table below.
Please, refer to :ref:`dynamictypes_supportedtypes_primitive` for more information on the primitive types.

.. list-table::

* - ``boolean``
- ``char8``
- ``char16``
* - ``byte``
- ``octet``
- ``uint8``
* - ``int8``
- ``int16``
- ``int32``
* - ``uint16``
- ``uint32``
- ``int64``
* - ``uint64``
- ``float32``
- ``float64``
* - ``float128``
- ``string``
- ``wstring``

All of them are defined as follows:

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->XML-GENERIC<-->
:end-before: <!--><-->

Arrays
******

Arrays are defined in the same way as any other member type but they add the attribute ``arrayDimensions``.
The format of the ``arrayDimensions`` attribute value is the size of each dimension separated by commas.
Please, refer to :ref:`dynamictypes_supportedtypes_array` explanation for more information on array type.

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->XML-ARRAYS<-->
:end-before: <!--><-->

Sequences
*********

The sequence type is implemented by setting three attributes: ``name``, the ``type``, and the
``sequenceMaxLength``.
The type of its content should be defined by the ``type`` attribute.
The following example shows the implementation of a sequence of maximum length equal to 3.
In turn, this is a sequence of sequences of maximum length of 2 and contents of type ``int32``.
Please, refer to :ref:`dynamictypes_supportedtypes_sequence` section for more information on sequence type.

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->XML-SEQUENCES<-->
:end-before: <!--><-->

Maps
****

Maps are similar to sequences, but they need to define two content types.
The ``key_type`` defines the type of the map key, while the ``type`` defines the map value type.
Again, both types can be defined as attributes of a ``<typedef>`` element, or as a ``<member>`` child element of a
``<struct>`` or ``<union>`` elements.
See section :ref:`dynamictypes_supportedtypes_map` for more information on map type.

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->XML-MAPS<-->
:end-before: <!--><-->

Enum
""""
Expand Down Expand Up @@ -155,79 +236,6 @@ Please, refer to :ref:`dynamictypes_supportedtypes_bitmask` for more information
:start-after: <!-->XML-BITMASK<-->
:end-before: <!--><-->

Member types
""""""""""""

Member types are defined as any type that can belong to a ``<struct>`` or a ``<union>``, or be aliased by a
``<typedef>``.
These can be defined by the ``<member>`` XML tag.

Primitive types
***************

The identifiers of the available basic types are listed in the table below.
Please, refer to :ref:`dynamictypes_supportedtypes_primitive` for more information on the primitive types.

+--------------------------------------+---------------------------------------+---------------------------------------+
| ``bool`` | ``int32_t`` | ``float32`` |
+--------------------------------------+---------------------------------------+---------------------------------------+
| ``byte`` | ``int64_t`` | ``float64`` |
+--------------------------------------+---------------------------------------+---------------------------------------+
| ``char`` | ``uint16_t`` | ``float128`` |
+--------------------------------------+---------------------------------------+---------------------------------------+
| ``wchar`` | ``uint32_t`` | ``string`` |
+--------------------------------------+---------------------------------------+---------------------------------------+
| ``int16_t`` | ``uint64_t`` | ``wstring`` |
+--------------------------------------+---------------------------------------+---------------------------------------+

All of them are defined as follows:

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->XML-GENERIC<-->
:end-before: <!--><-->

Arrays
******

Arrays are defined in the same way as any other member type but they add the attribute ``arrayDimensions``.
The format of the ``arrayDimensions`` attribute value is the size of each dimension separated by commas.
Please, refer to :ref:`dynamictypes_supportedtypes_array` explanation for more information on array type.

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->XML-ARRAYS<-->
:end-before: <!--><-->

Sequences
*********

The sequence type is implemented by setting three attributes: ``name``, the ``type``, and the
``sequenceMaxLength``.
The type of its content should be defined by the ``type`` attribute.
The following example shows the implementation of a sequence of maximum length equal to 3.
In turn, this is a sequence of sequences of maximum length of 2 and contents of type ``int32``.
Please, refer to :ref:`dynamictypes_supportedtypes_sequence` section for more information on sequence type.

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->XML-SEQUENCES<-->
:end-before: <!--><-->

Maps
****

Maps are similar to sequences, but they need to define two content types.
The ``key_type`` defines the type of the map key, while the ``type`` defines the map value type.
Again, both types can be defined as attributes of a ``<typedef>`` element, or as a ``<member>`` child element of a
``<struct>`` or ``<union>`` elements.
See section :ref:`dynamictypes_supportedtypes_map` for more information on map type.

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->XML-MAPS<-->
:end-before: <!--><-->

Complex types
"""""""""""""

Expand Down Expand Up @@ -260,14 +268,15 @@ these attributes are then defined in the following table.
- Name of the complex type. Only applies if the ``type`` attribute is set to ``nonBasic``.
* - ``arrayDimensions``
- Dimensions of an array.
* - ``stringMaxLength``
- Maximum length of a string.
* - ``sequenceMaxLength``
- Maximum length of a `Sequences`_.
* - ``mapMaxLength``
- Maximum length of a `Maps`_.
* - ``key_type``
- Data type of a map key.


.. _Usage:

Loading dynamic types in a *Fast DDS* application
Expand Down