rcl  master
C API providing common ROS client library functionality.
node.h
Go to the documentation of this file.
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 
51 
53 
140 rcl_ret_t
142  rcl_node_t * node,
143  const char * name,
144  const char * namespace_,
146  const rcl_node_options_t * options);
147 
149 
172 rcl_ret_t
173 rcl_node_fini(rcl_node_t * node);
174 
176 
211 bool
212 rcl_node_is_valid(const rcl_node_t * node);
213 
215 
224 bool
226 
228 
251 const char *
252 rcl_node_get_name(const rcl_node_t * node);
253 
255 
278 const char *
279 rcl_node_get_namespace(const rcl_node_t * node);
280 
282 
301 const char *
303 
305 
328 const rcl_node_options_t *
329 rcl_node_get_options(const rcl_node_t * node);
330 
332 
361 rcl_ret_t
362 rcl_node_get_domain_id(const rcl_node_t * node, size_t * domain_id);
363 
365 
386 rcl_ret_t
388 
390 
417 rmw_node_t *
418 rcl_node_get_rmw_handle(const rcl_node_t * node);
419 
421 
446 uint64_t
448 
450 
479 const struct rcl_guard_condition_t *
481 
483 
506 const char *
508 
509 #ifdef __cplusplus
510 }
511 #endif
512 
513 #endif // RCL__NODE_H_
uint64_t rcl_node_get_rcl_instance_id(const rcl_node_t *node)
Return the associated rcl instance id.
rmw_ret_t rcl_ret_t
Definition: types.h:20
const char * rcl_node_get_logger_name(const rcl_node_t *node)
Return the logger name of the node.
rcl_context_t * context
Context associated with this node.
Definition: node.h:40
rcl_ret_t rcl_node_get_domain_id(const rcl_node_t *node, size_t *domain_id)
Return the ROS domain ID that the node is using.
const rcl_node_options_t * rcl_node_get_options(const rcl_node_t *node)
Return the rcl node options.
bool rcl_node_is_valid(const rcl_node_t *node)
Return true if the node is valid, else false.
rcl_ret_t rcl_node_init(rcl_node_t *node, const char *name, const char *namespace_, rcl_context_t *context, const rcl_node_options_t *options)
Initialize a ROS node.
rcl_ret_t rcl_node_assert_liveliness(const rcl_node_t *node)
Manually assert that this node is alive (for RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_NODE) ...
#define RCL_WARN_UNUSED
Ignored return values of functions with this macro will emit a warning.
Definition: macros.h:25
struct rcl_node_impl_t * impl
Private implementation pointer.
Definition: node.h:43
#define RCL_PUBLIC
Definition: visibility_control.h:48
bool rcl_node_is_valid_except_context(const rcl_node_t *node)
Return true if node is valid, except for the context being valid.
rmw_node_t * rcl_node_get_rmw_handle(const rcl_node_t *node)
Return the rmw node handle.
Structure which encapsulates the options for creating a rcl_node_t.
Definition: node_options.h:30
const char * rcl_node_get_name(const rcl_node_t *node)
Return the name of the node.
const char * rcl_node_get_namespace(const rcl_node_t *node)
Return the namespace of the node.
Encapsulates the non-global state of an init/shutdown cycle.
Definition: context.h:108
const struct rcl_guard_condition_t * rcl_node_get_graph_guard_condition(const rcl_node_t *node)
Return a guard condition which is triggered when the ROS graph changes.
rcl_ret_t rcl_node_fini(rcl_node_t *node)
Finalize a rcl_node_t.
struct rcl_node_t rcl_node_t
Structure which encapsulates a ROS Node.
Handle for a rcl guard condition.
Definition: guard_condition.h:33
const char * rcl_node_get_fully_qualified_name(const rcl_node_t *node)
Return the fully qualified name of the node.
Structure which encapsulates a ROS Node.
Definition: node.h:37
rcl_node_t rcl_get_zero_initialized_node(void)
Return a rcl_node_t struct with members initialized to NULL.