Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Commit

Permalink
zero copy api for opensplice (#285)
Browse files Browse the repository at this point in the history
* zero copy api for opensplice

Signed-off-by: Karsten Knese <[email protected]>

* use RMW_RET_UNSUPPORTED

Signed-off-by: Karsten Knese <[email protected]>
  • Loading branch information
Karsten1987 authored Oct 18, 2019
1 parent 7c4599a commit 3d033ed
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
14 changes: 14 additions & 0 deletions rmw_opensplice_cpp/src/rmw_publish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,18 @@ rmw_publish_serialized_message(

return RMW_RET_OK;
}

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_opensplice_cpp");
return RMW_RET_UNSUPPORTED;
}
} // extern "C"
27 changes: 27 additions & 0 deletions rmw_opensplice_cpp/src/rmw_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ rmw_create_publisher(
memcpy(const_cast<char *>(publisher->topic_name), topic_name, strlen(topic_name) + 1);
publisher->options = *publisher_options;

publisher->can_loan_messages = false;
return publisher;
fail:
if (publisher) {
Expand Down Expand Up @@ -378,6 +379,32 @@ rmw_publisher_assert_liveliness(const rmw_publisher_t * publisher)
return result;
}

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_opensplice_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_opensplice_cpp");
return RMW_RET_UNSUPPORTED;
}

rmw_ret_t
rmw_destroy_publisher(rmw_node_t * node, rmw_publisher_t * publisher)
{
Expand Down
1 change: 1 addition & 0 deletions rmw_opensplice_cpp/src/rmw_subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ rmw_create_subscription(
memcpy(const_cast<char *>(subscription->topic_name), topic_name, strlen(topic_name) + 1);
subscription->options = *subscription_options;

subscription->can_loan_messages = false;
return subscription;
fail:
if (dds_subscriber) {
Expand Down
46 changes: 46 additions & 0 deletions rmw_opensplice_cpp/src/rmw_take.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,50 @@ rmw_take_serialized_message_with_info(

return RMW_RET_OK;
}

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_opensplice_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_opensplice_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 not implemented for rmw_opensplice_cpp");
return RMW_RET_UNSUPPORTED;
}
} // extern "C"

0 comments on commit 3d033ed

Please sign in to comment.