Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions rclcpp/include/rclcpp/subscription_options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -145,6 +154,16 @@ struct SubscriptionOptionsWithAllocator : public SubscriptionOptionsBase
}
}

if (!acceptable_buffer_backends.empty()) {
rcl_ret_t ret = rcl_subscription_options_set_acceptable_buffer_backends(
acceptable_buffer_backends.c_str(),
&result);
if (RCL_RET_OK != ret) {
rclcpp::exceptions::throw_from_rcl_error(
ret, "failed to set acceptable_buffer_backends");
}
}

return result;
}

Expand Down