rcl  master
C API providing common ROS client library functionality.
event.h
Go to the documentation of this file.
1 // Copyright 2019 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__EVENT_H_
16 #define RCL__EVENT_H_
17 
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include "rcl/client.h"
24 #include "rcl/macros.h"
25 #include "rcl/publisher.h"
26 #include "rcl/service.h"
27 #include "rcl/subscription.h"
28 #include "rcl/visibility_control.h"
29 
31 {
35 
37 {
41 
43 typedef struct rmw_event_t rmw_event_t;
44 
46 struct rcl_event_impl_t;
47 
49 typedef struct rcl_event_t
50 {
51  struct rcl_event_impl_t * impl;
52 } rcl_event_t;
53 
55 
63 
65 
79  rcl_event_t * event,
80  const rcl_publisher_t * publisher,
81  const rcl_publisher_event_type_t event_type);
82 
84 
98  rcl_event_t * event,
99  const rcl_subscription_t * subscription,
100  const rcl_subscription_event_type_t event_type);
101 
102 // Take event using the event handle.
115 rcl_ret_t
117  const rcl_event_t * event,
118  void * event_info);
119 
120 // Finalize an event.
131 rcl_ret_t
132 rcl_event_fini(rcl_event_t * event);
133 
135 
162 rmw_event_t *
164 
165 #ifdef __cplusplus
166 }
167 #endif
168 
169 #endif // RCL__EVENT_H_
rcl_ret_t rcl_event_fini(rcl_event_t *event)
struct rcl_event_t rcl_event_t
Structure which encapsulates a ROS QoS event handle.
rcl_ret_t rcl_subscription_event_init(rcl_event_t *event, const rcl_subscription_t *subscription, const rcl_subscription_event_type_t event_type)
Initialize an rcl_event_t with a subscription.
rmw_ret_t rcl_ret_t
Definition: types.h:20
Structure which encapsulates a ROS QoS event handle.
Definition: event.h:49
rcl_ret_t rcl_take_event(const rcl_event_t *event, void *event_info)
rmw_event_t * rcl_event_get_rmw_handle(const rcl_event_t *event)
Return the rmw event handle.
struct rcl_event_impl_t * impl
Definition: event.h:51
#define RCL_WARN_UNUSED
Ignored return values of functions with this macro will emit a warning.
Definition: macros.h:25
#define RCL_PUBLIC
Definition: visibility_control.h:48
rcl_publisher_event_type_t
Definition: event.h:30
rcl_ret_t rcl_publisher_event_init(rcl_event_t *event, const rcl_publisher_t *publisher, const rcl_publisher_event_type_t event_type)
Initialize an rcl_event_t with a publisher.
Structure which encapsulates a ROS Subscription.
Definition: subscription.h:33
Structure which encapsulates a ROS Publisher.
Definition: publisher.h:33
rcl_event_t rcl_get_zero_initialized_event(void)
Return a rcl_event_t struct with members set to NULL.
Definition: event.h:33
rcl_subscription_event_type_t
Definition: event.h:36