Skip to content

Commit

Permalink
Feature: topic keys (#4)
Browse files Browse the repository at this point in the history
* Refs #20156: Initial infraestructure for get_key_type_support() api method

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20156: Return either true or false depending if the msg has keys

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20156: Update message_type_support_key_callbacks_t structure

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20156: Implement rosidl_typesupport_fastrtps_c generator methods for supporting keys

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20156: Implement rosidl_typesupport_fastrtps_cpp generator methods for supporting keys

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20310: Define v2 ABI identifier

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20310: Replace get_key_type_support() with a raw pointer to the structure

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: Clean unsued old methods

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: set _key as suffix in get_serialized and calculate_max_serialized

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_c: export key methods to be called from outside in headers

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_c: source file forward declarations

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_c: generator refactor: generate_members_for_cdr_serialize

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_c: generator refactor: generate_members_for_get_serialized_size

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_c: generator refactor: generate_members_for_max_serialized_size

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_c: update suffix in __key_callback structure

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_c: avoid generating cdr_serialize_key and cdr_deserialize_key methods that are not going to be used nor exported if the type do not have keys

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_cpp: export key methods to be called from outside in headers

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_cpp: source file forward declarations

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_cpp: generator refactor: generate_members_for_cdr_serialize. Also, generate proxy methods only when the type has a key

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_cpp: generator refactor: generate_members_for_get_serialized_size adn proxy

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_cpp: generator refactor: generate_members_for_max_serialized_size and proxy

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_cpp: dummy cdr_deserialize_key method and proxy

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20151: rosidl_typesupport_fastrtps_cpp: update suffix in __key_callback structure

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20310: Review 2 suggestions on rosidl_typesupport_fastrtps_cpp

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20310: Review 2 suggestions on rosidl_typesupport_fastrtps_c

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #20310: NIT

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

---------

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
  • Loading branch information
Mario-DL committed Mar 6, 2024
1 parent 03dd8d7 commit 7092633
Show file tree
Hide file tree
Showing 9 changed files with 1,104 additions and 489 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ extern "C"
ROSIDL_TYPESUPPORT_FASTRTPS_C_PUBLIC
extern const char * rosidl_typesupport_fastrtps_c__identifier;

/// String identifier specific to rosidl_typesupport_fastrtps_c_v2
ROSIDL_TYPESUPPORT_FASTRTPS_C_PUBLIC
extern const char * rosidl_typesupport_fastrtps_c__identifier_v2;

#if __cplusplus
}
#endif
Expand Down
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,27 @@ 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,
size_t current_alignment);

ROSIDL_TYPESUPPORT_FASTRTPS_C_PUBLIC_@(package_name)
size_t max_serialized_size_key_@('__'.join([package_name] + list(interface_path.parents[0].parts) + [message.structure.namespaced_type.name]))(
bool & full_bounded,
bool & is_plain,
size_t current_alignment);

ROSIDL_TYPESUPPORT_FASTRTPS_C_PUBLIC_@(package_name)
const rosidl_message_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(rosidl_typesupport_fastrtps_c, @(', '.join([package_name] + list(interface_path.parents[0].parts) + [message.structure.namespaced_type.name])))();
Expand Down

0 comments on commit 7092633

Please sign in to comment.