This repository was archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Implement get_actual_qos() for subscriptions #358
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Miaofei <[email protected]>
ivanpauno
reviewed
Jun 7, 2019
Member
ivanpauno
left a comment
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.
Similar comment about avoiding duplicated code that here.
| return RMW_RET_ERROR; | ||
| } | ||
|
|
||
| if (!data_reader) { |
Member
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.
Why is this check needed? I think the one in L382 is enough. I know that the same was done in:
rmw_connext/rmw_connext_cpp/src/rmw_publisher.cpp
Lines 377 to 393 in 8e9e088
| DDS::DataWriter * data_writer = info->topic_writer_; | |
| if (!data_writer) { | |
| RMW_SET_ERROR_MSG("publisher internal data writer is invalid"); | |
| return RMW_RET_ERROR; | |
| } | |
| DDS::DataWriterQos dds_qos; | |
| DDS::ReturnCode_t status = data_writer->get_qos(dds_qos); | |
| if (DDS::RETCODE_OK != status) { | |
| RMW_SET_ERROR_MSG("publisher can't get data writer qos policies"); | |
| return RMW_RET_ERROR; | |
| } | |
| if (!data_writer) { | |
| RMW_SET_ERROR_MSG("publisher internal dds publisher is invalid"); | |
| return RMW_RET_ERROR; | |
| } | |
But I don't think it has sense. If you agree, delete the duplicated check in the publisher function too
Member
Author
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.
Done.
Signed-off-by: Miaofei <[email protected]>
Member
Author
|
Refactored to avoid duplicate code. Thanks! |
ivanpauno
approved these changes
Jun 10, 2019
Signed-off-by: Miaofei <[email protected]>
ivanpauno
approved these changes
Jun 12, 2019
Member
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, publishers have the get_actual_qos() feature/function. It would make sense for subscriptions to have them, too.