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 signature for added pub/sub options #46

Closed
wants to merge 1 commit into from
Closed
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
10 changes: 7 additions & 3 deletions rmw_cyclonedds_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1088,10 +1088,11 @@ extern "C" rmw_ret_t rmw_fini_publisher_allocation(rmw_publisher_allocation_t *
extern "C" rmw_publisher_t * rmw_create_publisher(
const rmw_node_t * node,
const rosidl_message_type_support_t * type_supports, const char * topic_name,
const rmw_qos_profile_t * qos_policies)
const rmw_qos_profile_t * qos_policies, const rmw_publisher_options_t * publisher_options)
{
CddsPublisher * pub;
rmw_publisher_t * rmw_publisher;
RET_NULL_X(publisher_options, return nullptr);
if ((pub = create_cdds_publisher(node, type_supports, topic_name, qos_policies)) == nullptr) {
goto fail_common_init;
}
Expand All @@ -1102,6 +1103,7 @@ extern "C" rmw_publisher_t * rmw_create_publisher(
rmw_publisher->topic_name = reinterpret_cast<char *>(rmw_allocate(strlen(topic_name) + 1));
RET_ALLOC_X(rmw_publisher->topic_name, goto fail_topic_name);
memcpy(const_cast<char *>(rmw_publisher->topic_name), topic_name, strlen(topic_name) + 1);
rmw_publisher->options = *publisher_options;
return rmw_publisher;
fail_topic_name:
rmw_publisher_free(rmw_publisher);
Expand Down Expand Up @@ -1273,13 +1275,14 @@ extern "C" rmw_ret_t rmw_fini_subscription_allocation(rmw_subscription_allocatio
extern "C" rmw_subscription_t * rmw_create_subscription(
const rmw_node_t * node,
const rosidl_message_type_support_t * type_supports, const char * topic_name,
const rmw_qos_profile_t * qos_policies, bool ignore_local_publications)
const rmw_qos_profile_t * qos_policies, const rmw_subscription_options_t * subscription_options)
{
CddsSubscription * sub;
rmw_subscription_t * rmw_subscription;
RET_NULL_X(subscription_options, return nullptr);
if ((sub =
create_cdds_subscription(node, type_supports, topic_name, qos_policies,
ignore_local_publications)) == nullptr)
subscription_options->ignore_local_publications)) == nullptr)
{
goto fail_common_init;
}
Expand All @@ -1291,6 +1294,7 @@ extern "C" rmw_subscription_t * rmw_create_subscription(
reinterpret_cast<const char *>(rmw_allocate(strlen(topic_name) + 1));
RET_ALLOC_X(rmw_subscription->topic_name, goto fail_topic_name);
memcpy(const_cast<char *>(rmw_subscription->topic_name), topic_name, strlen(topic_name) + 1);
rmw_subscription->options = *subscription_options;
return rmw_subscription;
fail_topic_name:
rmw_subscription_free(rmw_subscription);
Expand Down