diff --git a/include/fastdds/dds/publisher/DataWriter.hpp b/include/fastdds/dds/publisher/DataWriter.hpp index 1762167688a..3fb860e52da 100644 --- a/include/fastdds/dds/publisher/DataWriter.hpp +++ b/include/fastdds/dds/publisher/DataWriter.hpp @@ -536,12 +536,13 @@ class DataWriter : public DomainEntity */ RTPS_DllAPI ReturnCode_t get_matched_subscriptions( std::vector& subscription_handles) const; - /** - * @note User is responsible for the memory deallocation of the returned vector. - */ + #ifndef DOXYGEN_SHOULD_SKIP_THIS FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds:DataWriter::get_matched_subscriptions()", "In favor of version using std::vector.") + /** + * @note User is responsible for the memory deallocation of the returned vector. + */ RTPS_DllAPI ReturnCode_t get_matched_subscriptions( std::vector& subscription_handles) const; #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/cpp/fastdds/publisher/DataWriterImpl.cpp b/src/cpp/fastdds/publisher/DataWriterImpl.cpp index 6ef889aa998..98280e21b98 100644 --- a/src/cpp/fastdds/publisher/DataWriterImpl.cpp +++ b/src/cpp/fastdds/publisher/DataWriterImpl.cpp @@ -2262,7 +2262,7 @@ ReturnCode_t DataWriterImpl::get_matched_subscriptions( { for (const GUID_t& guid : matched_reader_guids) { - subscription_handles.push_back(InstanceHandle_t(guid)); + subscription_handles.emplace_back(InstanceHandle_t(guid)); } ret = ReturnCode_t::RETCODE_OK; } diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl.cpp b/src/cpp/fastdds/subscriber/DataReaderImpl.cpp index a25372be63d..80d87a259d6 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl.cpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl.cpp @@ -1232,7 +1232,7 @@ ReturnCode_t DataReaderImpl::get_matched_publications( { for (const GUID_t& guid : matched_writers_guids) { - publication_handles.push_back(InstanceHandle_t(guid)); + publication_handles.emplace_back(InstanceHandle_t(guid)); } ret = ReturnCode_t::RETCODE_OK; } diff --git a/test/mock/rtps/RTPSReader/fastdds/rtps/reader/RTPSReader.h b/test/mock/rtps/RTPSReader/fastdds/rtps/reader/RTPSReader.h index 03959fdbb18..9338c8237ea 100644 --- a/test/mock/rtps/RTPSReader/fastdds/rtps/reader/RTPSReader.h +++ b/test/mock/rtps/RTPSReader/fastdds/rtps/reader/RTPSReader.h @@ -180,7 +180,7 @@ class RTPSReader : public Endpoint virtual bool matched_writers_guids( std::vector&) const { - return true; + return false; } virtual bool isInCleanState()