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/init.h"
32 #include "rmw/ret_types.h"
33 #include "rmw/serialized_message.h"
34 #include "rmw/visibility_control.h"
35 
36 // 24 bytes is the most memory needed to represent the GID by any current
37 // implementation. It may need to be increased in the future.
38 #define RMW_GID_STORAGE_SIZE 24
39 
41 {
43  void * data;
44  const char * name;
45  const char * namespace_;
47 } rmw_node_t;
48 
51 {
53 
64 
66 {
68  void * data;
69  const char * topic_name;
71 
82 
85 {
87 
94 
96 
110 
112 {
114  void * data;
115  const char * topic_name;
117 
128 
130 {
132  void * data;
133  const char * service_name;
134 } rmw_service_t;
135 
137 {
139  void * data;
140  const char * service_name;
141 } rmw_client_t;
142 
144 {
146  void * data;
149 
151 {
153  void * data;
155 
157 {
159  void * data;
161 
163 
170 {
174  void ** subscribers;
176 
178 
185 {
189  void ** services;
191 
193 
200 {
202  size_t client_count;
204  void ** clients;
205 } rmw_clients_t;
206 
208 {
210  size_t event_count;
212  void ** events;
213 } rmw_events_t;
214 
216 
223 {
229 
231 {
234  void * data;
236 
238 {
239  int8_t writer_guid[16];
242 
244 {
245  uint64_t sec;
246  uint64_t nsec;
247 } rmw_time_t;
248 
250 {
253 };
254 
256 {
257  enum rmw_security_enforcement_policy_t enforce_security;
258  const char * security_root_path;
260 
262 {
266  RMW_QOS_POLICY_RELIABILITY_UNKNOWN
267 };
268 
270 {
274  RMW_QOS_POLICY_HISTORY_UNKNOWN
275 };
276 
278 {
282  RMW_QOS_POLICY_DURABILITY_UNKNOWN
283 };
284 
286 {
291  RMW_QOS_POLICY_LIVELINESS_UNKNOWN
292 };
293 
294 #define RMW_QOS_DEADLINE_DEFAULT {0, 0}
295 #define RMW_QOS_LIFESPAN_DEFAULT {0, 0}
296 #define RMW_QOS_LIVELINESS_LEASE_DURATION_DEFAULT {0, 0}
297 
300 {
303  size_t depth;
309  struct rmw_time_t deadline;
311  struct rmw_time_t lifespan;
315  struct rmw_time_t liveliness_lease_duration;
316 
318 
329 
331 {
333  uint8_t data[RMW_GID_STORAGE_SIZE];
334 } rmw_gid_t;
335 
337 {
338  // const rmw_time_t received_timestamp;
342 
344 {
346  size_t size;
347  size_t capacity;
349 
351 
353 typedef enum RMW_PUBLIC_TYPE
354 {
361 
364 {
373  int32_t alive_count;
388 
391 {
398  int32_t total_count;
402 
405 {
412  int32_t total_count;
416 
419 {
426  int32_t total_count;
430 
431 #ifdef __cplusplus
432 }
433 #endif
434 
435 #endif // RMW__TYPES_H_
#define RMW_GID_STORAGE_SIZE
Definition: types.h:38
struct RMW_PUBLIC_TYPE rmw_subscription_options_t rmw_subscription_options_t
Options that can be used to configure the creation of a subscription in rmw.
RMW_SECURITY_ENFORCEMENT_PERMISSIVE
Definition: types.h:251
RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT
Definition: types.h:287
void * rmw_specific_subscription_payload
Used to pass rmw implementation specific resources during subscription creation.
Definition: types.h:93
bool avoid_ros_namespace_conventions
If true, any ROS specific namespacing conventions will be circumvented.
Definition: types.h:327
const char * implementation_identifier
Definition: types.h:232
RMW_QOS_POLICY_RELIABILITY_RELIABLE
Definition: types.h:263
RCUTILS_LOG_SEVERITY_INFO
const char * topic_name
Definition: types.h:69
int32_t total_count_change
The change in total_count since the last time the status was last read.
Definition: types.h:428
struct RMW_PUBLIC_TYPE rmw_requested_deadline_missed_status_t rmw_requested_deadline_missed_status_t
QoS Requested Deadline Missed information provided by a subscription.
RMW_QOS_POLICY_LIVELINESS_AUTOMATIC
Definition: types.h:287
void ** services
Pointer to an array of void * pointers of services.
Definition: types.h:189
RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC
Definition: types.h:287
uint64_t nsec
Definition: types.h:246
RCUTILS_LOG_SEVERITY_WARN
Options that can be used to configure the creation of a subscription in rmw.
Definition: types.h:84
bool ignore_local_publications
If true then the middleware should not deliver data from local publishers.
Definition: types.h:108
Definition: types.h:336
void * data
Definition: types.h:234
struct RMW_PUBLIC_TYPE rmw_guard_condition_t rmw_guard_condition_t
Array of service handles.
Definition: types.h:184
rmw_context_t * context
Definition: types.h:46
RMW_SECURITY_ENFORCEMENT_ENFORCE
Definition: types.h:251
const char * implementation_identifier
Definition: types.h:113
void * data
Definition: types.h:139
RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT
Definition: types.h:271
struct RMW_PUBLIC_TYPE rmw_liveliness_lost_status_t rmw_liveliness_lost_status_t
QoS Liveliness Lost information provided by a publisher.
RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL
Definition: types.h:279
Array of subscriber handles.
Definition: types.h:169
const char * implementation_identifier
Definition: types.h:67
Definition: types.h:237
struct RMW_PUBLIC_TYPE rmw_guard_conditions_t rmw_guard_conditions_t
Array of guard condition handles.
size_t capacity
Definition: types.h:347
size_t event_count
The number of events represented by the array.
Definition: types.h:210
const char * implementation_identifier
Definition: types.h:332
Definition: types.h:358
RMW_QOS_POLICY_HISTORY_KEEP_ALL
Definition: types.h:271
void ** guard_conditions
Pointer to an array of void * pointers of guard conditions.
Definition: types.h:227
Definition: types.h:357
size_t subscriber_count
The number of subscribers represented by the array.
Definition: types.h:172
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:225
enum RMW_PUBLIC_TYPE rmw_qos_history_policy_t
Definition: types.h:269
void * data
Definition: types.h:68
struct RMW_PUBLIC_TYPE rmw_subscription_allocation_t rmw_subscription_allocation_t
enum RMW_PUBLIC_TYPE rmw_log_severity_t
Type mapping of rcutils log severity types to rmw specific types.
QoS Liveliness Lost information provided by a publisher.
Definition: types.h:404
Definition: types.h:156
Definition: types.h:359
Options that can be used to configure the creation of a publisher in rmw.
Definition: types.h:50
struct RMW_PUBLIC_TYPE rmw_publisher_options_t rmw_publisher_options_t
Options that can be used to configure the creation of a publisher in rmw.
Definition: types.h:355
Definition: types.h:356
struct RMW_PUBLIC_TYPE rmw_message_info_sequence_t rmw_message_info_sequence_t
RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_NODE
Definition: types.h:287
rmw_publisher_options_t options
Publisher options.
Definition: types.h:79
void * data
Definition: types.h:114
int32_t total_count_change
The change in total_count since the last time the status was last read.
Definition: types.h:414
struct RMW_PUBLIC_TYPE rmw_clients_t rmw_clients_t
Array of client handles.
void * data
Definition: types.h:43
const char * implementation_identifier
Definition: types.h:145
enum RMW_PUBLIC_TYPE rmw_qos_durability_policy_t
Definition: types.h:277
Definition: types.h:111
struct RMW_PUBLIC_TYPE rmw_service_t rmw_service_t
QoS Requested Deadline Missed information provided by a subscription.
Definition: types.h:390
Initialization context structure which is used to store init specific information.
Definition: init.h:37
RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT
Definition: types.h:279
uint64_t sec
Definition: types.h:245
const char * service_name
Definition: types.h:140
RMW_QOS_POLICY_DURABILITY_VOLATILE
Definition: types.h:279
size_t service_count
The number of services represented by the array.
Definition: types.h:187
const char * implementation_identifier
Definition: types.h:152
bool from_intra_process
Definition: types.h:340
void ** subscribers
Pointer to an array of void * pointers of subscriptions.
Definition: types.h:174
void * data
Definition: types.h:153
int32_t alive_count
Definition: types.h:373
size_t size
Definition: types.h:346
RMW_QOS_POLICY_HISTORY_KEEP_LAST
Definition: types.h:271
Definition: types.h:136
int32_t total_count
Definition: types.h:426
enum RMW_PUBLIC_TYPE rmw_qos_reliability_policy_t
Definition: types.h:261
struct RMW_PUBLIC_TYPE rmw_client_t rmw_client_t
Definition: types.h:330
RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT
Definition: types.h:263
int32_t not_alive_count_change
The change in the not_alive_count since the status was last read.
Definition: types.h:386
bool can_loan_messages
Definition: types.h:126
rmw_context_t * context
Definition: types.h:147
struct RMW_PUBLIC_TYPE rmw_publisher_allocation_t rmw_publisher_allocation_t
struct RMW_PUBLIC_TYPE rmw_offered_deadline_missed_status_t rmw_offered_deadline_missed_status_t
QoS Deadline Missed information provided by a publisher.
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
Size of the message queue.
Definition: types.h:303
RMW_PUBLIC_TYPE
Type mapping of rcutils log severity types to rmw specific types.
Definition: types.h:353
struct RMW_PUBLIC_TYPE rmw_liveliness_changed_status_t rmw_liveliness_changed_status_t
QoS Liveliness Changed information provided by a subscription.
const char * namespace_
Definition: types.h:45
const char * service_name
Definition: types.h:133
void * rmw_specific_publisher_payload
Used to pass rmw implementation specific resources during publisher creation.
Definition: types.h:62
void ** clients
Pointer to an array of void * pointers of clients.
Definition: types.h:204
int64_t sequence_number
Definition: types.h:240
void * data
Definition: types.h:159
const char * implementation_identifier
Definition: types.h:138
const char * topic_name
Definition: types.h:115
rmw_message_info_t * message_info_sequence
Definition: types.h:345
Definition: types.h:207
rmw_gid_t publisher_gid
Definition: types.h:339
struct RMW_PUBLIC_TYPE rmw_qos_profile_t rmw_qos_profile_t
ROS MiddleWare quality of service profile.
int32_t not_alive_count
Definition: types.h:382
struct RMW_PUBLIC_TYPE rmw_subscriptions_t rmw_subscriptions_t
Array of subscriber handles.
const char * name
Definition: types.h:44
Definition: types.h:150
rmw_guard_conditions_t * guard_conditions
Definition: types.h:233
RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT
Definition: types.h:263
Definition: types.h:230
int32_t alive_count_change
The change in the alive_count since the status was last read.
Definition: types.h:384
void * data
Definition: types.h:132
struct RMW_PUBLIC_TYPE rmw_gid_t rmw_gid_t
Definition: types.h:243
int32_t total_count
Definition: types.h:398
const char * implementation_identifier
Definition: types.h:42
void ** events
Pointer to an array of void * pointers of events.
Definition: types.h:212
RCUTILS_LOG_SEVERITY_FATAL
size_t client_count
The number of clients represented by the array.
Definition: types.h:202
Definition: types.h:143
Definition: types.h:129
Definition: types.h:255
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:222
struct RMW_PUBLIC_TYPE rmw_events_t rmw_events_t
Definition: types.h:65
Array of client handles.
Definition: types.h:199
enum RMW_PUBLIC_TYPE rmw_qos_liveliness_policy_t
Definition: types.h:285
enum RMW_PUBLIC_TYPE rmw_security_enforcement_policy_t
Definition: types.h:249
struct RMW_PUBLIC_TYPE rmw_message_info_t rmw_message_info_t
QoS Deadline Missed information provided by a publisher.
Definition: types.h:418
Definition: types.h:343
const char * implementation_identifier
Definition: types.h:158
struct RMW_PUBLIC_TYPE rmw_wait_set_t rmw_wait_set_t
int32_t total_count_change
The incremental number of deadlines detected since the status was read.
Definition: types.h:400
const char * implementation_identifier
Definition: types.h:131
RCUTILS_LOG_SEVERITY_DEBUG
ROS MiddleWare quality of service profile.
Definition: types.h:299
QoS Liveliness Changed information provided by a subscription.
Definition: types.h:363
void * data
Definition: types.h:146
Definition: types.h:40
const char * security_root_path
Definition: types.h:258
struct RMW_PUBLIC_TYPE rmw_time_t rmw_time_t
RCUTILS_LOG_SEVERITY_ERROR
int32_t total_count
Definition: types.h:412
bool can_loan_messages
Definition: types.h:80
rmw_subscription_options_t options
Subscription options.
Definition: types.h:125
struct RMW_PUBLIC_TYPE rmw_services_t rmw_services_t
Array of service handles.