Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Description Nested Support #101

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@# Included from rosidl_typesupport_fastrtps_c/resource/idl__type_support_c.cpp.em
@{
from rosidl_generator_c import idl_structure_type_to_c_typename
from rosidl_generator_type_description import TYPE_HASH_VAR
from rosidl_generator_type_description import GET_DESCRIPTION_FUNC
from rosidl_generator_type_description import GET_HASH_FUNC
from rosidl_generator_type_description import GET_SOURCES_FUNC
from rosidl_parser.definition import AbstractGenericString
from rosidl_parser.definition import AbstractNestedType
from rosidl_parser.definition import AbstractSequence
Expand Down Expand Up @@ -641,7 +643,9 @@ static rosidl_message_type_support_t _@(message.structure.namespaced_type.name)_
rosidl_typesupport_fastrtps_c__identifier,
&__callbacks_@(message.structure.namespaced_type.name),
get_message_typesupport_handle_function,
&@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(TYPE_HASH_VAR),
&@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(GET_HASH_FUNC),
&@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(GET_DESCRIPTION_FUNC),
&@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(GET_SOURCES_FUNC),
};

const rosidl_message_type_support_t *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ TEMPLATE(

@{
from rosidl_generator_c import idl_structure_type_to_c_typename
from rosidl_generator_type_description import TYPE_HASH_VAR
from rosidl_generator_type_description import GET_DESCRIPTION_FUNC
from rosidl_generator_type_description import GET_HASH_FUNC
from rosidl_generator_type_description import GET_SOURCES_FUNC
from rosidl_parser.definition import SERVICE_EVENT_MESSAGE_SUFFIX
from rosidl_parser.definition import SERVICE_REQUEST_MESSAGE_SUFFIX
from rosidl_parser.definition import SERVICE_RESPONSE_MESSAGE_SUFFIX
Expand Down Expand Up @@ -78,7 +80,9 @@ static rosidl_service_type_support_t @(service.namespaced_type.name)__handle = {
rosidl_typesupport_c,
@(',\n '.join(service.namespaced_type.namespaced_name()))
),
&@(idl_structure_type_to_c_typename(service.namespaced_type))__@(TYPE_HASH_VAR),
&@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_HASH_FUNC),
&@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_DESCRIPTION_FUNC),
&@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_SOURCES_FUNC),
};

const rosidl_service_type_support_t *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ endforeach()

# Depend on the target created by rosidl_generator_cpp
target_link_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix} PUBLIC
${rosidl_generate_interfaces_TARGET}__rosidl_generator_c
${rosidl_generate_interfaces_TARGET}__rosidl_generator_cpp)

# Make top level generation target depend on this library
Expand Down
1 change: 1 addition & 0 deletions rosidl_typesupport_fastrtps_cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<buildtool_export_depend>python3</buildtool_export_depend>

<!-- Generator depends on output of this other generator -->
<buildtool_export_depend>rosidl_generator_c</buildtool_export_depend>
<buildtool_export_depend>rosidl_generator_cpp</buildtool_export_depend>

<!-- Needed by downstream targets to use this package's headers or the headers it generates, but header only so not needed to link against -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ include_parts = [package_name] + list(interface_path.parents[0].parts) + [
include_base = '/'.join(include_parts)
}@
#include "@(include_base)__rosidl_typesupport_fastrtps_cpp.hpp"
#include "@(include_base)__functions.h"
#include "@(include_base)__struct.hpp"

@{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@# Included from rosidl_typesupport_fastrtps_cpp/resource/idl__type_support.cpp.em
@{
from rosidl_generator_c import idl_structure_type_to_c_typename
from rosidl_generator_type_description import TYPE_HASH_VAR
from rosidl_generator_type_description import GET_DESCRIPTION_FUNC
from rosidl_generator_type_description import GET_HASH_FUNC
from rosidl_generator_type_description import GET_SOURCES_FUNC
from rosidl_parser.definition import AbstractGenericString
from rosidl_parser.definition import AbstractNestedType
from rosidl_parser.definition import AbstractSequence
Expand Down Expand Up @@ -507,7 +509,9 @@ static rosidl_message_type_support_t _@(message.structure.namespaced_type.name)_
rosidl_typesupport_fastrtps_cpp::typesupport_identifier,
&_@(message.structure.namespaced_type.name)__callbacks,
get_message_typesupport_handle_function,
&@('::'.join(message.structure.namespaced_type.namespaced_name()))::@(TYPE_HASH_VAR),
&@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(GET_HASH_FUNC),
&@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(GET_DESCRIPTION_FUNC),
&@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(GET_SOURCES_FUNC),
};

} // namespace typesupport_fastrtps_cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
@# Included from rosidl_typesupport_fastrtps_cpp/resource/idl__type_support.cpp.em
@{
from rosidl_generator_type_description import TYPE_HASH_VAR
from rosidl_generator_c import idl_structure_type_to_c_typename
from rosidl_generator_type_description import GET_DESCRIPTION_FUNC
from rosidl_generator_type_description import GET_HASH_FUNC
from rosidl_generator_type_description import GET_SOURCES_FUNC
from rosidl_parser.definition import SERVICE_EVENT_MESSAGE_SUFFIX
from rosidl_parser.definition import SERVICE_REQUEST_MESSAGE_SUFFIX
from rosidl_parser.definition import SERVICE_RESPONSE_MESSAGE_SUFFIX
Expand Down Expand Up @@ -79,7 +82,9 @@ static const rosidl_service_type_support_t _@(service.namespaced_type.name)__han
::rosidl_typesupport_fastrtps_cpp::get_message_type_support_handle<@('::'.join([package_name, *interface_path.parents[0].parts, service.namespaced_type.name]))@(SERVICE_EVENT_MESSAGE_SUFFIX)>(),
&::rosidl_typesupport_cpp::service_create_event_message<@('::'.join([package_name, *interface_path.parents[0].parts, service.namespaced_type.name]))>,
&::rosidl_typesupport_cpp::service_destroy_event_message<@('::'.join([package_name, *interface_path.parents[0].parts, service.namespaced_type.name]))>,
&@('::'.join(service.namespaced_type.namespaced_name()))::@(TYPE_HASH_VAR),
&@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_HASH_FUNC),
&@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_DESCRIPTION_FUNC),
&@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_SOURCES_FUNC),
};

#ifdef __cplusplus
Expand Down