From 7559328e31a210a567dd08a25887337030abbcd0 Mon Sep 17 00:00:00 2001 From: Mario Dominguez Date: Fri, 18 Oct 2024 09:16:14 +0200 Subject: [PATCH] Refs #21808: Apply Ricardo's rev Signed-off-by: Mario Dominguez --- src/cpp/fastdds/publisher/DataWriterImpl.hpp | 16 ++++++++-------- src/cpp/fastdds/subscriber/DataReaderImpl.hpp | 14 +++++++------- src/cpp/rtps/participant/RTPSParticipantImpl.h | 8 ++++---- src/cpp/rtps/reader/StatefulReader.cpp | 2 +- src/cpp/rtps/reader/StatelessReader.cpp | 2 +- src/cpp/rtps/writer/StatefulWriter.cpp | 4 +++- src/cpp/rtps/writer/StatelessWriter.cpp | 3 ++- 7 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/cpp/fastdds/publisher/DataWriterImpl.hpp b/src/cpp/fastdds/publisher/DataWriterImpl.hpp index 346b80495ab..a4a3f29d369 100644 --- a/src/cpp/fastdds/publisher/DataWriterImpl.hpp +++ b/src/cpp/fastdds/publisher/DataWriterImpl.hpp @@ -382,12 +382,12 @@ class DataWriterImpl : protected rtps::IReaderDataFilter const char* filter_class_name); /** - * @brief Retrieves in a subscription associated with the DataWriter + * @brief Retrieves in a subscription associated with the @ref DataWriter * * @param[out] subscription_data subscription data struct - * @param subscription_handle InstanceHandle_t of the subscription - * @return RETCODE_BAD_PARAMETER if the DataWriter is not matched with - * the given subscription handle, RETCODE_OK otherwise. + * @param subscription_handle @ref InstanceHandle_t of the subscription + * @return @ref RETCODE_BAD_PARAMETER if the DataWriter is not matched with + * the given subscription handle, @ref RETCODE_OK otherwise. * */ ReturnCode_t get_matched_subscription_data( @@ -395,12 +395,12 @@ class DataWriterImpl : protected rtps::IReaderDataFilter const InstanceHandle_t& subscription_handle) const; /** - * @brief Fills the given vector with the InstanceHandle_t of matched DataReaders + * @brief Fills the given vector with the @ref InstanceHandle_t of matched DataReaders * - * @param[out] subscription_handles Vector where the InstanceHandle_t are returned - * @return RETCODE_OK if the operation succeeds. + * @param[out] subscription_handles Vector where the @ref InstanceHandle_t are returned + * @return @ref RETCODE_OK if the operation succeeds. * - * @note Returning an empty list is not an error, it returns RETCODE_OK. + * @note Returning an empty list is not an error, it returns @ref RETCODE_OK. * */ ReturnCode_t get_matched_subscriptions( diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl.hpp b/src/cpp/fastdds/subscriber/DataReaderImpl.hpp index fba4ad91e09..1bc28dbbe26 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl.hpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl.hpp @@ -238,9 +238,9 @@ class DataReaderImpl * @brief Retrieves in a publication associated with the DataWriter * * @param[out] publication_data publication data struct - * @param publication_handle InstanceHandle_t of the publication - * @return RETCODE_BAD_PARAMETER if the DataReader is not matched with - * the given publication handle, RETCODE_OK otherwise. + * @param publication_handle @ref InstanceHandle_t of the publication + * @return @ref RETCODE_BAD_PARAMETER if the DataReader is not matched with + * the given publication handle, @ref RETCODE_OK otherwise. * */ ReturnCode_t get_matched_publication_data( @@ -248,12 +248,12 @@ class DataReaderImpl const InstanceHandle_t& publication_handle) const; /** - * @brief Fills the given vector with the InstanceHandle_t of matched DataReaders + * @brief Fills the given vector with the @ref InstanceHandle_t of matched DataReaders * - * @param[out] publication_handles Vector where the InstanceHandle_t are returned - * @return RETCODE_OK if the operation succeeds. + * @param[out] publication_handles Vector where the @ref InstanceHandle_t are returned + * @return @ref RETCODE_OK if the operation succeeds. * - * @note Returning an empty list is not an error, it returns RETCODE_OK. + * @note Returning an empty list is not an error, it returns @ref RETCODE_OK. * */ ReturnCode_t get_matched_publications( diff --git a/src/cpp/rtps/participant/RTPSParticipantImpl.h b/src/cpp/rtps/participant/RTPSParticipantImpl.h index 37310c75b7e..e79c0a947fc 100644 --- a/src/cpp/rtps/participant/RTPSParticipantImpl.h +++ b/src/cpp/rtps/participant/RTPSParticipantImpl.h @@ -1121,10 +1121,10 @@ class RTPSParticipantImpl std::vector get_netmask_filter_info() const; /** - * @brief Fills the provided PublicationBuiltinTopicData with the information of the + * @brief Fills the provided @ref PublicationBuiltinTopicData with the information of the * writer identified by writer_guid. * - * @param[out] data PublicationBuiltinTopicData to fill. + * @param[out] data @ref PublicationBuiltinTopicData to fill. * @param[in] writer_guid GUID of the writer to get the information from. * @return True if the writer was found and the data was filled. */ @@ -1133,10 +1133,10 @@ class RTPSParticipantImpl const GUID_t& writer_guid) const; /** - * @brief Fills the provided SubscriptionBuiltinTopicData with the information of the + * @brief Fills the provided @ref SubscriptionBuiltinTopicData with the information of the * reader identified by reader_guid. * - * @param[out] data SubscriptionBuiltinTopicData to fill. + * @param[out] data @ref SubscriptionBuiltinTopicData to fill. * @param[in] reader_guid GUID of the reader to get the information from. * @return True if the reader was found and the data was filled. */ diff --git a/src/cpp/rtps/reader/StatefulReader.cpp b/src/cpp/rtps/reader/StatefulReader.cpp index 403bf5b6bec..cf7a201da7b 100644 --- a/src/cpp/rtps/reader/StatefulReader.cpp +++ b/src/cpp/rtps/reader/StatefulReader.cpp @@ -1500,7 +1500,7 @@ bool StatefulReader::matched_writers_guids( guids.reserve(matched_writers_.size()); for (WriterProxy* writer : matched_writers_) { - guids.push_back(writer->guid()); + guids.emplace_back(writer->guid()); } return true; } diff --git a/src/cpp/rtps/reader/StatelessReader.cpp b/src/cpp/rtps/reader/StatelessReader.cpp index bc23381222c..91b5bd0ad33 100644 --- a/src/cpp/rtps/reader/StatelessReader.cpp +++ b/src/cpp/rtps/reader/StatelessReader.cpp @@ -529,7 +529,7 @@ bool StatelessReader::matched_writers_guids( guids.reserve(matched_writers_.size()); for (const RemoteWriterInfo_t& writer : matched_writers_) { - guids.push_back(writer.guid); + guids.emplace_back(writer.guid); } return true; } diff --git a/src/cpp/rtps/writer/StatefulWriter.cpp b/src/cpp/rtps/writer/StatefulWriter.cpp index 058536f5e14..a8c8881a774 100644 --- a/src/cpp/rtps/writer/StatefulWriter.cpp +++ b/src/cpp/rtps/writer/StatefulWriter.cpp @@ -1609,10 +1609,12 @@ bool StatefulWriter::matched_readers_guids( { std::lock_guard guard(mp_mutex); guids.clear(); + guids.reserve(guids.size() + matched_local_readers_.size() + matched_datasharing_readers_.size() + + matched_remote_readers_.size()); for_matched_readers(matched_local_readers_, matched_datasharing_readers_, matched_remote_readers_, [&guids](const ReaderProxy* reader) { - guids.push_back(reader->guid()); + guids.emplace_back(reader->guid()); return false; } ); diff --git a/src/cpp/rtps/writer/StatelessWriter.cpp b/src/cpp/rtps/writer/StatelessWriter.cpp index 3412f53a390..be63703897f 100644 --- a/src/cpp/rtps/writer/StatelessWriter.cpp +++ b/src/cpp/rtps/writer/StatelessWriter.cpp @@ -403,10 +403,11 @@ bool StatelessWriter::matched_readers_guids( { std::lock_guard guard(mp_mutex); guids.clear(); + guids.reserve(matched_local_readers_.size() + matched_datasharing_readers_.size() + matched_remote_readers_.size()); for_matched_readers(matched_local_readers_, matched_datasharing_readers_, matched_remote_readers_, [&guids](const ReaderLocator& reader) { - guids.push_back(reader.remote_guid()); + guids.emplace_back(reader.remote_guid()); return false; } );