ROS 2 rclcpp + rcl - rolling  rolling-e7363f10
ROS 2 C++ Client Library with ROS Client Library
node_type_cache.h
1 // Copyright 2023 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef RCL__NODE_TYPE_CACHE_H_
16 #define RCL__NODE_TYPE_CACHE_H_
17 
18 #include "rcl/macros.h"
19 #include "rcl/node.h"
20 #include "rcl/types.h"
21 #include "rcl/visibility_control.h"
22 #include "rosidl_runtime_c/type_description/type_description__struct.h"
23 #include "rosidl_runtime_c/type_description/type_source__struct.h"
24 #include "type_description_interfaces/msg/type_description.h"
25 #include "type_description_interfaces/msg/type_source.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 typedef struct rcl_type_info_t
32 {
33  type_description_interfaces__msg__TypeDescription * type_description;
34  type_description_interfaces__msg__TypeSource__Sequence * type_sources;
36 
38 
58 RCL_WARN_UNUSED
59 rcl_ret_t rcl_node_type_cache_init(rcl_node_t * node);
60 
62 
80 RCL_WARN_UNUSED
81 rcl_ret_t rcl_node_type_cache_fini(rcl_node_t * node);
82 
84 
106 RCL_PUBLIC
107 RCL_WARN_UNUSED
108 rcl_ret_t rcl_node_type_cache_register_type(
109  const rcl_node_t * node, const rosidl_type_hash_t * type_hash,
110  const rosidl_runtime_c__type_description__TypeDescription * type_description,
111  const rosidl_runtime_c__type_description__TypeSource__Sequence * type_description_sources
112 );
113 
115 
135 RCL_PUBLIC
136 RCL_WARN_UNUSED
137 rcl_ret_t rcl_node_type_cache_unregister_type(
138  const rcl_node_t * node, const rosidl_type_hash_t * type_hash);
139 
141 
164 RCL_PUBLIC
165 RCL_WARN_UNUSED
166 rcl_ret_t rcl_node_type_cache_get_type_info(
167  const rcl_node_t * node,
168  const rosidl_type_hash_t * type_hash,
169  rcl_type_info_t * type_info);
170 
171 #ifdef __cplusplus
172 }
173 #endif
174 
175 #endif // RCL__NODE_TYPE_CACHE_H_
Structure which encapsulates a ROS Node.
Definition: node.h:49
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:25