Skip to content
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

Update gid API documentation. #274

Merged
merged 3 commits into from
Sep 22, 2020
Merged

Update gid API documentation. #274

merged 3 commits into from
Sep 22, 2020

Conversation

hidmic
Copy link
Contributor

@hidmic hidmic commented Sep 21, 2020

Namely, rmw_get_gid_for_publisher() and rmw_compare_gids_equal().

Namely, rmw_get_gid_for_publisher() and rmw_compare_gids_equal().

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nits to fix, nothing major.

@@ -2081,23 +2081,69 @@ rmw_count_subscribers(
const char * topic_name,
size_t * count);

/// Get the unique identifier of the publisher
/// Get the unique identifier or gid of a publisher.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Get the unique identifier or gid of a publisher.
/// Get the unique identifier (gid) of a publisher.

(is that what is meant here?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeap, yeap. See 8899558.

* Publishers are thread-safe objects, and so are all operations on them except for
* finalization.
* Therefore, it is safe to get the unique identifier from the same publisher concurrently.
* However, Access to the gid is not synchronized.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* However, Access to the gid is not synchronized.
* However, access to the gid is not synchronized.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 8899558.

* \param[in] publisher Publisher to be get a gid from.
* \param[out] gid Publisher's unique identifier, populated on success
* but left unchanged on failure.
* \return `RMW_RET_OK` if successful, o
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* \return `RMW_RET_OK` if successful, o
* \return `RMW_RET_OK` if successful, or

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, I clearly did this in rush. See 8899558.

* \param[in] gid1 First unique identifier to compare.
* \param[in] gid2 Second unique identifier to compare.
* \param[out] bool true if both gids are equal, false otherwise.
* \return `RMW_RET_OK` if successful,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* \return `RMW_RET_OK` if successful,
* \return `RMW_RET_OK` if successful, or

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 8899558.

Comment on lines 2144 to 2145
* \return `RMW_RET_INCORRECT_RMW_IMPLEMENTATION` if `gid1`'s' or `gid2`'s' implementation
* identifier does the match this implementation, or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* \return `RMW_RET_INCORRECT_RMW_IMPLEMENTATION` if `gid1`'s' or `gid2`'s' implementation
* identifier does the match this implementation, or
* \return `RMW_RET_INCORRECT_RMW_IMPLEMENTATION` if the implementation identifier of
* `gid1` or `gid2` does not match this implementation, or

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 8899558.

*/
RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
rmw_get_gid_for_publisher(const rmw_publisher_t * publisher, rmw_gid_t * gid);

/// Check if two gid objects are the same
/// Check if two unique identifiers or gids are equal.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Check if two unique identifiers or gids are equal.
/// Check if two unique identifiers (gids) are equal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 8899558.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more nit, approving anyway.

*
* \pre Given `publisher` must be a valid subscription, as returned by rmw_create_publisher().
*
* \param[in] publisher Publisher to be get a gid from.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* \param[in] publisher Publisher to be get a gid from.
* \param[in] publisher Publisher to get a gid from.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in a680b34.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic merged commit f48ebcf into master Sep 22, 2020
@delete-merged-branch delete-merged-branch bot deleted the hidmic/update-gid-api-docs branch September 22, 2020 15:32
@hidmic hidmic restored the hidmic/update-gid-api-docs branch September 22, 2020 20:07
ahcorde pushed a commit that referenced this pull request Oct 13, 2020
Namely, rmw_get_gid_for_publisher() and rmw_compare_gids_equal().

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
ahcorde pushed a commit that referenced this pull request Oct 13, 2020
Namely, rmw_get_gid_for_publisher() and rmw_compare_gids_equal().

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@wjwwood wjwwood deleted the hidmic/update-gid-api-docs branch April 22, 2021 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants