From 355ed92ac5685dd7f597e5ed2446c789e988735d Mon Sep 17 00:00:00 2001 From: Chen Lihui Date: Wed, 2 Dec 2020 15:13:14 +0800 Subject: [PATCH 1/2] Add content filter topic feature empty stub Signed-off-by: Chen Lihui --- rmw_connext_cpp/src/rmw_subscription.cpp | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/rmw_connext_cpp/src/rmw_subscription.cpp b/rmw_connext_cpp/src/rmw_subscription.cpp index a6b656dc..b3b7c2dc 100644 --- a/rmw_connext_cpp/src/rmw_subscription.cpp +++ b/rmw_connext_cpp/src/rmw_subscription.cpp @@ -392,6 +392,34 @@ rmw_subscription_get_actual_qos( return RMW_RET_OK; } +rmw_ret_t +rmw_subscription_set_cft_expression_parameters( + const rmw_subscription_t * subscription, + const char * filter_expression, + const rcutils_string_array_t * expression_parameters) +{ + // Unused in current implementation. + (void) subscription; + (void) filter_expression; + (void) expression_parameters; + RMW_SET_ERROR_MSG("unimplemented"); + return RMW_RET_UNSUPPORTED; +} + +rmw_ret_t +rmw_subscription_get_cft_expression_parameters( + const rmw_subscription_t * subscription, + char ** filter_expression, + rcutils_string_array_t * expression_parameters) +{ + // Unused in current implementation. + (void) subscription; + (void) filter_expression; + (void) expression_parameters; + RMW_SET_ERROR_MSG("unimplemented"); + return RMW_RET_UNSUPPORTED; +} + rmw_ret_t rmw_destroy_subscription(rmw_node_t * node, rmw_subscription_t * subscription) { From ee73588715594c36f2f8c4d2253b0ff76ed53bef Mon Sep 17 00:00:00 2001 From: Chen Lihui Date: Fri, 12 Mar 2021 13:05:35 +0800 Subject: [PATCH 2/2] to support reset content filtered topic with empty string. remove constness for rmw_subscription because is_cft_supported might be updated Signed-off-by: Chen Lihui --- rmw_connext_cpp/src/rmw_subscription.cpp | 3 ++- rmw_connext_dynamic_cpp/src/functions.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rmw_connext_cpp/src/rmw_subscription.cpp b/rmw_connext_cpp/src/rmw_subscription.cpp index b3b7c2dc..2a66f4b3 100644 --- a/rmw_connext_cpp/src/rmw_subscription.cpp +++ b/rmw_connext_cpp/src/rmw_subscription.cpp @@ -269,6 +269,7 @@ rmw_create_subscription( #endif subscription->can_loan_messages = false; + subscription->is_cft_supported = false; return subscription; fail: if (topic_str) { @@ -394,7 +395,7 @@ rmw_subscription_get_actual_qos( rmw_ret_t rmw_subscription_set_cft_expression_parameters( - const rmw_subscription_t * subscription, + rmw_subscription_t * subscription, const char * filter_expression, const rcutils_string_array_t * expression_parameters) { diff --git a/rmw_connext_dynamic_cpp/src/functions.cpp b/rmw_connext_dynamic_cpp/src/functions.cpp index fad7787b..a5630927 100644 --- a/rmw_connext_dynamic_cpp/src/functions.cpp +++ b/rmw_connext_dynamic_cpp/src/functions.cpp @@ -1182,6 +1182,7 @@ rmw_create_subscription( node_info->subscriber_listener->trigger_graph_guard_condition(); subscription->can_loan_messages = false; + subscription->is_cft_supported = false; return subscription; fail: // Something has gone wrong, unroll what has been done.