Skip to content

Commit 08f5f72

Browse files
Remove ReaderProxyData from public APIs (#5078)
* Refs #21300. Rename RTPS callback to `on_reader_discovery`. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Split callback in reason + info. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Remove unused PDP method. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Refactor SubscriptionBuiltinTopicData. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Implement conversion method. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Refactor matched_reader_add. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Additional fields on `SubscriptionBuiltinTopicData`. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Use `SubscriptionBuiltinTopicData` on participant listeners. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Use `SubscriptionBuiltinTopicData` on fill_discovery_data_from_cdr_message. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Refactor on WriterListener. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Move `ReaderProxyData.hpp` to src. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Fix build without security. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Rename header to `ReaderDiscoveryStatus.hpp`. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Uncrustify. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Fix mac build. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Remove export from private headers. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Apply suggestion. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #21300. Update versions.md. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
1 parent 50b6494 commit 08f5f72

89 files changed

Lines changed: 819 additions & 647 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/cpp/rtps/AsSocket/TestWriterSocket.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <fastdds/rtps/attributes/HistoryAttributes.hpp>
2323
#include <fastdds/rtps/attributes/RTPSParticipantAttributes.hpp>
2424
#include <fastdds/rtps/attributes/WriterAttributes.hpp>
25-
#include <fastdds/rtps/builtin/data/ReaderProxyData.hpp>
25+
#include <fastdds/rtps/builtin/data/SubscriptionBuiltinTopicData.hpp>
2626
#include <fastdds/rtps/history/WriterHistory.hpp>
2727
#include <fastdds/rtps/participant/RTPSParticipant.hpp>
2828
#include <fastdds/rtps/RTPSDomain.hpp>
@@ -74,13 +74,13 @@ bool TestWriterSocket::init(
7474
}
7575

7676
//ADD REMOTE READER (IN THIS CASE A READER IN THE SAME MACHINE)
77-
ReaderProxyData ratt(4u, 1u);
78-
ratt.guid({c_GuidPrefix_Unknown, 0x304});
77+
SubscriptionBuiltinTopicData rdata;
78+
rdata.guid = GUID_t{c_GuidPrefix_Unknown, 0x304};
7979
Locator_t loc;
8080
IPLocator::setIPv4(loc, ip);
8181
loc.port = static_cast<uint16_t>(port);
82-
ratt.add_unicast_locator(loc);
83-
mp_writer->matched_reader_add(ratt);
82+
rdata.remote_locators.add_unicast_locator(loc);
83+
mp_writer->matched_reader_add(rdata);
8484
return true;
8585
}
8686

include/fastdds/dds/builtin/topic/SubscriptionBuiltinTopicData.hpp

Lines changed: 2 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -14,79 +14,19 @@
1414

1515
/**
1616
* @file SubscriptionBuiltinTopicData.hpp
17-
*
1817
*/
1918

2019
#ifndef FASTDDS_DDS_BUILTIN_TOPIC__SUBSCRIPTIONBUILTINTOPICDATA_HPP
2120
#define FASTDDS_DDS_BUILTIN_TOPIC__SUBSCRIPTIONBUILTINTOPICDATA_HPP
2221

23-
#include <fastdds/dds/builtin/topic/BuiltinTopicKey.hpp>
24-
#include <fastdds/dds/core/policy/QosPolicies.hpp>
22+
#include <fastdds/rtps/builtin/data/SubscriptionBuiltinTopicData.hpp>
2523

