Skip to content

Commit c16af32

Browse files
committed
Refs #20160: Removed overloaded discovery methods.
Signed-off-by: adriancampo <[email protected]>
1 parent 61f9e6d commit c16af32

File tree

10 files changed

+24
-126
lines changed

10 files changed

+24
-126
lines changed

include/fastdds/dds/domain/DomainParticipantListener.hpp

-34
Original file line numberDiff line numberDiff line change
@@ -100,23 +100,6 @@ class DomainParticipantListener :
100100
*
101101
* @param[out] participant Pointer to the Participant which discovered the remote DataReader.
102102
* @param[out] info Remote DataReader information. User can take ownership of the object.
103-
*/
104-
virtual void on_data_reader_discovery(
105-
DomainParticipant* participant,
106-
fastrtps::rtps::ReaderDiscoveryInfo&& info)
107-
{
108-
static_cast<void>(participant);
109-
static_cast<void>(info);
110-
}
111-
112-
/*!
113-
* This method is called when a new DataReader is discovered, or a previously discovered DataReader changes
114-
* its QOS or is removed.
115-
*
116-
* @warning Not Supported. This callback will never be called in the current version.
117-
*
118-
* @param[out] participant Pointer to the Participant which discovered the remote DataReader.
119-
* @param[out] info Remote DataReader information. User can take ownership of the object.
120103
* @param[out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataReader.
121104
*/
122105
virtual void on_data_reader_discovery(
@@ -135,23 +118,6 @@ class DomainParticipantListener :
135118
*
136119
* @param[out] participant Pointer to the Participant which discovered the remote DataWriter.
137120
* @param[out] info Remote DataWriter information. User can take ownership of the object.
138-
*/
139-
virtual void on_data_writer_discovery(
140-
DomainParticipant* participant,
141-
fastrtps::rtps::WriterDiscoveryInfo&& info)
142-
{
143-
static_cast<void>(participant);
144-
static_cast<void>(info);
145-
}
146-
147-
/*!
148-
* This method is called when a new DataWriter is discovered, or a previously discovered DataWriter changes
149-
* its QOS or is removed.
150-
*
151-
* @warning Not Supported. This callback will never be called in the current version.
152-
*
153-
* @param[out] participant Pointer to the Participant which discovered the remote DataWriter.
154-
* @param[out] info Remote DataWriter information. User can take ownership of the object.
155121
* @param[out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataWriter.
156122
*/
157123
virtual void on_data_writer_discovery(

src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp

+3-76
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,6 @@ bool TypeLookupManager::remove_async_get_type_request(
482482

483483
bool TypeLookupManager::create_endpoints()
484484
{
485-
bool ret = true;
486-
487485
const RTPSParticipantAttributes& pattr = participant_->getRTPSParticipantAttributes();
488486

489487
// Built-in history attributes.
@@ -519,10 +517,7 @@ bool TypeLookupManager::create_endpoints()
519517
request_listener_ = new TypeLookupRequestListener(this);
520518

521519
// Built-in request writer
522-
request_listener_ = new TypeLookupRequestListener(this);
523520
builtin_request_writer_history_ = new WriterHistory(hatt);
524-
request_wlistener_ = new TypeLookupRequestWListener(this);
525-
526521
RTPSWriter* req_writer;
527522
if (participant_->createWriter(
528523
&req_writer,
@@ -540,41 +535,13 @@ bool TypeLookupManager::create_endpoints()
540535
EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, "Typelookup request writer creation failed.");
541536
delete builtin_request_writer_history_;
542537
builtin_request_writer_history_ = nullptr;
543-
delete request_wlistener_;
544-
request_wlistener_ = nullptr;
545-
return false;
546-
}
547-
548-
// Built-in reply writer
549-
reply_listener_ = new TypeLookupReplyListener(this);
550-
builtin_reply_writer_history_ = new WriterHistory(hatt);
551-
reply_wlistener_ = new TypeLookupReplyWListener(this);
552-
553-
RTPSWriter* rep_writer;
554-
if (participant_->createWriter(
555-
&rep_writer,
556-
watt,
557-
builtin_reply_writer_history_,
558-
reply_listener_,
559-
fastrtps::rtps::c_EntityId_TypeLookup_reply_writer,
560-
true))
561-
{
562-
builtin_reply_writer_ = dynamic_cast<StatefulWriter*>(rep_writer);
563-
EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Builtin Typelookup reply writer created.");
564-
}
565-
else
566-
{
567-
EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, "Typelookup reply writer creation failed.");
568-
delete builtin_reply_writer_history_;
569-
builtin_reply_writer_history_ = nullptr;
570-
delete reply_wlistener_;
571-
reply_wlistener_ = nullptr;
538+
delete request_listener_;
539+
request_listener_ = nullptr;
572540
return false;
573541
}
574542

575543
// Built-in request reader
576544
builtin_request_reader_history_ = new ReaderHistory(hatt);
577-
578545
RTPSReader* req_reader;
579546
if (participant_->createReader(
580547
&req_reader,
@@ -597,7 +564,6 @@ bool TypeLookupManager::create_endpoints()
597564
return false;
598565
}
599566

600-
// Built-in reply reader
601567
reply_listener_ = new TypeLookupReplyListener(this);
602568

603569
// Built-in reply writer
@@ -648,46 +614,7 @@ bool TypeLookupManager::create_endpoints()
648614
return false;
649615
}
650616

651-
// Clean up if something failed.
652-
if (!ret)
653-
{
654-
if (nullptr != builtin_request_writer_history_)
655-
{
656-
delete builtin_request_writer_history_;
657-
builtin_request_writer_history_ = nullptr;
658-
}
659-
660-
if (nullptr != builtin_reply_writer_history_)
661-
{
662-
delete builtin_reply_writer_history_;
663-
builtin_reply_writer_history_ = nullptr;
664-
}
665-
666-
if (nullptr != builtin_request_reader_history_)
667-
{
668-
delete builtin_request_reader_history_;
669-
builtin_request_reader_history_ = nullptr;
670-
}
671-
672-
if (nullptr != builtin_reply_reader_history_)
673-
{
674-
delete builtin_reply_reader_history_;
675-
builtin_reply_reader_history_ = nullptr;
676-
}
677-
678-
if (nullptr != request_listener_)
679-
{
680-
delete request_listener_;
681-
request_listener_ = nullptr;
682-
}
683-
if (nullptr != reply_listener_)
684-
{
685-
delete reply_listener_;
686-
reply_listener_ = nullptr;
687-
}
688-
}
689-
690-
return ret;
617+
return true;
691618
}
692619

693620
TypeLookup_Request* TypeLookupManager::create_request(

src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp

-6
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,6 @@ class TypeLookupManager
436436

437437
//! Collection of all SampleIdentity and the TypeIdentfierWithSize it originated from, hashed by its SampleIdentity.
438438
std::unordered_map<SampleIdentity, xtypes::TypeIdentfierWithSize> async_get_type_requests_;
439-
440-
void request_cache_change_acked(
441-
fastrtps::rtps::CacheChange_t* change);
442-
443-
void reply_cache_change_acked(
444-
fastrtps::rtps::CacheChange_t* change);
445439
};
446440

447441
} /* namespace builtin */

src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
#include <fastdds/builtin/type_lookup_service/TypeLookupReplyListener.hpp>
2121

22-
#include <fastdds/builtin/type_lookup_service/TypeLookupManager.hpp>
2322
#include <fastdds/dds/log/Log.hpp>
2423

24+
#include <fastdds/builtin/type_lookup_service/TypeLookupManager.hpp>
2525
#include <rtps/participant/RTPSParticipantImpl.h>
2626
#include <rtps/RTPSDomainImpl.hpp>
2727

src/cpp/fastdds/domain/DomainParticipantImpl.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,9 @@ void DomainParticipantImpl::MyRTPSParticipantListener::onReaderDiscovery(
15321532
Sentry sentinel(this);
15331533
if (sentinel)
15341534
{
1535-
participant_->listener_->on_data_reader_discovery(participant_->participant_, std::move(info));
1535+
bool should_be_ignored = false;
1536+
participant_->listener_->on_data_reader_discovery(participant_->participant_, std::move(info),
1537+
should_be_ignored);
15361538
}
15371539
}
15381540

@@ -1543,7 +1545,9 @@ void DomainParticipantImpl::MyRTPSParticipantListener::onWriterDiscovery(
15431545
Sentry sentinel(this);
15441546
if (sentinel)
15451547
{
1546-
participant_->listener_->on_data_writer_discovery(participant_->participant_, std::move(info));
1548+
bool should_be_ignored = false;
1549+
participant_->listener_->on_data_writer_discovery(participant_->participant_, std::move(info),
1550+
should_be_ignored);
15471551
}
15481552
}
15491553

test/blackbox/api/dds-pim/PubSubReader.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ class PubSubReader
117117

118118
void on_data_writer_discovery(
119119
eprosima::fastdds::dds::DomainParticipant*,
120-
eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info) override
120+
eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info,
121+
bool& /*should_be_ignored*/) override
121122
{
122123
if (reader_.onEndpointDiscovery_ != nullptr)
123124
{

test/blackbox/api/dds-pim/PubSubWriter.hpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ class PubSubWriter
122122

123123
void on_data_reader_discovery(
124124
eprosima::fastdds::dds::DomainParticipant*,
125-
eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info) override
125+
eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info,
126+
bool& /*should_be_ignored*/) override
126127
{
127128
if (info.status == eprosima::fastrtps::rtps::ReaderDiscoveryInfo::DISCOVERED_READER)
128129
{
@@ -141,7 +142,8 @@ class PubSubWriter
141142

142143
void on_data_writer_discovery(
143144
eprosima::fastdds::dds::DomainParticipant*,
144-
eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info) override
145+
eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info,
146+
bool& /*should_be_ignored*/) override
145147
{
146148
if (info.status == eprosima::fastrtps::rtps::WriterDiscoveryInfo::DISCOVERED_WRITER)
147149
{

test/blackbox/api/dds-pim/PubSubWriterReader.hpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ class PubSubWriterReader
110110

111111
void on_data_reader_discovery(
112112
eprosima::fastdds::dds::DomainParticipant* participant,
113-
eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info) override
113+
eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info,
114+
bool& /*should_be_ignored*/) override
114115
{
115116
(void)participant;
116117

@@ -131,7 +132,8 @@ class PubSubWriterReader
131132

132133
void on_data_writer_discovery(
133134
eprosima::fastdds::dds::DomainParticipant* participant,
134-
eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info) override
135+
eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info,
136+
bool& /*should_be_ignored*/) override
135137
{
136138
(void)participant;
137139

test/unittest/dds/publisher/DataWriterTests.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ TEST(DataWriterTests, get_guid)
374374

375375
void on_data_writer_discovery(
376376
DomainParticipant*,
377-
fastrtps::rtps::WriterDiscoveryInfo&& info) override
377+
fastrtps::rtps::WriterDiscoveryInfo&& info,
378+
bool& /*should_be_ignored*/) override
378379
{
379380
std::unique_lock<std::mutex> lock(mutex);
380381
if (fastrtps::rtps::WriterDiscoveryInfo::DISCOVERED_WRITER == info.status)

test/unittest/dds/subscriber/DataReaderTests.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,8 @@ TEST_F(DataReaderTests, get_guid)
583583

584584
void on_data_reader_discovery(
585585
DomainParticipant*,
586-
ReaderDiscoveryInfo&& info) override
586+
ReaderDiscoveryInfo&& info,
587+
bool& /*should_be_ignored*/) override
587588
{
588589
std::unique_lock<std::mutex> lock(mutex);
589590
if (ReaderDiscoveryInfo::DISCOVERED_READER == info.status)

0 commit comments

Comments
 (0)