Skip to content

Commit 699fafe

Browse files
committed
Refs #23432. Add XML support for transport_priority.
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
1 parent 992f002 commit 699fafe

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

resources/xsd/fastdds_profiles.xsd

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@
233233
├ propertiesPolicy [0~1],
234234
├ userDefinedID [int16],
235235
├ entityID [int16],
236-
└ matchedSubscribersAllocation [0~1]-->
236+
└ matchedSubscribersAllocation [0~1],
237+
└ transport_priority [0~1]-->
237238
<xs:complexType name="publisherProfileNoAttributesType">
238239
<xs:all>
239240
<xs:element name="topic" type="topicElementType" minOccurs="0" maxOccurs="1"/>
@@ -248,6 +249,7 @@
248249
<xs:element name="userDefinedID" type="int16" minOccurs="0" maxOccurs="1"/>
249250
<xs:element name="entityID" type="int16" minOccurs="0" maxOccurs="1"/>
250251
<xs:element name="matchedSubscribersAllocation" type="allocationConfigType" minOccurs="0" maxOccurs="1"/>
252+
<xs:element name="transport_priority" type="int32" minOccurs="0" maxOccurs="1"/>
251253
</xs:all>
252254
</xs:complexType>
253255

@@ -266,7 +268,8 @@
266268
├ propertiesPolicy [0~1],
267269
├ userDefinedID [int16],
268270
├ entityID [int16],
269-
└ matchedSubscribersAllocation [0~1]-->
271+
└ matchedSubscribersAllocation [0~1],
272+
└ transport_priority [0~1]-->
270273
<xs:complexType name="publisherProfileType">
271274
<xs:complexContent>
272275
<xs:extension base="publisherProfileNoAttributesType">
@@ -1288,7 +1291,7 @@
12881291
├ reliability [0~1],
12891292
├ timeBasedFilter [0~1],
12901293
├ topicData [0~1],
1291-
userData [0~1] -->
1294+
userData [0~1] -->
12921295
<xs:complexType name="dataWriterQosPoliciesType">
12931296
<xs:all>
12941297
<xs:element name="data_sharing" type="dataSharingQosPolicyType" minOccurs="0" maxOccurs="1"/>

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: 8 additions & 1 deletion
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

@@ -58,7 +60,9 @@ class PublisherAttributes
5860
(this->multicastLocatorList == b.multicastLocatorList) &&
5961
(this->remoteLocatorList == b.remoteLocatorList) &&
6062
(this->historyMemoryPolicy == b.historyMemoryPolicy) &&
61-
(this->properties == b.properties);
63+
(this->properties == b.properties) &&
64+
(this->matched_subscriber_allocation == b.matched_subscriber_allocation) &&
65+
(this->transport_priority == b.transport_priority);
6266
}
6367

6468
//! Topic Attributes for the Publisher
@@ -95,6 +99,9 @@ class PublisherAttributes
9599
//! Allocation limits on the matched subscribers collections
96100
fastdds::ResourceLimitedContainerConfig matched_subscriber_allocation;
97101

102+
//! Transport priority for the Publisher
103+
int32_t transport_priority = 0;
104+
98105
/**
99106
* Get the user defined ID
100107
* @return User defined ID

0 commit comments

Comments
 (0)