Skip to content

Commit 8642f9f

Browse files
Documentation for transport priority feature (#1099)
* Refs #23432. Update `TransportPriorityQosPolicy` section in `Standard QoS Policies` page. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23432. Fix tabs in XMLTester.xml. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23432. Add configuration example. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23432. Add transport_priority to profiles and full xml examples. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23432. Apply review suggestions. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23432. Move XML for transport_priority inside qos tag. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
1 parent cc8cfc1 commit 8642f9f

File tree

6 files changed

+53
-9
lines changed

6 files changed

+53
-9
lines changed

code/DDSCodeTester.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4427,6 +4427,23 @@ void dds_qos_examples()
44274427
//!--
44284428
}
44294429

4430+
{
4431+
//DDS_CHANGE_TRANSPORT_PRIORITY_QOS_POLICY
4432+
// This example only applies to DataWriter entities
4433+
DataWriterQos writer_qos;
4434+
// The TransportPriorityQosPolicy is constructed with value 0 by default
4435+
// Change the value to 12
4436+
writer_qos.transport_priority().value = 12;
4437+
// Use modified QoS in the creation of the corresponding DataWriter
4438+
writer_ = publisher_->create_datawriter(topic_, writer_qos);
4439+
4440+
// Change the TransportPriorityQosPolicy at runtime
4441+
writer_qos.transport_priority().value = 23;
4442+
// Update the QoS in the corresponding entity
4443+
writer_->set_qos(writer_qos);
4444+
//!--
4445+
}
4446+
44304447
{
44314448
//DDS_CHANGE_PARTITION_QOS_POLICY
44324449
// This example uses a Publisher, but it can also be applied to Subscriber entities

code/XMLTester.xml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<lease_duration>
7373
<sec>1</sec>
7474
</lease_duration>
75-
<kind>AUTOMATIC</kind>
75+
<kind>AUTOMATIC</kind>
7676
</liveliness>
7777
</qos>
7878
</data_reader>
@@ -82,15 +82,15 @@
8282
<data_writer profile_name="writer_xml_conf_ownership_profile">
8383
<qos>
8484
<ownership>
85-
<kind>EXCLUSIVE</kind>
85+
<kind>EXCLUSIVE</kind>
8686
</ownership>
8787
</qos>
8888
</data_writer>
8989

9090
<data_reader profile_name="reader_xml_conf_ownership_profile">
9191
<qos>
9292
<ownership>
93-
<kind>EXCLUSIVE</kind>
93+
<kind>EXCLUSIVE</kind>
9494
</ownership>
9595
</qos>
9696
</data_reader>
@@ -100,12 +100,20 @@
100100
<data_writer profile_name="writer_xml_conf_ownership_strength_profile">
101101
<qos>
102102
<ownershipStrength>
103-
<value>10</value>
103+
<value>10</value>
104104
</ownershipStrength>
105105
</qos>
106106
</data_writer>
107107
<!--><-->
108108

109+
<!-->PUBSUB_API_CONF_PUBSUB_TRANSPORT_PRIORITY<-->
110+
<data_writer profile_name="writer_xml_conf_transport_priority_profile">
111+
<qos>
112+
<transport_priority>12</transport_priority>
113+
</qos>
114+
</data_writer>
115+
<!--><-->
116+
109117
<!-->CONF-QOS-DATASHARING<-->
110118
<!--
111119
<?xml version="1.0" encoding="UTF-8" ?>
@@ -2079,6 +2087,8 @@
20792087
<value>50</value>
20802088
</ownershipStrength>
20812089

2090+
<transport_priority>12</transport_priority>
2091+
20822092
<partition>
20832093
<names>
20842094
<name>part1</name>

code/XMLTesterExample.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@
572572
<ownershipStrength>
573573
<value>50</value>
574574
</ownershipStrength>
575+
<transport_priority>-20</transport_priority>
575576
<partition>
576577
<names>
577578
<name>part1</name>

docs/fastdds/dds_layer/core/policy/standardQosPolicies.rst

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,9 +1296,6 @@ Example
12961296
TransportPriorityQosPolicy
12971297
^^^^^^^^^^^^^^^^^^^^^^^^^^
12981298

1299-
.. warning::
1300-
This QoS Policy will be implemented in future releases.
1301-
13021299
The purpose of this QoS Policy is to allow the service to take advantage of those transports capable of sending
13031300
messages with different priorities. It establishes the priority of the underlying transport used to send the data.
13041301
See |TransportPriorityQosPolicy-api|
@@ -1310,14 +1307,30 @@ List of QoS Policy data members:
13101307
+-------------------------------------------------------------------------------------+----------------+---------------+
13111308
| Data Member Name | Type | Default Value |
13121309
+=====================================================================================+================+===============+
1313-
| |TransportPriorityQosPolicy::value-api| | ``uint32_t`` | 0 |
1310+
| |TransportPriorityQosPolicy::value-api| | ``int32_t`` | 0 |
13141311
+-------------------------------------------------------------------------------------+----------------+---------------+
13151312

13161313
.. note::
13171314
This QoS Policy applies to |Topic| and |DataWriter| entities.
13181315
:raw-html:`<br />`
13191316
It can be changed on enabled entities.
13201317

1318+
Example
1319+
"""""""
1320+
1321+
.. tab-set-code::
1322+
1323+
.. literalinclude:: /../code/DDSCodeTester.cpp
1324+
:language: c++
1325+
:dedent: 8
1326+
:start-after: //DDS_CHANGE_TRANSPORT_PRIORITY_QOS_POLICY
1327+
:end-before: //!
1328+
1329+
.. literalinclude:: /../code/XMLTester.xml
1330+
:language: xml
1331+
:start-after: <!-->PUBSUB_API_CONF_PUBSUB_TRANSPORT_PRIORITY
1332+
:end-before: <!--><-->
1333+
13211334

13221335
.. _userdataqospolicy:
13231336

docs/fastdds/xml_configuration/common.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,9 @@ Please refer to the :ref:`dds_layer_core_policy` section for more information on
460460
* - ``<ownershipStrength>``
461461
- See :ref:`ownershipstrengthqospolicy`.
462462
- :ref:`xml_ownershipstrength`
463+
* - ``<transport_priority>``
464+
- See :ref:`transportpriorityqospolicy`.
465+
- ``int32_t`` (default: 0)
463466
* - ``<partition>``
464467
- See :ref:`partitionqospolicy`.
465468
- :ref:`xml_partition`

docs/fastdds/xml_configuration/datawriter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The DataWriter configuration is performed through the XML elements listed in the
5555
- :ref:`CommonQOS`
5656
-
5757
* - ``<times>``
58-
- It configures some time related parameters of the DataWriter.
58+
- It configures some time related parameters of the DataWriter.
5959
- :ref:`WriterTimes <pubtimes>`
6060
-
6161
* - ``<unicastLocatorList>``

0 commit comments

Comments
 (0)