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 
16 
17 #ifndef RCL__NODE_H_
18 #define RCL__NODE_H_
19 
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 #include <stdint.h>
26 
27 #include "rcl/allocator.h"
28 #include "rcl/arguments.h"
29 #include "rcl/context.h"
30 #include "rcl/macros.h"
31 #include "rcl/node_options.h"
32 #include "rcl/types.h"
33 #include "rcl/visibility_control.h"
34 
36 struct rcl_node_impl_t;
37 
39 typedef struct rcl_node_t
40 {
43 
45  struct rcl_node_impl_t * impl;
46 } rcl_node_t;
47 
49 RCL_PUBLIC
50 RCL_WARN_UNUSED
53 
55 
144 RCL_PUBLIC
145 RCL_WARN_UNUSED
146 rcl_ret_t
148  rcl_node_t * node,
149  const char * name,
150  const char * namespace_,
151  rcl_context_t * context,
152  const rcl_node_options_t * options);
153 
155 
181 RCL_PUBLIC
182 RCL_WARN_UNUSED
183 rcl_ret_t
184 rcl_node_fini(rcl_node_t * node);
185 
187 
221 RCL_PUBLIC
222 bool
223 rcl_node_is_valid(const rcl_node_t * node);
224 
226 
234 RCL_PUBLIC
235 bool
237 
239 
260 RCL_PUBLIC
261 RCL_WARN_UNUSED
262 const char *
263 rcl_node_get_name(const rcl_node_t * node);
264 
266 
287 RCL_PUBLIC
288 RCL_WARN_UNUSED
289 const char *
290 rcl_node_get_namespace(const rcl_node_t * node);
291 
293 
310 RCL_PUBLIC
311 RCL_WARN_UNUSED
312 const char *
314 
316 
337 RCL_PUBLIC
338 RCL_WARN_UNUSED
339 const rcl_node_options_t *
340 rcl_node_get_options(const rcl_node_t * node);
341 
343 
370 RCL_PUBLIC
371 RCL_WARN_UNUSED
372 rcl_ret_t
373 rcl_node_get_domain_id(const rcl_node_t * node, size_t * domain_id);
374 
376 
401 RCL_PUBLIC
402 RCL_WARN_UNUSED
403 rmw_node_t *
404 rcl_node_get_rmw_handle(const rcl_node_t * node);
405 
407 
430 RCL_PUBLIC
431 RCL_WARN_UNUSED
432 uint64_t
434 
436 
463 RCL_PUBLIC
464 RCL_WARN_UNUSED
465 const struct rcl_guard_condition_t *
467 
469 
490 RCL_PUBLIC
491 RCL_WARN_UNUSED
492 const char *
494 
496 
525 RCL_PUBLIC
526 RCL_WARN_UNUSED
527 rcl_ret_t
529  const rcl_node_t * node,
530  const char * input_name,
531  rcl_allocator_t allocator,
532  bool is_service,
533  bool only_expand,
534  char ** output_name);
535 
536 #ifdef __cplusplus
537 }
538 #endif
539 
540 #endif // RCL__NODE_H_
rcl_node_get_rmw_handle
rmw_node_t * rcl_node_get_rmw_handle(const rcl_node_t *node)
Return the rmw node handle.
rcl_node_t
Structure which encapsulates a ROS Node.
Definition: node.h:39
rmw_node_t
rcl_node_get_name
const char * rcl_node_get_name(const rcl_node_t *node)
Return the name of the node.
rcl_node_get_namespace
const char * rcl_node_get_namespace(const rcl_node_t *node)
Return the namespace of the node.
rcl_node_get_graph_guard_condition
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_node_get_domain_id
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.
types.h
rcl_ret_t
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:23
rcl_node_get_options
const rcl_node_options_t * rcl_node_get_options(const rcl_node_t *node)
Return the rcl node options.
rcl_node_options_t
Structure which encapsulates the options for creating a rcl_node_t.
Definition: node_options.h:34
rcl_guard_condition_t
Handle for a rcl guard condition.
Definition: guard_condition.h:35
arguments.h
rcl_node_get_fully_qualified_name
const char * rcl_node_get_fully_qualified_name(const rcl_node_t *node)
Return the fully qualified name of the node.
rcl_node_t::impl
struct rcl_node_impl_t * impl
Private implementation pointer.
Definition: node.h:45
rcl_node_fini
rcl_ret_t rcl_node_fini(rcl_node_t *node)
Finalize a rcl_node_t.
node_options.h
rcutils_allocator_t
allocator.h
rcl_node_is_valid
bool rcl_node_is_valid(const rcl_node_t *node)
Return true if the node is valid, else false.
rcl_node_init
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_get_zero_initialized_node
rcl_node_t rcl_get_zero_initialized_node(void)
Return a rcl_node_t struct with members initialized to NULL.
rcl_context_t
Encapsulates the non-global state of an init/shutdown cycle.
Definition: context.h:113
rcl_node_is_valid_except_context
bool rcl_node_is_valid_except_context(const rcl_node_t *node)
Return true if node is valid, except for the context being valid.
context.h
rcl_node_t
struct rcl_node_t rcl_node_t
Structure which encapsulates a ROS Node.
rcl_node_resolve_name
rcl_ret_t rcl_node_resolve_name(const rcl_node_t *node, const char *input_name, rcl_allocator_t allocator, bool is_service, bool only_expand, char **output_name)
Expand a given name into a fully-qualified topic name and apply remapping rules.
rcl_node_get_logger_name
const char * rcl_node_get_logger_name(const rcl_node_t *node)
Return the logger name of the node.
rcl_node_t::context
rcl_context_t * context
Context associated with this node.
Definition: node.h:42
rcl_node_get_rcl_instance_id
uint64_t rcl_node_get_rcl_instance_id(const rcl_node_t *node)
Return the associated rcl instance id.