Skip to content

Commit 02bba97

Browse files
committed
Refs #23432. Add XML support for transport_priority.
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
1 parent 7c6342e commit 02bba97

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

resources/xsd/fastdds_profiles.xsd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,8 @@
12881288
├ reliability [0~1],
12891289
├ timeBasedFilter [0~1],
12901290
├ topicData [0~1],
1291-
└ userData [0~1] -->
1291+
├ userData [0~1],
1292+
└ transport_priority [0~1] -->
12921293
<xs:complexType name="dataWriterQosPoliciesType">
12931294
<xs:all>
12941295
<xs:element name="data_sharing" type="dataSharingQosPolicyType" minOccurs="0" maxOccurs="1"/>
@@ -1311,6 +1312,7 @@
13111312
<xs:element name="timeBasedFilter" type="timeBasedFilterQosPolicyType" minOccurs="0" maxOccurs="1"/>
13121313
<xs:element name="topicData" type="octectVectorQosPolicyType" minOccurs="0" maxOccurs="1"/>
13131314
<xs:element name="userData" type="octectVectorQosPolicyType" minOccurs="0" maxOccurs="1"/>
1315+
<xs:element name="transport_priority" type="int32" minOccurs="0" maxOccurs="1"/>
13141316
</xs:all>
13151317
</xs:complexType>
13161318

src/cpp/fastdds/utils/QosConverters.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ void set_qos_from_attributes(
6363
qos.resource_limits() = attr.topic.resourceLimitsQos;
6464
qos.data_sharing() = attr.qos.data_sharing;
6565
qos.reliable_writer_qos().disable_heartbeat_piggyback = attr.qos.disable_heartbeat_piggyback;
66+
qos.transport_priority().value = attr.transport_priority;
6667

6768
if (attr.qos.m_partition.size() > 0 )
6869
{

src/cpp/xmlparser/XMLElementParser.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4285,6 +4285,14 @@ XMLP_ret XMLParser::getXMLPublisherAttributes(
42854285
return XMLP_ret::XML_ERROR;
42864286
}
42874287
}
4288+
else if (strcmp(name, "transport_priority") == 0)
4289+
{
4290+
// transport_priority - int32
4291+
if (XMLP_ret::XML_OK != getXMLInt(p_aux0, &publisher.transport_priority, ident))
4292+
{
4293+
return XMLP_ret::XML_ERROR;
4294+
}
4295+
}
42884296
else
42894297
{
42904298
EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid element found into 'publisherProfileType'. Name: " << name);

src/cpp/xmlparser/attributes/PublisherAttributes.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#ifndef FASTDDS_XMLPARSER_ATTRIBUTES__PUBLISHERATTRIBUTES_HPP
2020
#define FASTDDS_XMLPARSER_ATTRIBUTES__PUBLISHERATTRIBUTES_HPP
2121

22+
#include <cstdint>
2223

2324
#include <fastdds/dds/publisher/qos/WriterQos.hpp>
2425
#include <fastdds/rtps/attributes/ExternalLocators.hpp>
@@ -27,6 +28,7 @@
2728
#include <fastdds/rtps/attributes/WriterAttributes.hpp>
2829
#include <fastdds/rtps/common/Locator.hpp>
2930
#include <fastdds/rtps/common/Time_t.hpp>
31+
#include <fastdds/utils/collections/ResourceLimitedContainerConfig.hpp>
3032

3133
#include <xmlparser/attributes/TopicAttributes.hpp>
3234

@@ -95,6 +97,9 @@ class PublisherAttributes
9597
//! Allocation limits on the matched subscribers collections
9698
fastdds::ResourceLimitedContainerConfig matched_subscriber_allocation;
9799

100+
//! Transport priority for the Publisher
101+
int32_t transport_priority;
102+
98103
/**
99104
* Get the user defined ID
100105
* @return User defined ID

0 commit comments

Comments
 (0)