Skip to content

Commit

Permalink
Refs #20310: Review 2 suggestions on rosidl_typesupport_fastrtps_c
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Dominguez <[email protected]>
  • Loading branch information
Mario-DL committed Feb 29, 2024
1 parent 0400104 commit 491fea2
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 85 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
@# Included from rosidl_typesupport_fastrtps_c/resource/idl__rosidl_typesupport_fastrtps_c.h.em
@{

from rosidl_pycommon import convert_camel_case_to_lower_case_underscore

include_parts = [package_name] + list(interface_path.parents[0].parts) + [
'detail', convert_camel_case_to_lower_case_underscore(interface_path.stem)]
include_base = '/'.join(include_parts)

header_files = [
'stddef.h',
'rosidl_runtime_c/message_type_support_struct.h',
'rosidl_typesupport_interface/macros.h',
package_name + '/msg/rosidl_typesupport_fastrtps_c__visibility_control.h',
include_base + '__struct.h',
'fastcdr/Cdr.h',
]
}@
@[for header_file in header_files]@
Expand All @@ -26,6 +35,16 @@ extern "C"
{
#endif

ROSIDL_TYPESUPPORT_FASTRTPS_C_PUBLIC_@(package_name)
bool cdr_serialize_@('__'.join([package_name] + list(interface_path.parents[0].parts) + [message.structure.namespaced_type.name]))(
const @('__'.join(message.structure.namespaced_type.namespaced_name())) * ros_message,
eprosima::fastcdr::Cdr & cdr);

ROSIDL_TYPESUPPORT_FASTRTPS_C_PUBLIC_@(package_name)
bool cdr_deserialize_@('__'.join([package_name] + list(interface_path.parents[0].parts) + [message.structure.namespaced_type.name]))(
eprosima::fastcdr::Cdr &,
@('__'.join(message.structure.namespaced_type.namespaced_name())) * ros_message);

ROSIDL_TYPESUPPORT_FASTRTPS_C_PUBLIC_@(package_name)
size_t get_serialized_size_@('__'.join([package_name] + list(interface_path.parents[0].parts) + [message.structure.namespaced_type.name]))(
const void * untyped_ros_message,
Expand All @@ -37,6 +56,16 @@ size_t max_serialized_size_@('__'.join([package_name] + list(interface_path.pare
bool & is_plain,
size_t current_alignment);

ROSIDL_TYPESUPPORT_FASTRTPS_C_PUBLIC_@(package_name)
bool cdr_serialize_key_@('__'.join([package_name] + list(interface_path.parents[0].parts) + [message.structure.namespaced_type.name]))(
const @('__'.join(message.structure.namespaced_type.namespaced_name())) * ros_message,
eprosima::fastcdr::Cdr & cdr);

ROSIDL_TYPESUPPORT_FASTRTPS_C_PUBLIC_@(package_name)
bool cdr_deserialize_key_@('__'.join([package_name] + list(interface_path.parents[0].parts) + [message.structure.namespaced_type.name]))(
eprosima::fastcdr::Cdr &,
@('__'.join(message.structure.namespaced_type.namespaced_name())) * ros_message);

ROSIDL_TYPESUPPORT_FASTRTPS_C_PUBLIC_@(package_name)
size_t get_serialized_size_key_@('__'.join([package_name] + list(interface_path.parents[0].parts) + [message.structure.namespaced_type.name]))(
const void * untyped_ros_message,
Expand Down
Loading

0 comments on commit 491fea2

Please sign in to comment.