From 3aef23164c6f29dfa2bd03b53097c2648a65d363 Mon Sep 17 00:00:00 2001 From: Stefan Fabian Date: Mon, 26 Jul 2021 10:44:51 +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 a848db1c..56c88386 100644 --- a/rosidl_typesupport_cpp/resource/action__type_support.cpp.em +++ b/rosidl_typesupport_cpp/resource/action__type_support.cpp.em @@ -63,3 +63,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 d1b603dc..edf104bd 100644 --- a/rosidl_typesupport_cpp/resource/srv__type_support.cpp.em +++ b/rosidl_typesupport_cpp/resource/srv__type_support.cpp.em @@ -153,3 +153,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