-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update C and C++ typesupport to use IDL-based extension point
- Loading branch information
1 parent
f253d72
commit f3330ed
Showing
16 changed files
with
561 additions
and
964 deletions.
There are no files selected for viewing
186 changes: 0 additions & 186 deletions
186
rosidl_typesupport_c/cmake/rosidl_typesupport_c_generate_action_interfaces.cmake
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,59 @@ | ||
// generated from | ||
// rosidl_typesupport_c/resource/action__type_support_c.em | ||
// generated code does not contain a copyright notice | ||
|
||
@####################################################################### | ||
@# EmPy template for generating <action>__type_support.c files | ||
@# | ||
@# Context: | ||
@# - spec (rosidl_parser.ActionSpecification) | ||
@# Parsed specification of the .action file | ||
@# - subfolder (string) | ||
@# The subfolder / subnamespace of the message, usually 'action' | ||
@# - get_header_filename_from_msg_name (function) | ||
@####################################################################### | ||
@ | ||
|
||
#include <action_msgs/msg/goal_status_array.h> | ||
#include <action_msgs/srv/cancel_goal.h> | ||
|
||
#include <@(spec.pkg_name)/@(subfolder)/@(get_header_filename_from_msg_name(spec.action_name))__feedback.h> | ||
#include <@(spec.pkg_name)/@(subfolder)/@(get_header_filename_from_msg_name(spec.action_name))__goal.h> | ||
#include <@(spec.pkg_name)/@(subfolder)/@(get_header_filename_from_msg_name(spec.action_name))__result.h> | ||
|
||
|
||
#include "@(spec.pkg_name)/@(subfolder)/@(get_header_filename_from_msg_name(spec.action_name))__type_support.h" | ||
|
||
|
||
static rosidl_action_type_support_t _@(spec.pkg_name)__@(subfolder)__@(spec.action_name)__typesupport_c; | ||
@# Included from rosidl_typesupport_c/resource/idl__type_support.c.em | ||
@{ | ||
from rosidl_cmake import convert_camel_case_to_lower_case_underscore | ||
include_parts = [package_name] + list(interface_path.parents[0].parts) + \ | ||
[convert_camel_case_to_lower_case_underscore(interface_path.stem)] | ||
include_base = '/'.join(include_parts) | ||
|
||
header_files = ( | ||
'action_msgs/msg/goal_status_array.h', | ||
'action_msgs/srv/cancel_goal.h', | ||
include_base + '.h', | ||
include_base + '__type_support.h', | ||
) | ||
}@ | ||
@[for header_file in header_files]@ | ||
@[ if header_file in include_directives]@ | ||
// already included above | ||
// @ | ||
@[ else]@ | ||
@{include_directives.add(header_file)}@ | ||
@[ end if]@ | ||
#include "@(header_file)" | ||
@[end for]@ | ||
|
||
static rosidl_action_type_support_t _@('__'.join([package_name] + list(interface_path.parents[0].parts)))__@(interface_path.stem)__typesupport_c; | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
ROSIDL_TYPESUPPORT_C_EXPORT_@(package_name) | ||
const rosidl_action_type_support_t * | ||
ROSIDL_TYPESUPPORT_INTERFACE__ACTION_SYMBOL_NAME( | ||
rosidl_typesupport_c, @(spec.pkg_name), @(subfolder), @(spec.action_name))() | ||
rosidl_typesupport_c, @(', '.join([package_name] + list(interface_path.parents[0].parts))), @(interface_path.stem))() | ||
{ | ||
// Thread-safe by always writing the same values to the static struct | ||
_@(spec.pkg_name)__@(subfolder)__@(spec.action_name)__typesupport_c.goal_service_type_support = | ||
_@('__'.join([package_name] + list(interface_path.parents[0].parts)))__@(interface_path.stem)__typesupport_c.goal_service_type_support = | ||
ROSIDL_TYPESUPPORT_INTERFACE__SERVICE_SYMBOL_NAME( | ||
rosidl_typesupport_c, @(spec.pkg_name), @(subfolder), @(spec.action_name)_Goal)(); | ||
_@(spec.pkg_name)__@(subfolder)__@(spec.action_name)__typesupport_c.result_service_type_support = | ||
rosidl_typesupport_c, @(', '.join([package_name] + list(interface_path.parents[0].parts))), @(interface_path.stem)_Action_Goal)(); | ||
_@('__'.join([package_name] + list(interface_path.parents[0].parts)))__@(interface_path.stem)__typesupport_c.result_service_type_support = | ||
ROSIDL_TYPESUPPORT_INTERFACE__SERVICE_SYMBOL_NAME( | ||
rosidl_typesupport_c, @(spec.pkg_name), @(subfolder), @(spec.action_name)_Result)(); | ||
_@(spec.pkg_name)__@(subfolder)__@(spec.action_name)__typesupport_c.cancel_service_type_support = | ||
rosidl_typesupport_c, @(', '.join([package_name] + list(interface_path.parents[0].parts))), @(interface_path.stem)_Action_Result)(); | ||
_@('__'.join([package_name] + list(interface_path.parents[0].parts)))__@(interface_path.stem)__typesupport_c.cancel_service_type_support = | ||
ROSIDL_TYPESUPPORT_INTERFACE__SERVICE_SYMBOL_NAME( | ||
rosidl_typesupport_c, action_msgs, srv, CancelGoal)(); | ||
_@(spec.pkg_name)__@(subfolder)__@(spec.action_name)__typesupport_c.feedback_message_type_support = | ||
_@('__'.join([package_name] + list(interface_path.parents[0].parts)))__@(interface_path.stem)__typesupport_c.feedback_message_type_support = | ||
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME( | ||
rosidl_typesupport_c, @(spec.pkg_name), @(subfolder), @(spec.action_name)_Feedback)(); | ||
_@(spec.pkg_name)__@(subfolder)__@(spec.action_name)__typesupport_c.status_message_type_support = | ||
rosidl_typesupport_c, @(', '.join([package_name] + list(interface_path.parents[0].parts))), @(interface_path.stem)_Feedback)(); | ||
_@('__'.join([package_name] + list(interface_path.parents[0].parts)))__@(interface_path.stem)__typesupport_c.status_message_type_support = | ||
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME( | ||
rosidl_typesupport_c, action_msgs, msg, GoalStatusArray)(); | ||
|
||
return &_@(spec.pkg_name)__@(subfolder)__@(spec.action_name)__typesupport_c; | ||
return &_@('__'.join([package_name] + list(interface_path.parents[0].parts)))__@(interface_path.stem)__typesupport_c; | ||
} | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
Oops, something went wrong.