ROS 2 rclcpp + rcl - kilted  kilted
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/node.h"
19 #include "rcl/types.h"
20 #include "rcl/visibility_control.h"
21 #include "rosidl_runtime_c/type_description/type_description__struct.h"
22 #include "rosidl_runtime_c/type_description/type_source__struct.h"
23 #include "type_description_interfaces/msg/type_description.h"
24 #include "type_description_interfaces/msg/type_source.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 typedef struct rcl_type_info_t
31 {
32  type_description_interfaces__msg__TypeDescription * type_description;
33  type_description_interfaces__msg__TypeSource__Sequence * type_sources;
35 
37 
57 RCL_WARN_UNUSED
58 rcl_ret_t rcl_node_type_cache_init(rcl_node_t * node);
59 
61 
79 RCL_WARN_UNUSED
80 rcl_ret_t rcl_node_type_cache_fini(rcl_node_t * node);
81 
83 
105 RCL_PUBLIC
106 RCL_WARN_UNUSED
107 rcl_ret_t rcl_node_type_cache_register_type(
108  const rcl_node_t * node, const rosidl_type_hash_t * type_hash,
109  const rosidl_runtime_c__type_description__TypeDescription * type_description,
110  const rosidl_runtime_c__type_description__TypeSource__Sequence * type_description_sources
111 );
112 
114 
134 RCL_PUBLIC
135 RCL_WARN_UNUSED
136 rcl_ret_t rcl_node_type_cache_unregister_type(
137  const rcl_node_t * node, const rosidl_type_hash_t * type_hash);
138 
140 
163 RCL_PUBLIC
164 RCL_WARN_UNUSED
165 rcl_ret_t rcl_node_type_cache_get_type_info(
166  const rcl_node_t * node,
167  const rosidl_type_hash_t * type_hash,
168  rcl_type_info_t * type_info);
169 
170 #ifdef __cplusplus
171 }
172 #endif
173 
174 #endif // RCL__NODE_TYPE_CACHE_H_
Structure which encapsulates a ROS Node.
Definition: node.h:45
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:24