diff --git a/rmw_fastrtps_cpp/src/rmw_publish.cpp b/rmw_fastrtps_cpp/src/rmw_publish.cpp index 006197397..f51354ced 100644 --- a/rmw_fastrtps_cpp/src/rmw_publish.cpp +++ b/rmw_fastrtps_cpp/src/rmw_publish.cpp @@ -44,4 +44,18 @@ rmw_publish_serialized_message( return rmw_fastrtps_shared_cpp::__rmw_publish_serialized_message( eprosima_fastrtps_identifier, publisher, serialized_message, allocation); } + +rmw_ret_t +rmw_publish_loaned_message( + const rmw_publisher_t * publisher, + void * ros_message, + rmw_publisher_allocation_t * allocation) +{ + (void) publisher; + (void) ros_message; + (void) allocation; + + RMW_SET_ERROR_MSG("rmw_publish_loaned_message not implemented for rmw_fastrtps_cpp"); + return RMW_RET_UNSUPPORTED; +} } // extern "C" diff --git a/rmw_fastrtps_cpp/src/rmw_publisher.cpp b/rmw_fastrtps_cpp/src/rmw_publisher.cpp index 0e3a296a6..65481e8bb 100644 --- a/rmw_fastrtps_cpp/src/rmw_publisher.cpp +++ b/rmw_fastrtps_cpp/src/rmw_publisher.cpp @@ -202,6 +202,7 @@ rmw_create_publisher( RMW_SET_ERROR_MSG("failed to allocate publisher"); goto fail; } + rmw_publisher->can_loan_messages = false; rmw_publisher->implementation_identifier = eprosima_fastrtps_identifier; rmw_publisher->data = info; rmw_publisher->topic_name = reinterpret_cast(rmw_allocate(strlen(topic_name) + 1)); @@ -260,6 +261,32 @@ rmw_publisher_get_actual_qos( publisher, qos); } +rmw_ret_t +rmw_borrow_loaned_message( + const rmw_publisher_t * publisher, + const rosidl_message_type_support_t * type_support, + void ** ros_message) +{ + (void) publisher; + (void) type_support; + (void) ros_message; + + RMW_SET_ERROR_MSG("rmw_borrow_loaned_message not implemented for rmw_fastrtps_cpp"); + return RMW_RET_UNSUPPORTED; +} + +rmw_ret_t +rmw_return_loaned_message( + const rmw_publisher_t * publisher, + void * loaned_message) +{ + (void) publisher; + (void) loaned_message; + + RMW_SET_ERROR_MSG("rmw_return_loaned_message not implemented for rmw_fastrtps_cpp"); + return RMW_RET_UNSUPPORTED; +} + rmw_ret_t rmw_destroy_publisher(rmw_node_t * node, rmw_publisher_t * publisher) { diff --git a/rmw_fastrtps_cpp/src/rmw_subscription.cpp b/rmw_fastrtps_cpp/src/rmw_subscription.cpp index 5df544d32..fd0f0e1c6 100644 --- a/rmw_fastrtps_cpp/src/rmw_subscription.cpp +++ b/rmw_fastrtps_cpp/src/rmw_subscription.cpp @@ -189,7 +189,7 @@ rmw_create_subscription( memcpy(const_cast(rmw_subscription->topic_name), topic_name, strlen(topic_name) + 1); rmw_subscription->options = *subscription_options; - + rmw_subscription->can_loan_messages = false; return rmw_subscription; fail: diff --git a/rmw_fastrtps_cpp/src/rmw_take.cpp b/rmw_fastrtps_cpp/src/rmw_take.cpp index 3cf729047..5e49fd846 100644 --- a/rmw_fastrtps_cpp/src/rmw_take.cpp +++ b/rmw_fastrtps_cpp/src/rmw_take.cpp @@ -70,6 +70,52 @@ rmw_take_serialized_message_with_info( allocation); } +rmw_ret_t +rmw_take_loaned_message( + const rmw_subscription_t * subscription, + void ** loaned_message, + bool * taken, + rmw_subscription_allocation_t * allocation) +{ + (void) subscription; + (void) loaned_message; + (void) taken; + (void) allocation; + + RMW_SET_ERROR_MSG("rmw_take_loaned_message not implemented for rmw_fastrtps_cpp"); + return RMW_RET_UNSUPPORTED; +} + +rmw_ret_t +rmw_take_loaned_message_with_info( + const rmw_subscription_t * subscription, + void ** loaned_message, + bool * taken, + rmw_message_info_t * message_info, + rmw_subscription_allocation_t * allocation) +{ + (void) subscription; + (void) loaned_message; + (void) taken; + (void) message_info; + (void) allocation; + + RMW_SET_ERROR_MSG("rmw_take_loaned_message_with_info not implemented for rmw_fastrtps_cpp"); + return RMW_RET_UNSUPPORTED; +} + +rmw_ret_t +rmw_release_loaned_message( + const rmw_subscription_t * subscription, + void * loaned_message) +{ + (void) subscription; + (void) loaned_message; + + RMW_SET_ERROR_MSG("rmw_release_loaned_message_with_info not implemented for rmw_fastrtps_cpp"); + return RMW_RET_UNSUPPORTED; +} + rmw_ret_t rmw_take_event( const rmw_event_t * event_handle, diff --git a/rmw_fastrtps_dynamic_cpp/src/rmw_publish.cpp b/rmw_fastrtps_dynamic_cpp/src/rmw_publish.cpp index a6e9c038d..a9d09e3b2 100644 --- a/rmw_fastrtps_dynamic_cpp/src/rmw_publish.cpp +++ b/rmw_fastrtps_dynamic_cpp/src/rmw_publish.cpp @@ -35,6 +35,20 @@ rmw_publish( eprosima_fastrtps_identifier, publisher, ros_message, allocation); } +rmw_ret_t +rmw_publish_loaned_message( + const rmw_publisher_t * publisher, + void * ros_message, + rmw_publisher_allocation_t * allocation) +{ + (void) publisher; + (void) ros_message; + (void) allocation; + + RMW_SET_ERROR_MSG("rmw_publish_loaned_message is not implemented for rmw_fastrtps_dynamic_cpp"); + return RMW_RET_UNSUPPORTED; +} + rmw_ret_t rmw_publish_serialized_message( const rmw_publisher_t * publisher, diff --git a/rmw_fastrtps_dynamic_cpp/src/rmw_publisher.cpp b/rmw_fastrtps_dynamic_cpp/src/rmw_publisher.cpp index 3a4d1a1d2..b0ddb6e47 100644 --- a/rmw_fastrtps_dynamic_cpp/src/rmw_publisher.cpp +++ b/rmw_fastrtps_dynamic_cpp/src/rmw_publisher.cpp @@ -198,6 +198,7 @@ rmw_create_publisher( RMW_SET_ERROR_MSG("failed to allocate publisher"); goto fail; } + rmw_publisher->can_loan_messages = false; rmw_publisher->implementation_identifier = eprosima_fastrtps_identifier; rmw_publisher->data = info; rmw_publisher->topic_name = reinterpret_cast(rmw_allocate(strlen(topic_name) + 1)); @@ -256,6 +257,32 @@ rmw_publisher_get_actual_qos( publisher, qos); } +rmw_ret_t +rmw_borrow_loaned_message( + const rmw_publisher_t * publisher, + const rosidl_message_type_support_t * type_support, + void ** ros_message) +{ + (void) publisher; + (void) type_support; + (void) ros_message; + + RMW_SET_ERROR_MSG("rmw_borrow_loaned_message is not implemented for rmw_fastrtps_dynamic_cpp"); + return RMW_RET_UNSUPPORTED; +} + +rmw_ret_t +rmw_return_loaned_message( + const rmw_publisher_t * publisher, + void * loaned_message) +{ + (void) publisher; + (void) loaned_message; + + RMW_SET_ERROR_MSG("rmw_return_loaned_message is not implemented for rmw_fastrtps_dynamic_cpp"); + return RMW_RET_UNSUPPORTED; +} + rmw_ret_t rmw_destroy_publisher(rmw_node_t * node, rmw_publisher_t * publisher) { diff --git a/rmw_fastrtps_dynamic_cpp/src/rmw_subscription.cpp b/rmw_fastrtps_dynamic_cpp/src/rmw_subscription.cpp index f32138239..adbce65e0 100644 --- a/rmw_fastrtps_dynamic_cpp/src/rmw_subscription.cpp +++ b/rmw_fastrtps_dynamic_cpp/src/rmw_subscription.cpp @@ -190,7 +190,7 @@ rmw_create_subscription( memcpy(const_cast(rmw_subscription->topic_name), topic_name, strlen(topic_name) + 1); rmw_subscription->options = *subscription_options; - + rmw_subscription->can_loan_messages = false; return rmw_subscription; fail: diff --git a/rmw_fastrtps_dynamic_cpp/src/rmw_take.cpp b/rmw_fastrtps_dynamic_cpp/src/rmw_take.cpp index e9c936169..8c305527c 100644 --- a/rmw_fastrtps_dynamic_cpp/src/rmw_take.cpp +++ b/rmw_fastrtps_dynamic_cpp/src/rmw_take.cpp @@ -70,6 +70,53 @@ rmw_take_serialized_message_with_info( allocation); } +rmw_ret_t +rmw_take_loaned_message( + const rmw_subscription_t * subscription, + void ** loaned_message, + bool * taken, + rmw_subscription_allocation_t * allocation) +{ + (void) subscription; + (void) loaned_message; + (void) taken; + (void) allocation; + + RMW_SET_ERROR_MSG("rmw_take_loaned_message is not implemented for rmw_fastrtps_dynamic_cpp"); + return RMW_RET_UNSUPPORTED; +} + +rmw_ret_t +rmw_take_loaned_message_with_info( + const rmw_subscription_t * subscription, + void ** loaned_message, + bool * taken, + rmw_message_info_t * message_info, + rmw_subscription_allocation_t * allocation) +{ + (void) subscription; + (void) loaned_message; + (void) taken; + (void) message_info; + (void) allocation; + + RMW_SET_ERROR_MSG( + "rmw_take_loaned_message_with_info is not implemented for rmw_fastrtps_dynamic_cpp"); + return RMW_RET_UNSUPPORTED; +} + +rmw_ret_t +rmw_release_loaned_message( + const rmw_subscription_t * subscription, + void * loaned_message) +{ + (void) subscription; + (void) loaned_message; + + RMW_SET_ERROR_MSG("rmw_release_loaned_message is not implemented for rmw_fastrtps_dynamic_cpp"); + return RMW_RET_UNSUPPORTED; +} + rmw_ret_t rmw_take_event( const rmw_event_t * event_handle,