-
Notifications
You must be signed in to change notification settings - Fork 76
Update node creation/destruction API documentation. #249
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fd3fd5a
Update node creation/destruction API documentation.
hidmic bef9236
Address peer review comments.
hidmic 6317019
Address more peer review comments.
hidmic cd485f4
Cannot use namespace as argument name.
hidmic d9930ed
Clarify rmw_destroy_node() side effects.
hidmic 79648b3
Address last peer review comment.
hidmic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -133,24 +133,15 @@ rmw_get_serialization_format(void); | |||||
| /// Create a node and return a handle to that node. | ||||||
| /** | ||||||
| * This function can fail, and therefore return `NULL`, if: | ||||||
| * - context, name, namespace_, or security_options is `NULL` | ||||||
| * - context, security_options is invalid | ||||||
| * - name is not a valid non-null node name | ||||||
| * - namespace_ is not a valid non-null namespace | ||||||
| * - context is not valid i.e. it is zero-initialized, or | ||||||
| * its implementation identifier does not match that of | ||||||
| * this API implementation, or has been invalidated by | ||||||
| * `rmw_shutdown()` | ||||||
| * - memory allocation fails during node creation | ||||||
| * - an unspecified error occurs | ||||||
| * | ||||||
| * The context must be non-null and valid, i.e. it has been initialized | ||||||
| * by `rmw_init()` and has not been finalized by `rmw_shutdown()`. | ||||||
| * | ||||||
| * The name and namespace_ should be valid node name and namespace, | ||||||
| * and this should be asserted by the caller (e.g. `rcl`). | ||||||
| * | ||||||
| * The domain ID should be used to physically separate nodes at the | ||||||
| * communication graph level by the middleware. | ||||||
| * For RTPS/DDS this maps naturally to their concept of domain id. | ||||||
| * | ||||||
| * The security options should always be non-null and encapsulate the | ||||||
| * essential security configurations for the node and its entities. | ||||||
| * | ||||||
| * <hr> | ||||||
| * Attribute | Adherence | ||||||
| * ------------------ | ------------- | ||||||
|
|
@@ -165,11 +156,7 @@ rmw_get_serialization_format(void); | |||||
| * \param[in] context init context that this node should be associated with | ||||||
| * \param[in] name the node name | ||||||
| * \param[in] namespace_ the node namespace | ||||||
| * \param[in] domain_id the id of the domain that the node should join | ||||||
| * \param[in] security_options the security configurations for the node | ||||||
| * \param[in] localhost_only whenever to use loopback only for communication or default | ||||||
| * network interfaces. | ||||||
| * \return rmw node handle or `NULL` if there was an error | ||||||
| * \return rmw node handle, or `NULL` if there was an error | ||||||
| */ | ||||||
| RMW_PUBLIC | ||||||
| RMW_WARN_UNUSED | ||||||
|
|
@@ -181,15 +168,22 @@ rmw_create_node( | |||||
|
|
||||||
| /// Finalize a given node handle, reclaim the resources, and deallocate the node handle. | ||||||
| /** | ||||||
| * The method may assume - but should verify - that all publishers, subscribers, | ||||||
| * services, and clients created from this node have already been destroyed. | ||||||
| * If the rmw implementation chooses to verify instead of assume, it should | ||||||
| * return `RMW_RET_ERROR` and set a human readable error message if any entity | ||||||
| * created from this node has not yet been destroyed. | ||||||
| * This function will return early if a logical error, such as `RMW_RET_INVALID_ARGUMENT` | ||||||
| * or `RMW_RET_INCORRECT_RMW_IMPLEMENTATION`, ensues, leaving the given node handle unchanged. | ||||||
| * Otherwise, it will proceed despite errors, freeing as much resources as it can, including | ||||||
|
||||||
| * Otherwise, it will proceed despite errors, freeing as much resources as it can, including | |
| * Otherwise, it will proceed despite errors, freeing as many resources as it can, including |
Contributor
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 in 79648b3.
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.
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.
I know you didn't change this, but I find it odd that
namespace_has a trailing underscore. What do you think about changing that (and updating the documentation to match)?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.
True. See 42bb43b.
Uh oh!
There was an error while loading. Please reload this page.
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.
Spoke too soon, 2442051.
Even though it's an argument name and it is within an external C linkage block, the compiler barfs at
namespace.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.
In
rclwe are usingnode_namespaceto avoid that problem, which looks a bit nicer that the trailing underscore.That change sounds a bit unrelated to the PR though.
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.
It's slightly redundant though.