rcl  master
C API providing common ROS client library functionality.
node.h
1 // Copyright 2015 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_H_
16 #define RCL__NODE_H_
17 
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include <stdint.h>
24 
25 #include "rcl/allocator.h"
26 #include "rcl/arguments.h"
27 #include "rcl/context.h"
28 #include "rcl/macros.h"
29 #include "rcl/node_options.h"
30 #include "rcl/types.h"
31 #include "rcl/visibility_control.h"
32 
34 struct rcl_node_impl_t;
35 
37 typedef struct rcl_node_t
38 {
41 
43  struct rcl_node_impl_t * impl;
44 } rcl_node_t;
45 
47 RCL_PUBLIC
48 RCL_WARN_UNUSED
50 rcl_get_zero_initialized_node(void);
51 
53 
142 RCL_PUBLIC
143 RCL_WARN_UNUSED
144 rcl_ret_t
145 rcl_node_init(
146  rcl_node_t * node,
147  const char * name,
148  const char * namespace_,
149  rcl_context_t * context,
150  const rcl_node_options_t * options);
151 
153 
179 RCL_PUBLIC
180 RCL_WARN_UNUSED
181 rcl_ret_t
182 rcl_node_fini(rcl_node_t * node);
183 
185 
219 RCL_PUBLIC
220 bool
221 rcl_node_is_valid(const rcl_node_t * node);
222 
224 
232 RCL_PUBLIC
233 bool
234 rcl_node_is_valid_except_context(const rcl_node_t * node);
235 
237 
258 RCL_PUBLIC
259 RCL_WARN_UNUSED
260 const char *
261 rcl_node_get_name(const rcl_node_t * node);
262 
264 
285 RCL_PUBLIC
286 RCL_WARN_UNUSED
287 const char *
288 rcl_node_get_namespace(const rcl_node_t * node);
289 
291 
308 RCL_PUBLIC
309 RCL_WARN_UNUSED
310 const char *
311 rcl_node_get_fully_qualified_name(const rcl_node_t * node);
312 
314 
335 RCL_PUBLIC
336 RCL_WARN_UNUSED
337 const rcl_node_options_t *
338 rcl_node_get_options(const rcl_node_t * node);
339 
341 
368 RCL_PUBLIC
369 RCL_WARN_UNUSED
370 rcl_ret_t
371 rcl_node_get_domain_id(const rcl_node_t * node, size_t * domain_id);
372 
374 
399 RCL_PUBLIC
400 RCL_WARN_UNUSED
401 rmw_node_t *
402 rcl_node_get_rmw_handle(const rcl_node_t * node);
403 
405 
428 RCL_PUBLIC
429 RCL_WARN_UNUSED
430 uint64_t
431 rcl_node_get_rcl_instance_id(const rcl_node_t * node);
432 
434 
461 RCL_PUBLIC
462 RCL_WARN_UNUSED
463 const struct rcl_guard_condition_t *
464 rcl_node_get_graph_guard_condition(const rcl_node_t * node);
465 
467 
488 RCL_PUBLIC
489 RCL_WARN_UNUSED
490 const char *
491 rcl_node_get_logger_name(const rcl_node_t * node);
492 
493 #ifdef __cplusplus
494 }
495 #endif
496 
497 #endif // RCL__NODE_H_
rcl_node_t
Structure which encapsulates a ROS Node.
Definition: node.h:37
rmw_node_t
rcl_node_options_t
Structure which encapsulates the options for creating a rcl_node_t.
Definition: node_options.h:32
rcl_guard_condition_t
Handle for a rcl guard condition.
Definition: guard_condition.h:33
rcl_node_t::impl
struct rcl_node_impl_t * impl
Private implementation pointer.
Definition: node.h:43
rcl_context_t
Encapsulates the non-global state of an init/shutdown cycle.
Definition: context.h:108
rcl_node_t::context
rcl_context_t * context
Context associated with this node.
Definition: node.h:40