rcl  master
C API providing common ROS client library functionality.
graph.h
1 // Copyright 2016-2017 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__GRAPH_H_
16 #define RCL__GRAPH_H_
17 
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include <rmw/names_and_types.h>
26 
27 #include "rcutils/types.h"
28 
29 #include "rosidl_runtime_c/service_type_support_struct.h"
30 
31 #include "rcl/macros.h"
32 #include "rcl/client.h"
33 #include "rcl/node.h"
34 #include "rcl/visibility_control.h"
35 
39 
40 #define rcl_get_zero_initialized_names_and_types rmw_get_zero_initialized_names_and_types
41 #define rcl_get_zero_initialized_topic_endpoint_info_array \
42  rmw_get_zero_initialized_topic_endpoint_info_array
43 #define rcl_topic_endpoint_info_array_fini rmw_topic_endpoint_info_array_fini
44 
46 
89 RCL_PUBLIC
90 RCL_WARN_UNUSED
91 rcl_ret_t
92 rcl_get_publisher_names_and_types_by_node(
93  const rcl_node_t * node,
94  rcl_allocator_t * allocator,
95  bool no_demangle,
96  const char * node_name,
97  const char * node_namespace,
98  rcl_names_and_types_t * topic_names_and_types);
99 
101 
139 RCL_PUBLIC
140 RCL_WARN_UNUSED
141 rcl_ret_t
142 rcl_get_subscriber_names_and_types_by_node(
143  const rcl_node_t * node,
144  rcl_allocator_t * allocator,
145  bool no_demangle,
146  const char * node_name,
147  const char * node_namespace,
148  rcl_names_and_types_t * topic_names_and_types);
149 
151 
188 RCL_PUBLIC
189 RCL_WARN_UNUSED
190 rcl_ret_t
191 rcl_get_service_names_and_types_by_node(
192  const rcl_node_t * node,
193  rcl_allocator_t * allocator,
194  const char * node_name,
195  const char * node_namespace,
196  rcl_names_and_types_t * service_names_and_types);
197 
199 
236 RCL_PUBLIC
237 RCL_WARN_UNUSED
238 rcl_ret_t
239 rcl_get_client_names_and_types_by_node(
240  const rcl_node_t * node,
241  rcl_allocator_t * allocator,
242  const char * node_name,
243  const char * node_namespace,
244  rcl_names_and_types_t * service_names_and_types);
245 
247 
282 RCL_PUBLIC
283 RCL_WARN_UNUSED
284 rcl_ret_t
285 rcl_get_topic_names_and_types(
286  const rcl_node_t * node,
287  rcl_allocator_t * allocator,
288  bool no_demangle,
289  rcl_names_and_types_t * topic_names_and_types);
290 
292 
322 RCL_PUBLIC
323 RCL_WARN_UNUSED
324 rcl_ret_t
325 rcl_get_service_names_and_types(
326  const rcl_node_t * node,
327  rcl_allocator_t * allocator,
328  rcl_names_and_types_t * service_names_and_types);
329 
331 
353 RCL_PUBLIC
354 RCL_WARN_UNUSED
355 rcl_ret_t
356 rcl_names_and_types_init(
357  rcl_names_and_types_t * names_and_types,
358  size_t size,
359  rcl_allocator_t * allocator);
360 
362 
384 RCL_PUBLIC
385 RCL_WARN_UNUSED
386 rcl_ret_t
387 rcl_names_and_types_fini(rcl_names_and_types_t * names_and_types);
388 
390 
436 RCL_PUBLIC
437 RCL_WARN_UNUSED
438 rcl_ret_t
439 rcl_get_node_names(
440  const rcl_node_t * node,
441  rcl_allocator_t allocator,
442  rcutils_string_array_t * node_names,
443  rcutils_string_array_t * node_namespaces);
444 
446 
469 RCL_PUBLIC
470 RCL_WARN_UNUSED
471 rcl_ret_t
472 rcl_get_node_names_with_enclaves(
473  const rcl_node_t * node,
474  rcl_allocator_t allocator,
475  rcutils_string_array_t * node_names,
476  rcutils_string_array_t * node_namespaces,
477  rcutils_string_array_t * enclaves);
478 
480 
516 RCL_PUBLIC
517 RCL_WARN_UNUSED
518 rcl_ret_t
519 rcl_count_publishers(
520  const rcl_node_t * node,
521  const char * topic_name,
522  size_t * count);
523 
525 
561 RCL_PUBLIC
562 RCL_WARN_UNUSED
563 rcl_ret_t
564 rcl_count_subscribers(
565  const rcl_node_t * node,
566  const char * topic_name,
567  size_t * count);
568 
570 
620 RCL_PUBLIC
621 RCL_WARN_UNUSED
622 rcl_ret_t
623 rcl_get_publishers_info_by_topic(
624  const rcl_node_t * node,
625  rcutils_allocator_t * allocator,
626  const char * topic_name,
627  bool no_mangle,
628  rcl_topic_endpoint_info_array_t * publishers_info);
629 
631 
681 RCL_PUBLIC
682 RCL_WARN_UNUSED
683 rcl_ret_t
684 rcl_get_subscriptions_info_by_topic(
685  const rcl_node_t * node,
686  rcutils_allocator_t * allocator,
687  const char * topic_name,
688  bool no_mangle,
689  rcl_topic_endpoint_info_array_t * subscriptions_info);
690 
692 
726 RCL_PUBLIC
727 RCL_WARN_UNUSED
728 rcl_ret_t
729 rcl_service_server_is_available(
730  const rcl_node_t * node,
731  const rcl_client_t * client,
732  bool * is_available);
733 
734 #ifdef __cplusplus
735 }
736 #endif
737 
738 #endif // RCL__GRAPH_H_
rcl_node_t
Structure which encapsulates a ROS Node.
Definition: node.h:37
rcl_client_t
Structure which encapsulates a ROS Client.
Definition: client.h:33
rcutils_string_array_t
topic_endpoint_info_array.h
rmw_names_and_types_t
rcutils_allocator_t
rmw_topic_endpoint_info_t
get_topic_names_and_types.h
rmw_topic_endpoint_info_array_t
names_and_types.h
types.h