diff --git a/include/fastdds/dds/domain/DomainParticipantListener.hpp b/include/fastdds/dds/domain/DomainParticipantListener.hpp index 3e90763ddb9..9455729d6e5 100644 --- a/include/fastdds/dds/domain/DomainParticipantListener.hpp +++ b/include/fastdds/dds/domain/DomainParticipantListener.hpp @@ -100,23 +100,6 @@ class DomainParticipantListener : * * @param[out] participant Pointer to the Participant which discovered the remote DataReader. * @param[out] info Remote DataReader information. User can take ownership of the object. - */ - virtual void on_data_reader_discovery( - DomainParticipant* participant, - fastrtps::rtps::ReaderDiscoveryInfo&& info) - { - static_cast(participant); - static_cast(info); - } - - /*! - * This method is called when a new DataReader is discovered, or a previously discovered DataReader changes - * its QOS or is removed. - * - * @warning Not Supported. This callback will never be called in the current version. - * - * @param[out] participant Pointer to the Participant which discovered the remote DataReader. - * @param[out] info Remote DataReader information. User can take ownership of the object. * @param[out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataReader. */ virtual void on_data_reader_discovery( @@ -135,23 +118,6 @@ class DomainParticipantListener : * * @param[out] participant Pointer to the Participant which discovered the remote DataWriter. * @param[out] info Remote DataWriter information. User can take ownership of the object. - */ - virtual void on_data_writer_discovery( - DomainParticipant* participant, - fastrtps::rtps::WriterDiscoveryInfo&& info) - { - static_cast(participant); - static_cast(info); - } - - /*! - * This method is called when a new DataWriter is discovered, or a previously discovered DataWriter changes - * its QOS or is removed. - * - * @warning Not Supported. This callback will never be called in the current version. - * - * @param[out] participant Pointer to the Participant which discovered the remote DataWriter. - * @param[out] info Remote DataWriter information. User can take ownership of the object. * @param[out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataWriter. */ virtual void on_data_writer_discovery( diff --git a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp index aaec81731cb..c1bde7dcfed 100644 --- a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp +++ b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp @@ -482,8 +482,6 @@ bool TypeLookupManager::remove_async_get_type_request( bool TypeLookupManager::create_endpoints() { - bool ret = true; - const RTPSParticipantAttributes& pattr = participant_->getRTPSParticipantAttributes(); // Built-in history attributes. @@ -519,10 +517,7 @@ bool TypeLookupManager::create_endpoints() request_listener_ = new TypeLookupRequestListener(this); // Built-in request writer - request_listener_ = new TypeLookupRequestListener(this); builtin_request_writer_history_ = new WriterHistory(hatt); - request_wlistener_ = new TypeLookupRequestWListener(this); - RTPSWriter* req_writer; if (participant_->createWriter( &req_writer, @@ -540,41 +535,13 @@ bool TypeLookupManager::create_endpoints() EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, "Typelookup request writer creation failed."); delete builtin_request_writer_history_; builtin_request_writer_history_ = nullptr; - delete request_wlistener_; - request_wlistener_ = nullptr; - return false; - } - - // Built-in reply writer - reply_listener_ = new TypeLookupReplyListener(this); - builtin_reply_writer_history_ = new WriterHistory(hatt); - reply_wlistener_ = new TypeLookupReplyWListener(this); - - RTPSWriter* rep_writer; - if (participant_->createWriter( - &rep_writer, - watt, - builtin_reply_writer_history_, - reply_listener_, - fastrtps::rtps::c_EntityId_TypeLookup_reply_writer, - true)) - { - builtin_reply_writer_ = dynamic_cast(rep_writer); - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Builtin Typelookup reply writer created."); - } - else - { - EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, "Typelookup reply writer creation failed."); - delete builtin_reply_writer_history_; - builtin_reply_writer_history_ = nullptr; - delete reply_wlistener_; - reply_wlistener_ = nullptr; + delete request_listener_; + request_listener_ = nullptr; return false; } // Built-in request reader builtin_request_reader_history_ = new ReaderHistory(hatt); - RTPSReader* req_reader; if (participant_->createReader( &req_reader, @@ -597,7 +564,6 @@ bool TypeLookupManager::create_endpoints() return false; } - // Built-in reply reader reply_listener_ = new TypeLookupReplyListener(this); // Built-in reply writer @@ -648,46 +614,7 @@ bool TypeLookupManager::create_endpoints() return false; } - // Clean up if something failed. - if (!ret) - { - if (nullptr != builtin_request_writer_history_) - { - delete builtin_request_writer_history_; - builtin_request_writer_history_ = nullptr; - } - - if (nullptr != builtin_reply_writer_history_) - { - delete builtin_reply_writer_history_; - builtin_reply_writer_history_ = nullptr; - } - - if (nullptr != builtin_request_reader_history_) - { - delete builtin_request_reader_history_; - builtin_request_reader_history_ = nullptr; - } - - if (nullptr != builtin_reply_reader_history_) - { - delete builtin_reply_reader_history_; - builtin_reply_reader_history_ = nullptr; - } - - if (nullptr != request_listener_) - { - delete request_listener_; - request_listener_ = nullptr; - } - if (nullptr != reply_listener_) - { - delete reply_listener_; - reply_listener_ = nullptr; - } - } - - return ret; + return true; } TypeLookup_Request* TypeLookupManager::create_request( diff --git a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp index efd35d4e3b1..6e2065daf59 100644 --- a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp +++ b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp @@ -436,12 +436,6 @@ class TypeLookupManager //! Collection of all SampleIdentity and the TypeIdentfierWithSize it originated from, hashed by its SampleIdentity. std::unordered_map async_get_type_requests_; - - void request_cache_change_acked( - fastrtps::rtps::CacheChange_t* change); - - void reply_cache_change_acked( - fastrtps::rtps::CacheChange_t* change); }; } /* namespace builtin */ diff --git a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp index 2a054169ff8..208af1e4868 100644 --- a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp +++ b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp @@ -19,9 +19,9 @@ #include -#include #include +#include #include #include diff --git a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp index 10197afa3e8..7d5d8a9ead6 100644 --- a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp +++ b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp @@ -1532,7 +1532,9 @@ void DomainParticipantImpl::MyRTPSParticipantListener::onReaderDiscovery( Sentry sentinel(this); if (sentinel) { - participant_->listener_->on_data_reader_discovery(participant_->participant_, std::move(info)); + bool should_be_ignored = false; + participant_->listener_->on_data_reader_discovery(participant_->participant_, std::move(info), + should_be_ignored); } } @@ -1543,7 +1545,9 @@ void DomainParticipantImpl::MyRTPSParticipantListener::onWriterDiscovery( Sentry sentinel(this); if (sentinel) { - participant_->listener_->on_data_writer_discovery(participant_->participant_, std::move(info)); + bool should_be_ignored = false; + participant_->listener_->on_data_writer_discovery(participant_->participant_, std::move(info), + should_be_ignored); } } diff --git a/src/cpp/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp b/src/cpp/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp index e6e9fee4787..d8663c96b7b 100644 --- a/src/cpp/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp +++ b/src/cpp/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp @@ -611,35 +611,6 @@ ReturnCode_t TypeObjectRegistry::get_type_dependencies_impl( return ret_code; } -const TypeIdentifier TypeObjectRegistry::complete_from_minimal_type_identifier( - const TypeIdentifier& type_id) -{ - if (EK_MINIMAL == type_id._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_id._d() && type_id.seq_sdefn().header().equiv_kind() == EK_MINIMAL) || - (TI_PLAIN_SEQUENCE_LARGE == type_id._d() && type_id.seq_ldefn().header().equiv_kind() == EK_MINIMAL) || - (TI_PLAIN_ARRAY_SMALL == type_id._d() && type_id.array_sdefn().header().equiv_kind() == EK_MINIMAL) || - (TI_PLAIN_ARRAY_LARGE == type_id._d() && type_id.array_ldefn().header().equiv_kind() == EK_MINIMAL) || - (TI_PLAIN_MAP_SMALL == type_id._d() && (type_id.map_sdefn().header().equiv_kind() == EK_MINIMAL || - type_id.map_sdefn().key_identifier()->_d() == EK_MINIMAL)) || - (TI_PLAIN_MAP_LARGE == type_id._d() && (type_id.map_ldefn().header().equiv_kind() == EK_MINIMAL || - type_id.map_ldefn().key_identifier()->_d() == EK_MINIMAL))) - { - std::lock_guard data_guard(type_object_registry_mutex_); - for (const auto& it : local_type_identifiers_) - { - if (it.second.type_identifier1() == type_id) - { - return it.second.type_identifier2(); - } - else if (it.second.type_identifier2() == type_id) - { - return it.second.type_identifier1(); - } - } - } - return type_id; -} - void TypeObjectRegistry::add_dependency( const TypeIdentifier& type_id, std::unordered_set& type_dependencies) diff --git a/test/blackbox/api/dds-pim/PubSubReader.hpp b/test/blackbox/api/dds-pim/PubSubReader.hpp index 6235dac568b..f7cda400981 100644 --- a/test/blackbox/api/dds-pim/PubSubReader.hpp +++ b/test/blackbox/api/dds-pim/PubSubReader.hpp @@ -117,7 +117,8 @@ class PubSubReader void on_data_writer_discovery( eprosima::fastdds::dds::DomainParticipant*, - eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { if (reader_.onEndpointDiscovery_ != nullptr) { diff --git a/test/blackbox/api/dds-pim/PubSubWriter.hpp b/test/blackbox/api/dds-pim/PubSubWriter.hpp index a93b8ec19b1..b46fa7e3387 100644 --- a/test/blackbox/api/dds-pim/PubSubWriter.hpp +++ b/test/blackbox/api/dds-pim/PubSubWriter.hpp @@ -122,7 +122,8 @@ class PubSubWriter void on_data_reader_discovery( eprosima::fastdds::dds::DomainParticipant*, - eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { if (info.status == eprosima::fastrtps::rtps::ReaderDiscoveryInfo::DISCOVERED_READER) { @@ -141,7 +142,8 @@ class PubSubWriter void on_data_writer_discovery( eprosima::fastdds::dds::DomainParticipant*, - eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { if (info.status == eprosima::fastrtps::rtps::WriterDiscoveryInfo::DISCOVERED_WRITER) { diff --git a/test/blackbox/api/dds-pim/PubSubWriterReader.hpp b/test/blackbox/api/dds-pim/PubSubWriterReader.hpp index 41d5863f421..1c986b8ef96 100644 --- a/test/blackbox/api/dds-pim/PubSubWriterReader.hpp +++ b/test/blackbox/api/dds-pim/PubSubWriterReader.hpp @@ -110,7 +110,8 @@ class PubSubWriterReader void on_data_reader_discovery( eprosima::fastdds::dds::DomainParticipant* participant, - eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { (void)participant; @@ -131,7 +132,8 @@ class PubSubWriterReader void on_data_writer_discovery( eprosima::fastdds::dds::DomainParticipant* participant, - eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { (void)participant; diff --git a/test/unittest/dds/publisher/DataWriterTests.cpp b/test/unittest/dds/publisher/DataWriterTests.cpp index 39f808c08c9..d260871a11f 100644 --- a/test/unittest/dds/publisher/DataWriterTests.cpp +++ b/test/unittest/dds/publisher/DataWriterTests.cpp @@ -374,7 +374,8 @@ TEST(DataWriterTests, get_guid) void on_data_writer_discovery( DomainParticipant*, - fastrtps::rtps::WriterDiscoveryInfo&& info) override + fastrtps::rtps::WriterDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { std::unique_lock lock(mutex); if (fastrtps::rtps::WriterDiscoveryInfo::DISCOVERED_WRITER == info.status) diff --git a/test/unittest/dds/subscriber/DataReaderTests.cpp b/test/unittest/dds/subscriber/DataReaderTests.cpp index 88be8740d10..d8d18ece4a3 100644 --- a/test/unittest/dds/subscriber/DataReaderTests.cpp +++ b/test/unittest/dds/subscriber/DataReaderTests.cpp @@ -583,7 +583,8 @@ TEST_F(DataReaderTests, get_guid) void on_data_reader_discovery( DomainParticipant*, - ReaderDiscoveryInfo&& info) override + ReaderDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { std::unique_lock lock(mutex); if (ReaderDiscoveryInfo::DISCOVERED_READER == info.status)