2624
namespace eprosima {
2725
namespace fastdds {
2826
namespace dds {
29-
namespace builtin {
3027

31-
struct SubscriptionBuiltinTopicData
32-
{
33-
//! Builtin topic Key
34-
BuiltinTopicKey_t key;
28+
using SubscriptionBuiltinTopicData = rtps::SubscriptionBuiltinTopicData;
3529

36-
//! Builtin participant topic Key
37-
BuiltinTopicKey_t participant_key;
38-
39-
//! Topic name
40-
std::string topic_name;
41-
42-
//! Type name
43-
std::string type_name;
44-
45-
// DataReader Qos
46-
47-
//!Durability Qos, implemented in the library.
48-
DurabilityQosPolicy durability;
49-
50-
//!Deadline Qos, implemented in the library.
51-
DeadlineQosPolicy deadline;
52-
53-
//!Latency Budget Qos, NOT implemented in the library.
54-
LatencyBudgetQosPolicy latency_budget;
55-
56-
//!Liveliness Qos, implemented in the library.
57-
LivelinessQosPolicy liveliness;
58-
59-
//!Reliability Qos, implemented in the library.
60-
ReliabilityQosPolicy reliability;
61-
62-
//!Ownership Qos, implemented in the library.
63-
OwnershipQosPolicy ownership;
64-
65-
//!Destination Order Qos, NOT implemented in the library.
66-
DestinationOrderQosPolicy destination_order;
67-
68-
//!User Data Qos, implemented in the library.
69-
UserDataQosPolicy user_data;
70-
71-
//!Time Based Filter Qos, NOT implemented in the library.
72-
TimeBasedFilterQosPolicy m_timeBasedFilter;
73-
74-
// Subscriber Qos
75-
76-
//!Presentation Qos, NOT implemented in the library.
77-
PresentationQosPolicy presentation;
78-
79-
//!Partition Qos, implemented in the library.
80-
PartitionQosPolicy partition;
81-
82-
//!Topic Data Qos, NOT implemented in the library.
83-
TopicDataQosPolicy topic_data;
84-
85-
//!Group Data Qos, implemented in the library.
86-
GroupDataQosPolicy group_data;
87-
};
88-
89-
} // builtin
9030
} // dds
9131
} // fastdds
9232
} // eprosima

include/fastdds/dds/domain/DomainParticipantListener.hpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
#define FASTDDS_DDS_DOMAIN__DOMAINPARTICIPANTLISTENER_HPP
2222

2323
#include <fastdds/dds/builtin/topic/PublicationBuiltinTopicData.hpp>
24+
#include <fastdds/dds/builtin/topic/SubscriptionBuiltinTopicData.hpp>
2425
#include <fastdds/dds/publisher/PublisherListener.hpp>
2526
#include <fastdds/dds/subscriber/SubscriberListener.hpp>
2627
#include <fastdds/dds/topic/TopicListener.hpp>
2728
#include <fastdds/rtps/participant/ParticipantDiscoveryInfo.hpp>
28-
#include <fastdds/rtps/reader/ReaderDiscoveryInfo.hpp>
29+
#include <fastdds/rtps/reader/ReaderDiscoveryStatus.hpp>
2930
#include <fastdds/rtps/writer/WriterDiscoveryStatus.hpp>
3031

