rmw  master
C API providing a middleware abstraction layer which is used to implement the rest of ROS.
types.h
Go to the documentation of this file.
1 // Copyright 2014-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 RMW__TYPES_H_
16 #define RMW__TYPES_H_
17 
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include <stdbool.h>
24 #include <stddef.h>
25 #include <stdint.h>
26 
27 // map rcutils specific log levels to rmw speicfic type
28 #include <rcutils/logging.h>
29 
30 #include "rmw/visibility_control.h"
31 
32 typedef int rmw_ret_t;
33 #define RMW_RET_OK 0
34 #define RMW_RET_ERROR 1
35 #define RMW_RET_TIMEOUT 2
36 
38 #define RMW_RET_BAD_ALLOC 10
39 #define RMW_RET_INVALID_ARGUMENT 11
41 
42 // 24 bytes is the most memory needed to represent the GID by any current
43 // implementation. It may need to be increased in the future.
44 #define RMW_GID_STORAGE_SIZE 24
45 
47 {
49  void * data;
50  const char * name;
51  const char * namespace_;
52 } rmw_node_t;
53 
55 {
57  void * data;
58  const char * topic_name;
60 
62 {
64  void * data;
65  const char * topic_name;
67 
69 {
71  void * data;
72  const char * service_name;
74 
76 {
78  void * data;
79  const char * service_name;
80 } rmw_client_t;
81 
83 {
85  void * data;
87 
89 
96 {
100  void ** subscribers;
102 
104 
111 {
115  void ** services;
117 
119 
126 {
128  size_t client_count;
130  void ** clients;
131 } rmw_clients_t;
132 
134 
141 {
147 
149 {
152  void * data;
154 
156 {
157  int8_t writer_guid[16];
160 
162 {
163  uint64_t sec;
164  uint64_t nsec;
165 } rmw_time_t;
166 
168 {
171 };
172 
174 {
175  enum rmw_security_enforcement_policy_t enforce_security;
176  const char * security_root_path;
178 
180 {
183  RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT
184 };
185 
187 {
190  RMW_QOS_POLICY_HISTORY_KEEP_ALL
191 };
192 
194 {
197  RMW_QOS_POLICY_DURABILITY_VOLATILE
198 };
199 
201 {
203  size_t depth;
207 
218 
220 {
222  uint8_t data[RMW_GID_STORAGE_SIZE];
223 } rmw_gid_t;
224 
226 {
227  // serialized message data
228  char * buffer;
233 
235 {
236  // const rmw_time_t received_timestamp;
240 
242 
243 // Type mapping of rcutil log severity types to
244 // rmw specific types.
245 typedef enum RWM_PUBLIC_TYPE
246 {
253 
254 #ifdef __cplusplus
255 }
256 #endif
257 
258 #endif // RMW__TYPES_H_
#define RMW_GID_STORAGE_SIZE
Definition: types.h:44
RMW_SECURITY_ENFORCEMENT_PERMISSIVE
Definition: types.h:169
bool avoid_ros_namespace_conventions
If true, any ROS specific namespacing conventions will be circumvented.
Definition: types.h:216
const char * implementation_identifier
Definition: types.h:150
RMW_QOS_POLICY_RELIABILITY_RELIABLE
Definition: types.h:181
rcutils_allocator_t allocator
Definition: types.h:231
RCUTILS_LOG_SEVERITY_INFO
const char * topic_name
Definition: types.h:58
void ** services
Pointer to an array of void * pointers of services.
Definition: types.h:115
uint64_t nsec
Definition: types.h:164
RCUTILS_LOG_SEVERITY_WARN
Definition: types.h:234
void * data
Definition: types.h:152
struct RMW_PUBLIC_TYPE rmw_guard_condition_t rmw_guard_condition_t
Array of service handles.
Definition: types.h:110
RMW_SECURITY_ENFORCEMENT_ENFORCE
Definition: types.h:169
const char * implementation_identifier
Definition: types.h:63
char * buffer
Definition: types.h:228
void * data
Definition: types.h:78
RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT
Definition: types.h:188
Definition: types.h:225
RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL
Definition: types.h:195
enum RWM_PUBLIC_TYPE rmw_log_severity_t
size_t buffer_length
Definition: types.h:229
Array of subsciber handles.
Definition: types.h:95
const char * implementation_identifier
Definition: types.h:56
Definition: types.h:155
Definition: types.h:248
struct RMW_PUBLIC_TYPE rmw_guard_conditions_t rmw_guard_conditions_t
Array of guard condition handles.
const char * implementation_identifier
Definition: types.h:221
void ** guard_conditions
Pointer to an array of void * pointers of guard conditions.
Definition: types.h:145
size_t subscriber_count
The number of subscribers represented by the array.
Definition: types.h:98
struct RMW_PUBLIC_TYPE rmw_node_t rmw_node_t
size_t guard_condition_count
The number of guard conditions represented by the array.
Definition: types.h:143
enum RMW_PUBLIC_TYPE rmw_qos_history_policy_t
Definition: types.h:186
void * data
Definition: types.h:57
size_t buffer_capacity
Definition: types.h:230
#define RMW_PUBLIC_TYPE
Definition: visibility_control.h:51
int rmw_ret_t
Definition: types.h:32
void * data
Definition: types.h:64
Definition: types.h:249
struct RMW_PUBLIC_TYPE rmw_clients_t rmw_clients_t
Array of client handles.
void * data
Definition: types.h:49
const char * implementation_identifier
Definition: types.h:84
enum RMW_PUBLIC_TYPE rmw_qos_durability_policy_t
Definition: types.h:193
Definition: types.h:61
struct RMW_PUBLIC_TYPE rmw_service_t rmw_service_t
RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT
Definition: types.h:195
uint64_t sec
Definition: types.h:163
const char * service_name
Definition: types.h:79
size_t service_count
The number of services represented by the array.
Definition: types.h:113
bool from_intra_process
Definition: types.h:238
void ** subscribers
Pointer to an array of void * pointers of subscriptions.
Definition: types.h:100
RMW_QOS_POLICY_HISTORY_KEEP_LAST
Definition: types.h:188
Definition: types.h:75
Definition: types.h:250
enum RMW_PUBLIC_TYPE rmw_qos_reliability_policy_t
Definition: types.h:179
struct RMW_PUBLIC_TYPE rmw_client_t rmw_client_t
Definition: types.h:219
struct RMW_PUBLIC_TYPE rmw_subscription_t rmw_subscription_t
struct RMW_PUBLIC_TYPE rmw_request_id_t rmw_request_id_t
size_t depth
Definition: types.h:203
const char * namespace_
Definition: types.h:51
const char * service_name
Definition: types.h:72
void ** clients
Pointer to an array of void * pointers of clients.
Definition: types.h:130
int64_t sequence_number
Definition: types.h:158
const char * implementation_identifier
Definition: types.h:77
struct RMW_PUBLIC_TYPE rmw_serialized_message_t rmw_serialized_message_t
const char * topic_name
Definition: types.h:65
rmw_gid_t publisher_gid
Definition: types.h:237
struct RMW_PUBLIC_TYPE rmw_qos_profile_t rmw_qos_profile_t
struct RMW_PUBLIC_TYPE rmw_subscriptions_t rmw_subscriptions_t
Array of subsciber handles.
const char * name
Definition: types.h:50
rmw_guard_conditions_t * guard_conditions
Definition: types.h:151
RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT
Definition: types.h:181
Definition: types.h:148
void * data
Definition: types.h:71
struct RMW_PUBLIC_TYPE rmw_gid_t rmw_gid_t
Definition: types.h:161
const char * implementation_identifier
Definition: types.h:48
RCUTILS_LOG_SEVERITY_FATAL
size_t client_count
The number of clients represented by the array.
Definition: types.h:128
Definition: types.h:82
Definition: types.h:68
Definition: types.h:173
Definition: types.h:251
struct RMW_PUBLIC_TYPE rmw_publisher_t rmw_publisher_t
struct RMW_PUBLIC_TYPE rmw_node_security_options_t rmw_node_security_options_t
Array of guard condition handles.
Definition: types.h:140
Definition: types.h:54
Array of client handles.
Definition: types.h:125
enum RMW_PUBLIC_TYPE rmw_security_enforcement_policy_t
Definition: types.h:167
struct RMW_PUBLIC_TYPE rmw_message_info_t rmw_message_info_t
struct RMW_PUBLIC_TYPE rmw_wait_set_t rmw_wait_set_t
const char * implementation_identifier
Definition: types.h:70
RCUTILS_LOG_SEVERITY_DEBUG
Definition: types.h:200
void * data
Definition: types.h:85
Definition: types.h:46
Definition: types.h:247
const char * security_root_path
Definition: types.h:176
struct RMW_PUBLIC_TYPE rmw_time_t rmw_time_t
RCUTILS_LOG_SEVERITY_ERROR
struct RMW_PUBLIC_TYPE rmw_services_t rmw_services_t
Array of service handles.
RWM_PUBLIC_TYPE
Definition: types.h:245