Skip to content

Commit

Permalink
update comment (#757)
Browse files Browse the repository at this point in the history
* update comment

Signed-off-by: Chen Lihui <[email protected]>
Co-authored-by: Chris Lalancette <[email protected]>
  • Loading branch information
Chen Lihui and clalancette authored Jul 19, 2023
1 parent 17944a6 commit c72b454
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function_prefix = '__'.join(include_parts) + '__rosidl_typesupport_introspection
static rosidl_typesupport_introspection_c__ServiceMembers @(function_prefix)__@(service.namespaced_type.name)_service_members = {
"@('__'.join([package_name] + list(interface_path.parents[0].parts)))", // service namespace
"@(service.namespaced_type.name)", // service name
// these two fields are initialized below on the first access
// the following fields are initialized below on first access
NULL, // request message
// @(function_prefix)__@(service.request_message.structure.namespaced_type.name)_message_type_support_handle,
NULL, // response message
Expand Down Expand Up @@ -94,7 +94,7 @@ static rosidl_service_type_support_t @(function_prefix)__@(service.namespaced_ty
&@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_SOURCES_FUNC),
};

// Forward declaration of request/response type support functions
// Forward declaration of message type support functions for service members
const rosidl_message_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(rosidl_typesupport_introspection_c, @(', '.join([package_name] + list(interface_path.parents[0].parts))), @(service.namespaced_type.name + SERVICE_REQUEST_MESSAGE_SUFFIX))();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace rosidl_typesupport_introspection_cpp
static ::rosidl_typesupport_introspection_cpp::ServiceMembers @(service.namespaced_type.name)_service_members = {
"@('::'.join([package_name] + list(interface_path.parents[0].parts)))", // service namespace
"@(service.namespaced_type.name)", // service name
// these two fields are initialized below on the first access
// the following fields are initialized below on first access
// see get_service_type_support_handle<@('::'.join([package_name] + list(interface_path.parents[0].parts) + [service.namespaced_type.name]))>()
nullptr, // request message
nullptr, // response message
Expand Down Expand Up @@ -111,7 +111,7 @@ get_service_type_support_handle<@('::'.join([package_name] + list(interface_path
auto service_members = const_cast<::rosidl_typesupport_introspection_cpp::ServiceMembers *>(
static_cast<const ::rosidl_typesupport_introspection_cpp::ServiceMembers *>(
service_type_support->data));
// make sure that both the request_members_ and the response_members_ are initialized
// make sure all of the service_members are initialized
// if they are not, initialize them
if (
service_members->request_members_ == nullptr ||
Expand All @@ -134,7 +134,6 @@ get_service_type_support_handle<@('::'.join([package_name] + list(interface_path
::@('::'.join([package_name] + list(interface_path.parents[0].parts)))::@(service.response_message.structure.namespaced_type.name)
>()->data
);

// initialize the event_members_ with the static function from the external library
service_members->event_members_ = static_cast<
const ::rosidl_typesupport_introspection_cpp::MessageMembers *
Expand Down

0 comments on commit c72b454

Please sign in to comment.