3132
namespace eprosima {
@@ -99,16 +100,19 @@ class DomainParticipantListener :
99100
* This method is called when a new DataReader is discovered, or a previously discovered DataReader changes
100101
* its QOS or is removed.
101102
*
102-
* @param [out] participant Pointer to the Participant which discovered the remote DataReader.
103-
* @param [out] info Remote DataReader information. User can take ownership of the object.
104-
* @param [out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataReader.
103+
* @param [in] participant Pointer to the Participant which discovered the remote reader.
104+
* @param [in] reason The reason motivating this method to be called.
105+
* @param [in] info Remote reader information.
106+
* @param [out] should_be_ignored Flag to indicate the library to automatically ignore the discovered reader.
105107
*/
106108
virtual void on_data_reader_discovery(
107109
DomainParticipant* participant,
108-
rtps::ReaderDiscoveryInfo&& info,
110+
rtps::ReaderDiscoveryStatus reason,
111+
const SubscriptionBuiltinTopicData& info,
109112
bool& should_be_ignored)
110113
{
111114
static_cast<void>(participant);
115+
static_cast<void>(reason);
112116
static_cast<void>(info);
113117
static_cast<void>(should_be_ignored);
114118
}

include/fastdds/dds/publisher/DataWriter.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ class DataWriter : public DomainEntity
485485
* @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED
486486
*/
487487
FASTDDS_EXPORTED_API ReturnCode_t get_matched_subscription_data(
488-
builtin::SubscriptionBuiltinTopicData& subscription_data,
488+
SubscriptionBuiltinTopicData& subscription_data,
489489
const InstanceHandle_t& subscription_handle) const;
490490

491491
/**
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
/**
16+
* @file SubscriptionBuiltinTopicData.hpp
17+
*/
18+
19+
#ifndef FASTDDS_RTPS_BUILTIN_DATA__SUBSCRIPTIONBUILTINTOPICDATA_HPP
20+
#define FASTDDS_RTPS_BUILTIN_DATA__SUBSCRIPTIONBUILTINTOPICDATA_HPP
21+
22+
#include <fastcdr/cdr/fixed_size_string.hpp>
23+
24+
#include <fastdds/dds/core/policy/QosPolicies.hpp>
25+
#include <fastdds/rtps/builtin/data/BuiltinTopicKey.hpp>
26+
#include <fastdds/rtps/builtin/data/ContentFilterProperty.hpp>
27+
#include <fastdds/rtps/common/Guid.hpp>
28+
#include <fastdds/rtps/common/RemoteLocators.hpp>
29+
#include <fastdds/rtps/common/Types.hpp>
30+
31+
namespace eprosima {
32+
namespace fastdds {
33+
namespace rtps {
34+
35+
/// Structure SubscriptionBuiltinTopicData, contains the information on a discovered subscription.
36+
struct SubscriptionBuiltinTopicData
37+
{
38+
/// Builtin topic Key
39+
BuiltinTopicKey_t key;
40+
41+
/// Builtin participant topic Key
42+
BuiltinTopicKey_t participant_key;
43+
44+
/// Topic name
45+
fastcdr::string_255 topic_name;
46+
47+
/// Type name
48+
fastcdr::string_255 type_name;
49+
50+
// DataReader Qos
51+
52+
/// Durability Qos, implemented in the library.
53+
dds::DurabilityQosPolicy durability;
54+
55+
/// Deadline Qos, implemented in the library.
56+
dds::DeadlineQosPolicy deadline;
57+
58+
/// Latency Budget Qos, NOT implemented in the library.
59+
dds::LatencyBudgetQosPolicy latency_budget;
60+
61+
/// Lifespan Qos, implemented in the library.
62+
dds::LifespanQosPolicy lifespan;
63+
64+
/// Liveliness Qos, implemented in the library.
65+
dds::LivelinessQosPolicy liveliness;
66+
67+
/// Reliability Qos, implemented in the library.
68+
dds::ReliabilityQosPolicy reliability;
69+
70+
/// Ownership Qos, implemented in the library.
71+
dds::OwnershipQosPolicy ownership;
72+
73+
/// Destination Order Qos, NOT implemented in the library.
74+
dds::DestinationOrderQosPolicy destination_order;
75+
76+
/// User Data Qos, implemented in the library.
77+
dds::UserDataQosPolicy user_data;
78+
79+
/// Time Based Filter Qos, NOT implemented in the library.
80+
dds::TimeBasedFilterQosPolicy time_based_filter;
81+
82+
// Subscriber Qos
83+
84+
/// Presentation Qos, NOT implemented in the library.
85+
dds::PresentationQosPolicy presentation;
86+
87+
/// Partition Qos, implemented in the library.
88+
dds::PartitionQosPolicy partition;
89+
90+
/// Topic Data Qos, NOT implemented in the library.
91+
dds::TopicDataQosPolicy topic_data;
92+
93+
/// Group Data Qos, implemented in the library.
94+
dds::GroupDataQosPolicy group_data;
95+
96+
// X-Types 1.3
97+
98+
/// Type information
99+
dds::xtypes::TypeInformationParameter type_information;
100+
101+
/// Data representation
102+
dds::DataRepresentationQosPolicy representation;
103+
104+
/// Type consistency enforcement Qos, NOT implemented in the library.
105+
dds::TypeConsistencyEnforcementQosPolicy type_consistency;
106+
107+
// eProsima Extensions
108+
109+
/// Content filter configuration
110+
ContentFilterProperty content_filter{ ContentFilterProperty::AllocationConfiguration{} };
111+
112+
/// Disable positive acks, implemented in the library.
113+
dds::DisablePositiveACKsQosPolicy disable_positive_acks;
114+
115+
/// Information for data sharing compatibility check.
116+
dds::DataSharingQosPolicy data_sharing;
117+
118+
/// GUID
119+
GUID_t guid;
120+
121+
/// Participant GUID
122+
GUID_t participant_guid;
123+
124+
/// Remote locators
125+
RemoteLocatorList remote_locators;
126+
127+
/// Network configuration
128+
NetworkConfigSet_t loopback_transformation;
129+
130+
/// Expects Inline Qos
131+
bool expects_inline_qos = false;
132+
};
133+
134+
} // namespace rtps
135+
} // namespace fastdds
136+
} // namespace eprosima
137+
138+
#endif // FASTDDS_RTPS_BUILTIN_DATA__SUBSCRIPTIONBUILTINTOPICDATA_HPP

include/fastdds/rtps/participant/RTPSParticipant.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class RTPSParticipantImpl;
6363
class RTPSParticipantListener;
6464
class RTPSWriter;
6565
class RTPSReader;
66-
class ReaderProxyData;
66+
struct SubscriptionBuiltinTopicData;
6767
class EndpointAttributes;
6868
class WriterAttributes;
6969
class ReaderAttributes;
@@ -420,16 +420,16 @@ class FASTDDS_EXPORTED_API RTPSParticipant
420420
const fastdds::statistics::MonitorServiceStatusData& msg);
421421

422422
/**
423-
* fills in the ReaderProxyData from a MonitorService Message
423+
* fills in the SubscriptionBuiltinTopicData from a MonitorService Message
424424
*
425425
* @param [out] data Proxy to fill.
426426
* @param [in] msg MonitorService Message to get the proxy information from.
427427
*
428428
* @return true if the operation succeeds.
429429
*/
430430
bool fill_discovery_data_from_cdr_message(
431-
ReaderProxyData& data,
432-
fastdds::statistics::MonitorServiceStatusData& msg);
431+
SubscriptionBuiltinTopicData& data,
432+
const fastdds::statistics::MonitorServiceStatusData& msg);
433433

