-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[21808] DataWriter/Reader get_matched_publication/subscription()
Tests & Feature 3.x
#5312
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also pending a PR to Python bindings.
* @brief Retrieves in a subscription associated with the DataWriter | ||
* | ||
* @param[out] subscription_data subscription data struct | ||
* @param subscription_handle InstanceHandle_t of the subscription |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param subscription_handle InstanceHandle_t of the subscription | |
* @param subscription_handle @ref InstanceHandle_t of the subscription |
* | ||
* @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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @return RETCODE_BAD_PARAMETER if the DataWriter is not matched with | |
* @return @ref RETCODE_BAD_PARAMETER if the DataWriter is not matched with |
* @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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* the given subscription handle, RETCODE_OK otherwise. | |
* the given subscription handle, @ref RETCODE_OK otherwise. |
* @brief Fills the given vector with the InstanceHandle_t of matched DataReaders | ||
* | ||
* @param[out] subscription_handles Vector where the InstanceHandle_t are returned | ||
* @return RETCODE_OK if the operation succeeds. | ||
* | ||
* @note Returning an empty list is not an error, it returns RETCODE_OK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @brief Fills the given vector with the InstanceHandle_t of matched DataReaders | |
* | |
* @param[out] subscription_handles Vector where the InstanceHandle_t are returned | |
* @return RETCODE_OK if the operation succeeds. | |
* | |
* @note Returning an empty list is not an error, it returns RETCODE_OK. | |
* @brief Fills the given vector with the @ref InstanceHandle_t of matched DataReaders | |
* | |
* @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 @ref RETCODE_OK. |
* @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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @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. |
guids.reserve(matched_writers_.size()); | ||
for (const RemoteWriterInfo_t& writer : matched_writers_) | ||
{ | ||
guids.push_back(writer.guid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guids.push_back(writer.guid); | |
guids.emplace_back(writer.guid); |
for_matched_readers(matched_local_readers_, matched_datasharing_readers_, matched_remote_readers_, | ||
[&guids](const ReaderProxy* reader) | ||
{ | ||
guids.push_back(reader->guid()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guids.push_back(reader->guid()); | |
guids.emplace_back(reader->guid()); |
std::vector<GUID_t>& guids) const | ||
{ | ||
std::lock_guard<RecursiveTimedMutex> guard(mp_mutex); | ||
guids.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can reserve the space like in other methods
for_matched_readers(matched_local_readers_, matched_datasharing_readers_, matched_remote_readers_, | ||
[&guids](const ReaderLocator& reader) | ||
{ | ||
guids.push_back(reader.remote_guid()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guids.push_back(reader.remote_guid()); | |
guids.emplace_back(reader.remote_guid()); |
std::vector<GUID_t>& guids) const | ||
{ | ||
std::lock_guard<RecursiveTimedMutex> guard(mp_mutex); | ||
guids.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can reserve previously like in other methods
… Test implementation 3.x Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
… Feature implementation 3.x Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
23914aa
to
7559328
Compare
Description
This PR is a forward port of #5284, implementing the following APIs
DDS
DataWriter::get_matched_subscriptions()
DataWriter::get_matched_subscription_data()
DataReader::get_matched_publications()
DataReader::get_matched_publication_data()
RTPS
RTPSParticipant::get_publication_info()
RTPSParticipant::get_subscription_info()
RTPSReader::matched_writers_guids()
RTPSWriter::matched_readers_guids()
In the
3.x
series.Related PRs:
get_matched_publication/subscription...()
(2.x) API tests Fast-DDS-python#188Contributor Checklist
versions.md
file (if applicable).Reviewer Checklist