-
Notifications
You must be signed in to change notification settings - Fork 515
Add acceptable_buffer_backends field in SubscriptionOptionsBase #3098
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
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 |
|---|---|---|
|
|
@@ -89,6 +89,15 @@ struct SubscriptionOptionsBase | |
| QosOverridingOptions qos_overriding_options; | ||
|
|
||
| ContentFilterOptions content_filter_options; | ||
|
|
||
| /// Acceptable buffer backend names for this subscription. | ||
| /** | ||
| * Empty string or "cpu" means CPU-only (default for backward compatibility). | ||
| * "any" means all installed backends are acceptable. | ||
| * Comma-separated for specific backends, e.g. "cuda,demo". | ||
| * CPU is always implicitly acceptable regardless of this value. | ||
| */ | ||
| std::string acceptable_buffer_backends{"cpu"}; | ||
| }; | ||
|
|
||
| /// Structure containing optional configuration for Subscriptions. | ||
|
|
@@ -145,6 +154,11 @@ struct SubscriptionOptionsWithAllocator : public SubscriptionOptionsBase | |
| } | ||
| } | ||
|
|
||
| if (!acceptable_buffer_backends.empty()) { | ||
| result.rmw_subscription_options.acceptable_buffer_backends = | ||
| acceptable_buffer_backends.c_str(); | ||
| } | ||
|
Comment on lines
+157
to
+160
Contributor
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. @nvcyc hmm, this implicitly ties the lifetimes of both
Member
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. Agree, I think that we need to allocate a new string and copy over here. Look at |
||
|
|
||
| return result; | ||
| } | ||
|
|
||
|
|
||
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.
@nvcyc nit: why the trailing underscore?