434434
#endif // FASTDDS_STATISTICS
435435

include/fastdds/rtps/participant/RTPSParticipantListener.hpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414

1515
/**
1616
* @file RTPSParticipantListener.hpp
17-
*
1817
*/
1918

2019
#ifndef FASTDDS_RTPS_PARTICIPANT__RTPSPARTICIPANTLISTENER_HPP
2120
#define FASTDDS_RTPS_PARTICIPANT__RTPSPARTICIPANTLISTENER_HPP
2221

2322
#include <fastdds/rtps/builtin/data/PublicationBuiltinTopicData.hpp>
23+
#include <fastdds/rtps/builtin/data/SubscriptionBuiltinTopicData.hpp>
2424
#include <fastdds/rtps/participant/ParticipantDiscoveryInfo.hpp>
25-
#include <fastdds/rtps/reader/ReaderDiscoveryInfo.hpp>
25+
#include <fastdds/rtps/reader/ReaderDiscoveryStatus.hpp>
2626
#include <fastdds/rtps/writer/WriterDiscoveryStatus.hpp>
2727

2828
namespace eprosima {
@@ -81,16 +81,19 @@ class FASTDDS_EXPORTED_API RTPSParticipantListener
8181
* This method is called when a new Reader is discovered, or a previously discovered reader changes
8282
* its QOS or is removed.
8383
*
84-
* @param [out] participant Pointer to the Participant which discovered the remote reader.
85-
* @param [out] info Remote reader information. User can take ownership of the object.
86-
* @param [out] should_be_ignored Flag to indicate the library to automatically ignore the discovered Reader.
84+
* @param [in] participant Pointer to the Participant which discovered the remote reader.
85+
* @param [in] reason The reason motivating this method to be called.
86+
* @param [in] info Remote reader information.
87+
* @param [out] should_be_ignored Flag to indicate the library to automatically ignore the discovered reader.
8788
*/
88-
virtual void onReaderDiscovery(
89+
virtual void on_reader_discovery(
8990
RTPSParticipant* participant,
90-
ReaderDiscoveryInfo&& info,
91+
ReaderDiscoveryStatus reason,
92+
const SubscriptionBuiltinTopicData& info,
9193
bool& should_be_ignored)
9294
{
9395
static_cast<void>(participant);
96+
static_cast<void>(reason);
9497
static_cast<void>(info);
9598
should_be_ignored = false;
9699
}

0 commit comments

Comments
 (0)