Skip to content

Commit

Permalink
update signature for added pub/sub options (#329)
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodall <william@osrfoundation.org>
  • Loading branch information
wjwwood authored Oct 8, 2019
1 parent 0020b0f commit a1becb3
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 9 deletions.
14 changes: 12 additions & 2 deletions rmw_fastrtps_cpp/src/rmw_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ 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 char * topic_name,
const rmw_qos_profile_t * qos_policies,
const rmw_publisher_options_t * publisher_options)
{
if (!node) {
RMW_SET_ERROR_MSG("node handle is null");
Expand All @@ -80,7 +82,12 @@ rmw_create_publisher(
}

if (!qos_policies) {
RMW_SET_ERROR_MSG("qos_profile is null");
RMW_SET_ERROR_MSG("qos_policies is null");
return nullptr;
}

if (!publisher_options) {
RMW_SET_ERROR_MSG("publisher_options is null");
return nullptr;
}

Expand Down Expand Up @@ -205,6 +212,9 @@ rmw_create_publisher(
}

memcpy(const_cast<char *>(rmw_publisher->topic_name), topic_name, strlen(topic_name) + 1);

rmw_publisher->options = *publisher_options;

return rmw_publisher;

fail:
Expand Down
8 changes: 6 additions & 2 deletions rmw_fastrtps_cpp/src/rmw_subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ 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 char * topic_name,
const rmw_qos_profile_t * qos_policies,
const rmw_subscription_options_t * subscription_options)
{
if (!node) {
RMW_SET_ERROR_MSG("node handle is null");
Expand Down Expand Up @@ -115,7 +117,6 @@ rmw_create_subscription(
return nullptr;
}

(void)ignore_local_publications;
CustomSubscriberInfo * info = nullptr;
rmw_subscription_t * rmw_subscription = nullptr;
eprosima::fastrtps::SubscriberAttributes subscriberParam;
Expand Down Expand Up @@ -186,6 +187,9 @@ rmw_create_subscription(
}

memcpy(const_cast<char *>(rmw_subscription->topic_name), topic_name, strlen(topic_name) + 1);

rmw_subscription->options = *subscription_options;

return rmw_subscription;

fail:
Expand Down
14 changes: 12 additions & 2 deletions rmw_fastrtps_dynamic_cpp/src/rmw_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ 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 char * topic_name,
const rmw_qos_profile_t * qos_policies,
const rmw_publisher_options_t * publisher_options)
{
if (!node) {
RMW_SET_ERROR_MSG("node handle is null");
Expand All @@ -80,7 +82,12 @@ rmw_create_publisher(
}

if (!qos_policies) {
RMW_SET_ERROR_MSG("qos_profile is null");
RMW_SET_ERROR_MSG("qos_policies is null");
return nullptr;
}

if (!publisher_options) {
RMW_SET_ERROR_MSG("publisher_options is null");
return nullptr;
}

Expand Down Expand Up @@ -201,6 +208,9 @@ rmw_create_publisher(
}

memcpy(const_cast<char *>(rmw_publisher->topic_name), topic_name, strlen(topic_name) + 1);

rmw_publisher->options = *publisher_options;

return rmw_publisher;

fail:
Expand Down
15 changes: 12 additions & 3 deletions rmw_fastrtps_dynamic_cpp/src/rmw_subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ 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 char * topic_name,
const rmw_qos_profile_t * qos_policies,
const rmw_subscription_options_t * subscription_options)
{
if (!node) {
RMW_SET_ERROR_MSG("node handle is null");
Expand All @@ -84,7 +86,12 @@ rmw_create_subscription(
}

if (!qos_policies) {
RMW_SET_ERROR_MSG("qos_profile is null");
RMW_SET_ERROR_MSG("qos_policies is null");
return nullptr;
}

if (!subscription_options) {
RMW_SET_ERROR_MSG("subscription_options is null");
return nullptr;
}

Expand Down Expand Up @@ -115,7 +122,6 @@ rmw_create_subscription(
return nullptr;
}

(void)ignore_local_publications;
CustomSubscriberInfo * info = nullptr;
rmw_subscription_t * rmw_subscription = nullptr;
eprosima::fastrtps::SubscriberAttributes subscriberParam;
Expand Down Expand Up @@ -182,6 +188,9 @@ rmw_create_subscription(
}

memcpy(const_cast<char *>(rmw_subscription->topic_name), topic_name, strlen(topic_name) + 1);

rmw_subscription->options = *subscription_options;

return rmw_subscription;

fail:
Expand Down

0 comments on commit a1becb3

Please sign in to comment.