-
Notifications
You must be signed in to change notification settings - Fork 67
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
add rmw_get_default_xxx to return the structure with default values. #379
base: rolling
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,12 @@ RMW_WARN_UNUSED | |
rmw_context_t | ||
rmw_get_zero_initialized_context(void); | ||
|
||
/// Return a default context structure. | ||
RMW_PUBLIC | ||
RMW_WARN_UNUSED | ||
rmw_context_t | ||
rmw_get_default_context(void); | ||
Comment on lines
+58
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here; all places we call |
||
|
||
/// Initialize the middleware with the given options, and yielding an context. | ||
/** | ||
* Context is filled with middleware specific data upon success of this function. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,12 @@ RMW_WARN_UNUSED | |
rmw_init_options_t | ||
rmw_get_zero_initialized_init_options(void); | ||
|
||
/// Return a default init options structure. | ||
RMW_PUBLIC | ||
RMW_WARN_UNUSED | ||
rmw_init_options_t | ||
rmw_get_default_init_options(void); | ||
|
||
Comment on lines
+74
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And the same here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @clalancette i take this case as an example.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I definitely think that But my main point is that all callers of
Thus, it doesn't seem like the new APIs are necessary, as we already have all of the functionality we need here. To maybe ask this in a different way: in what situations are you expecting that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
👍
ah, i see now. i was thinking i can check the related APIs to make sure, and adjust the PR accordingly. thanks! |
||
/// Initialize given init options with the default values and implementation specific values. | ||
/** | ||
* The given allocator is used, if required, during setup of the init options, | ||
|
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.
For instance, I don't believe we need this. In all "real" situations (not tests) where
rmw_get_zero_initialized_event
is called, it is immediately followed by eitherrmw_subscription_event_init
orrmw_publisher_event_init
. Because of that, I don't believe we need to add this API at all (though if we changermw_get_zero_initialized_event
to truly return all zeros, we may have to fix a couple of tests).