Skip to content

Commit

Permalink
Allow null arguments in the EventsExecutor parameters (ros2#605)
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
  • Loading branch information
j-rivero authored Jun 2, 2022
1 parent 7a191c3 commit d388d7d
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 1 deletion.
2 changes: 2 additions & 0 deletions rmw_fastrtps_cpp/src/rmw_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@ rmw_client_set_on_new_response_callback(
rmw_event_callback_t callback,
const void * user_data)
{
RMW_CHECK_ARGUMENT_FOR_NULL(rmw_client, RMW_RET_INVALID_ARGUMENT);

return rmw_fastrtps_shared_cpp::__rmw_client_set_on_new_response_callback(
rmw_client,
callback,
Expand Down
2 changes: 2 additions & 0 deletions rmw_fastrtps_cpp/src/rmw_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ rmw_event_set_callback(
rmw_event_callback_t callback,
const void * user_data)
{
RMW_CHECK_ARGUMENT_FOR_NULL(rmw_event, RMW_RET_INVALID_ARGUMENT);

return rmw_fastrtps_shared_cpp::__rmw_event_set_callback(
rmw_event,
callback,
Expand Down
2 changes: 2 additions & 0 deletions rmw_fastrtps_cpp/src/rmw_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@ rmw_service_set_on_new_request_callback(
rmw_event_callback_t callback,
const void * user_data)
{
RMW_CHECK_ARGUMENT_FOR_NULL(rmw_service, RMW_RET_INVALID_ARGUMENT);

return rmw_fastrtps_shared_cpp::__rmw_service_set_on_new_request_callback(
rmw_service,
callback,
Expand Down
2 changes: 2 additions & 0 deletions rmw_fastrtps_cpp/src/rmw_subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ rmw_subscription_set_on_new_message_callback(
rmw_event_callback_t callback,
const void * user_data)
{
RMW_CHECK_ARGUMENT_FOR_NULL(rmw_subscription, RMW_RET_INVALID_ARGUMENT);

return rmw_fastrtps_shared_cpp::__rmw_subscription_set_on_new_message_callback(
rmw_subscription,
callback,
Expand Down
14 changes: 14 additions & 0 deletions rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,4 +572,18 @@ rmw_client_response_subscription_get_actual_qos(

return rmw_fastrtps_shared_cpp::__rmw_client_response_subscription_get_actual_qos(client, qos);
}

rmw_ret_t
rmw_client_set_on_new_response_callback(
rmw_client_t * rmw_client,
rmw_event_callback_t callback,
const void * user_data)
{
RMW_CHECK_ARGUMENT_FOR_NULL(rmw_client, RMW_RET_INVALID_ARGUMENT);

return rmw_fastrtps_shared_cpp::__rmw_client_set_on_new_response_callback(
rmw_client,
callback,
user_data);
}
} // extern "C"
14 changes: 14 additions & 0 deletions rmw_fastrtps_dynamic_cpp/src/rmw_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,18 @@ rmw_subscription_event_init(
subscription->data,
event_type);
}

rmw_ret_t
rmw_event_set_callback(
rmw_event_t * rmw_event,
rmw_event_callback_t callback,
const void * user_data)
{
RMW_CHECK_ARGUMENT_FOR_NULL(rmw_event, RMW_RET_INVALID_ARGUMENT);

return rmw_fastrtps_shared_cpp::__rmw_event_set_callback(
rmw_event,
callback,
user_data);
}
} // extern "C"
1 change: 0 additions & 1 deletion rmw_fastrtps_dynamic_cpp/src/rmw_features.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

extern "C"
{

bool
rmw_feature_supported(rmw_feature_t feature)
{
Expand Down
14 changes: 14 additions & 0 deletions rmw_fastrtps_dynamic_cpp/src/rmw_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,4 +571,18 @@ rmw_service_request_subscription_get_actual_qos(

return rmw_fastrtps_shared_cpp::__rmw_service_request_subscription_get_actual_qos(service, qos);
}

rmw_ret_t
rmw_service_set_on_new_request_callback(
rmw_service_t * rmw_service,
rmw_event_callback_t callback,
const void * user_data)
{
RMW_CHECK_ARGUMENT_FOR_NULL(rmw_service, RMW_RET_INVALID_ARGUMENT);

return rmw_fastrtps_shared_cpp::__rmw_service_set_on_new_request_callback(
rmw_service,
callback,
user_data);
}
} // extern "C"
14 changes: 14 additions & 0 deletions rmw_fastrtps_dynamic_cpp/src/rmw_subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,18 @@ rmw_destroy_subscription(rmw_node_t * node, rmw_subscription_t * subscription)
return rmw_fastrtps_shared_cpp::__rmw_destroy_subscription(
eprosima_fastrtps_identifier, node, subscription);
}

rmw_ret_t
rmw_subscription_set_on_new_message_callback(
rmw_subscription_t * rmw_subscription,
rmw_event_callback_t callback,
const void * user_data)
{
RMW_CHECK_ARGUMENT_FOR_NULL(rmw_subscription, RMW_RET_INVALID_ARGUMENT);

return rmw_fastrtps_shared_cpp::__rmw_subscription_set_on_new_message_callback(
rmw_subscription,
callback,
user_data);
}
} // extern "C"

0 comments on commit d388d7d

Please sign in to comment.