From 793cbc9f25f1ecbadec79094984caec5e7ab2a80 Mon Sep 17 00:00:00 2001 From: Stefan Fabian Date: Fri, 12 May 2023 10:15:11 +0200 Subject: [PATCH] Added C interfaces to obtain service and action type support. Signed-off-by: Stefan Fabian --- .../resource/action__type_support.cpp.em | 15 +++++++++++++++ .../resource/srv__type_support.cpp.em | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/rosidl_typesupport_cpp/resource/action__type_support.cpp.em b/rosidl_typesupport_cpp/resource/action__type_support.cpp.em index 80f66b11..afdc9265 100644 --- a/rosidl_typesupport_cpp/resource/action__type_support.cpp.em +++ b/rosidl_typesupport_cpp/resource/action__type_support.cpp.em @@ -71,3 +71,18 @@ get_action_type_support_handle<@('::'.join([package_name] + list(interface_path. } } // namespace rosidl_typesupport_cpp + +#ifdef __cplusplus +extern "C" +{ +#endif + +ROSIDL_TYPESUPPORT_CPP_PUBLIC +const rosidl_action_type_support_t * +ROSIDL_TYPESUPPORT_INTERFACE__ACTION_SYMBOL_NAME(rosidl_typesupport_cpp, @(', '.join([package_name] + list(interface_path.parents[0].parts) + [interface_path.stem])))() { + return ::rosidl_typesupport_cpp::get_action_type_support_handle<@('::'.join([package_name] + list(interface_path.parents[0].parts) + [interface_path.stem]))>(); +} + +#ifdef __cplusplus +} +#endif diff --git a/rosidl_typesupport_cpp/resource/srv__type_support.cpp.em b/rosidl_typesupport_cpp/resource/srv__type_support.cpp.em index 319e6a29..e8897738 100644 --- a/rosidl_typesupport_cpp/resource/srv__type_support.cpp.em +++ b/rosidl_typesupport_cpp/resource/srv__type_support.cpp.em @@ -175,3 +175,18 @@ get_service_type_support_handle<@('::'.join([package_name] + list(interface_path } } // namespace rosidl_typesupport_cpp + +#ifdef __cplusplus +extern "C" +{ +#endif + +ROSIDL_TYPESUPPORT_CPP_PUBLIC +const rosidl_service_type_support_t * +ROSIDL_TYPESUPPORT_INTERFACE__SERVICE_SYMBOL_NAME(rosidl_typesupport_cpp, @(', '.join([package_name] + list(interface_path.parents[0].parts) + [service.namespaced_type.name])))() { + return ::rosidl_typesupport_cpp::get_service_type_support_handle<@('::'.join([package_name] + list(interface_path.parents[0].parts) + [service.namespaced_type.name]))>(); +} + +#ifdef __cplusplus +} +#endif