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

Updates for preallocation API. #274

Merged
merged 4 commits into from
May 2, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Updates for preallocation API.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
  • Loading branch information
mjcarroll committed May 1, 2019
commit 2090bd3e21d2a2977e69b905e73addb543e4b14a
5 changes: 3 additions & 2 deletions rmw_fastrtps_cpp/src/rmw_publish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
extern "C"
{
rmw_ret_t
rmw_publish(const rmw_publisher_t * publisher, const void * ros_message)
rmw_publish(const rmw_publisher_t * publisher, const void * ros_message, rmw_publisher_allocation_t * allocation)
{
(void) allocation;
return rmw_fastrtps_shared_cpp::__rmw_publish(
eprosima_fastrtps_identifier, publisher, ros_message);
eprosima_fastrtps_identifier, publisher, ros_message, allocation);
}

rmw_ret_t
Expand Down
21 changes: 21 additions & 0 deletions rmw_fastrtps_cpp/src/rmw_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,27 @@ using TopicDataType = eprosima::fastrtps::TopicDataType;

extern "C"
{
rmw_ret_t
rmw_init_publisher_allocation(
const rosidl_message_type_support_t * type_supports,
const rosidl_message_bounds_t * message_bounds,
rmw_publisher_allocation_t * allocation)
{
(void) type_supports;
(void) message_bounds;
(void) allocation;
RMW_SET_ERROR_MSG("not implemented.");
return RMW_RET_ERROR;
}

rmw_ret_t
rmw_fini_publisher_allocation(rmw_publisher_allocation_t * allocation)
{
(void) allocation;
RMW_SET_ERROR_MSG("not implemented.");
return RMW_RET_ERROR;
}

rmw_publisher_t *
rmw_create_publisher(
const rmw_node_t * node,
Expand Down
21 changes: 21 additions & 0 deletions rmw_fastrtps_cpp/src/rmw_subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ using TopicDataType = eprosima::fastrtps::TopicDataType;

extern "C"
{
rmw_ret_t
rmw_init_subscription_allocation(
const rosidl_message_type_support_t * type_supports,
const rosidl_message_bounds_t * message_bounds,
rmw_subscription_allocation_t * allocation)
{
(void) type_supports;
(void) message_bounds;
(void) allocation;
RMW_SET_ERROR_MSG("not implemented.");
return RMW_RET_ERROR;
}

rmw_ret_t
rmw_fini_subscription_allocation(rmw_subscription_allocation_t * allocation)
{
(void) allocation;
RMW_SET_ERROR_MSG("not implemented.");
return RMW_RET_ERROR;
}

rmw_subscription_t *
rmw_create_subscription(
const rmw_node_t * node,
Expand Down
15 changes: 11 additions & 4 deletions rmw_fastrtps_cpp/src/rmw_take.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,28 @@
extern "C"
{
rmw_ret_t
rmw_take(const rmw_subscription_t * subscription, void * ros_message, bool * taken)
rmw_take(
const rmw_subscription_t * subscription,
void * ros_message,
bool * taken,
rmw_subscription_allocation_t * allocation)
{
(void) allocation;
return rmw_fastrtps_shared_cpp::__rmw_take(
eprosima_fastrtps_identifier, subscription, ros_message, taken);
eprosima_fastrtps_identifier, subscription, ros_message, taken, allocation);
}

rmw_ret_t
rmw_take_with_info(
const rmw_subscription_t * subscription,
void * ros_message,
bool * taken,
rmw_message_info_t * message_info)
rmw_message_info_t * message_info,
rmw_subscription_allocation_t * allocation)
{
(void) allocation;
return rmw_fastrtps_shared_cpp::__rmw_take_with_info(
eprosima_fastrtps_identifier, subscription, ros_message, taken, message_info);
eprosima_fastrtps_identifier, subscription, ros_message, taken, message_info, allocation);
}

rmw_ret_t
Expand Down
7 changes: 5 additions & 2 deletions rmw_fastrtps_dynamic_cpp/src/rmw_publish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@
extern "C"
{
rmw_ret_t
rmw_publish(const rmw_publisher_t * publisher, const void * ros_message)
rmw_publish(
const rmw_publisher_t * publisher,
const void * ros_message,
rmw_publisher_allocation_t * allocation)
{
return rmw_fastrtps_shared_cpp::__rmw_publish(
eprosima_fastrtps_identifier, publisher, ros_message);
eprosima_fastrtps_identifier, publisher, ros_message, allocation);
}

rmw_ret_t
Expand Down
21 changes: 21 additions & 0 deletions rmw_fastrtps_dynamic_cpp/src/rmw_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,27 @@ using TopicDataType = eprosima::fastrtps::TopicDataType;

extern "C"
{
rmw_ret_t
rmw_init_publisher_allocation(
const rosidl_message_type_support_t * type_supports,
const rosidl_message_bounds_t * message_bounds,
rmw_publisher_allocation_t * allocation)
{
(void) type_supports;
(void) message_bounds;
(void) allocation;
RMW_SET_ERROR_MSG("not implemented.");
return RMW_RET_ERROR;
}

rmw_ret_t
rmw_fini_publisher_allocation(rmw_publisher_allocation_t * allocation)
{
(void) allocation;
RMW_SET_ERROR_MSG("not implemented.");
return RMW_RET_ERROR;
}

rmw_publisher_t *
rmw_create_publisher(
const rmw_node_t * node,
Expand Down
21 changes: 21 additions & 0 deletions rmw_fastrtps_dynamic_cpp/src/rmw_subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ using TopicDataType = eprosima::fastrtps::TopicDataType;

extern "C"
{
rmw_ret_t
rmw_init_subscription_allocation(
const rosidl_message_type_support_t * type_supports,
const rosidl_message_bounds_t * message_bounds,
rmw_subscription_allocation_t * allocation)
{
(void) type_supports;
(void) message_bounds;
(void) allocation;
RMW_SET_ERROR_MSG("not implemented.");
return RMW_RET_ERROR;
}

rmw_ret_t
rmw_fini_subscription_allocation(rmw_subscription_allocation_t * allocation)
{
(void) allocation;
RMW_SET_ERROR_MSG("not implemented.");
return RMW_RET_ERROR;
}

rmw_subscription_t *
rmw_create_subscription(
const rmw_node_t * node,
Expand Down
13 changes: 9 additions & 4 deletions rmw_fastrtps_dynamic_cpp/src/rmw_take.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,26 @@
extern "C"
{
rmw_ret_t
rmw_take(const rmw_subscription_t * subscription, void * ros_message, bool * taken)
rmw_take(
const rmw_subscription_t * subscription,
void * ros_message,
bool * taken,
rmw_subscription_allocation_t * allocation)
{
return rmw_fastrtps_shared_cpp::__rmw_take(
eprosima_fastrtps_identifier, subscription, ros_message, taken);
eprosima_fastrtps_identifier, subscription, ros_message, taken, allocation);
}

rmw_ret_t
rmw_take_with_info(
const rmw_subscription_t * subscription,
void * ros_message,
bool * taken,
rmw_message_info_t * message_info)
rmw_message_info_t * message_info,
rmw_subscription_allocation_t * allocation)
{
return rmw_fastrtps_shared_cpp::__rmw_take_with_info(
eprosima_fastrtps_identifier, subscription, ros_message, taken, message_info);
eprosima_fastrtps_identifier, subscription, ros_message, taken, message_info, allocation);
}

rmw_ret_t
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ rmw_ret_t
__rmw_publish(
const char * identifier,
const rmw_publisher_t * publisher,
const void * ros_message);
const void * ros_message,
rmw_publisher_allocation_t * allocation);

RMW_FASTRTPS_SHARED_CPP_PUBLIC
rmw_ret_t
Expand Down Expand Up @@ -249,7 +250,8 @@ __rmw_take(
const char * identifier,
const rmw_subscription_t * subscription,
void * ros_message,
bool * taken);
bool * taken,
rmw_subscription_allocation_t * allocation);

RMW_FASTRTPS_SHARED_CPP_PUBLIC
rmw_ret_t
Expand All @@ -258,7 +260,8 @@ __rmw_take_with_info(
const rmw_subscription_t * subscription,
void * ros_message,
bool * taken,
rmw_message_info_t * message_info);
rmw_message_info_t * message_info,
rmw_subscription_allocation_t * allocation);

RMW_FASTRTPS_SHARED_CPP_PUBLIC
rmw_ret_t
Expand Down
4 changes: 3 additions & 1 deletion rmw_fastrtps_shared_cpp/src/rmw_publish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ rmw_ret_t
__rmw_publish(
const char * identifier,
const rmw_publisher_t * publisher,
const void * ros_message)
const void * ros_message,
rmw_publisher_allocation_t * allocation)
{
(void) allocation;
RCUTILS_CHECK_FOR_NULL_WITH_MSG(publisher, "publisher pointer is null", return RMW_RET_ERROR);
RCUTILS_CHECK_FOR_NULL_WITH_MSG(
ros_message, "ros_message pointer is null", return RMW_RET_ERROR);
Expand Down
14 changes: 9 additions & 5 deletions rmw_fastrtps_shared_cpp/src/rmw_take.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ _take(
const rmw_subscription_t * subscription,
void * ros_message,
bool * taken,
rmw_message_info_t * message_info)
rmw_message_info_t * message_info,
rmw_subscription_allocation_t * allocation)
{
(void) allocation;
*taken = false;

if (subscription->implementation_identifier != identifier) {
Expand Down Expand Up @@ -85,15 +87,16 @@ __rmw_take(
const char * identifier,
const rmw_subscription_t * subscription,
void * ros_message,
bool * taken)
bool * taken,
rmw_subscription_allocation_t * allocation)
{
RCUTILS_CHECK_FOR_NULL_WITH_MSG(
subscription, "subscription pointer is null", return RMW_RET_ERROR);
RCUTILS_CHECK_FOR_NULL_WITH_MSG(
ros_message, "ros_message pointer is null", return RMW_RET_ERROR);
RCUTILS_CHECK_FOR_NULL_WITH_MSG(taken, "boolean flag for taken is null", return RMW_RET_ERROR);

return _take(identifier, subscription, ros_message, taken, nullptr);
return _take(identifier, subscription, ros_message, taken, nullptr, allocation);
}

rmw_ret_t
Expand All @@ -102,7 +105,8 @@ __rmw_take_with_info(
const rmw_subscription_t * subscription,
void * ros_message,
bool * taken,
rmw_message_info_t * message_info)
rmw_message_info_t * message_info,
rmw_subscription_allocation_t * allocation)
{
RCUTILS_CHECK_FOR_NULL_WITH_MSG(
subscription, "subscription pointer is null", return RMW_RET_ERROR);
Expand All @@ -112,7 +116,7 @@ __rmw_take_with_info(
RCUTILS_CHECK_FOR_NULL_WITH_MSG(
message_info, "message info pointer is null", return RMW_RET_ERROR);

return _take(identifier, subscription, ros_message, taken, message_info);
return _take(identifier, subscription, ros_message, taken, message_info, allocation);
}

rmw_ret_t
Expand Down