File tree Expand file tree Collapse file tree 6 files changed +53
-9
lines changed Expand file tree Collapse file tree 6 files changed +53
-9
lines changed Original file line number Diff line number Diff line change @@ -4427,6 +4427,23 @@ void dds_qos_examples()
4427
4427
// !--
4428
4428
}
4429
4429
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
+
4430
4447
{
4431
4448
// DDS_CHANGE_PARTITION_QOS_POLICY
4432
4449
// This example uses a Publisher, but it can also be applied to Subscriber entities
Original file line number Diff line number Diff line change 72
72
<lease_duration >
73
73
<sec >1</sec >
74
74
</lease_duration >
75
- <kind >AUTOMATIC</kind >
75
+ <kind >AUTOMATIC</kind >
76
76
</liveliness >
77
77
</qos >
78
78
</data_reader >
82
82
<data_writer profile_name =" writer_xml_conf_ownership_profile" >
83
83
<qos >
84
84
<ownership >
85
- <kind >EXCLUSIVE</kind >
85
+ <kind >EXCLUSIVE</kind >
86
86
</ownership >
87
87
</qos >
88
88
</data_writer >
89
89
90
90
<data_reader profile_name =" reader_xml_conf_ownership_profile" >
91
91
<qos >
92
92
<ownership >
93
- <kind >EXCLUSIVE</kind >
93
+ <kind >EXCLUSIVE</kind >
94
94
</ownership >
95
95
</qos >
96
96
</data_reader >
100
100
<data_writer profile_name =" writer_xml_conf_ownership_strength_profile" >
101
101
<qos >
102
102
<ownershipStrength >
103
- <value >10</value >
103
+ <value >10</value >
104
104
</ownershipStrength >
105
105
</qos >
106
106
</data_writer >
107
107
<!-- ><-->
108
108
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
+
109
117
<!-- >CONF-QOS-DATASHARING<-->
110
118
<!--
111
119
<?xml version="1.0" encoding="UTF-8" ?>
2079
2087
<value >50</value >
2080
2088
</ownershipStrength >
2081
2089
2090
+ <transport_priority >12</transport_priority >
2091
+
2082
2092
<partition >
2083
2093
<names >
2084
2094
<name >part1</name >
Original file line number Diff line number Diff line change 572
572
<ownershipStrength >
573
573
<value >50</value >
574
574
</ownershipStrength >
575
+ <transport_priority >-20</transport_priority >
575
576
<partition >
576
577
<names >
577
578
<name >part1</name >
Original file line number Diff line number Diff line change @@ -1296,9 +1296,6 @@ Example
1296
1296
TransportPriorityQosPolicy
1297
1297
^^^^^^^^^^^^^^^^^^^^^^^^^^
1298
1298
1299
- .. warning ::
1300
- This QoS Policy will be implemented in future releases.
1301
-
1302
1299
The purpose of this QoS Policy is to allow the service to take advantage of those transports capable of sending
1303
1300
messages with different priorities. It establishes the priority of the underlying transport used to send the data.
1304
1301
See |TransportPriorityQosPolicy-api |
@@ -1310,14 +1307,30 @@ List of QoS Policy data members:
1310
1307
+-------------------------------------------------------------------------------------+----------------+---------------+
1311
1308
| Data Member Name | Type | Default Value |
1312
1309
+=====================================================================================+================+===============+
1313
- | |TransportPriorityQosPolicy::value-api | | ``uint32_t `` | 0 |
1310
+ | |TransportPriorityQosPolicy::value-api | | ``int32_t `` | 0 |
1314
1311
+-------------------------------------------------------------------------------------+----------------+---------------+
1315
1312
1316
1313
.. note ::
1317
1314
This QoS Policy applies to |Topic | and |DataWriter | entities.
1318
1315
:raw-html: `<br />`
1319
1316
It can be changed on enabled entities.
1320
1317
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
+
1321
1334
1322
1335
.. _userdataqospolicy :
1323
1336
Original file line number Diff line number Diff line change @@ -460,6 +460,9 @@ Please refer to the :ref:`dds_layer_core_policy` section for more information on
460
460
* - ``<ownershipStrength> ``
461
461
- See :ref: `ownershipstrengthqospolicy `.
462
462
- :ref: `xml_ownershipstrength `
463
+ * - ``<transport_priority> ``
464
+ - See :ref: `transportpriorityqospolicy `.
465
+ - ``int32_t `` (default: 0)
463
466
* - ``<partition> ``
464
467
- See :ref: `partitionqospolicy `.
465
468
- :ref: `xml_partition `
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ The DataWriter configuration is performed through the XML elements listed in the
55
55
- :ref: `CommonQOS `
56
56
-
57
57
* - ``<times> ``
58
- - It configures some time related parameters of the DataWriter.
58
+ - It configures some time related parameters of the DataWriter.
59
59
- :ref: `WriterTimes <pubtimes >`
60
60
-
61
61
* - ``<unicastLocatorList> ``
You can’t perform that action at this time.
0 commit comments