rcl  master
C API providing common ROS client library functionality.
guard_condition.h
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 
15 #ifndef RCL__GUARD_CONDITION_H_
16 #define RCL__GUARD_CONDITION_H_
17 
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include "rcl/allocator.h"
24 #include "rcl/context.h"
25 #include "rcl/macros.h"
26 #include "rcl/types.h"
27 #include "rcl/visibility_control.h"
28 
30 struct rcl_guard_condition_impl_t;
31 
33 typedef struct rcl_guard_condition_t
34 {
37 
39  struct rcl_guard_condition_impl_t * impl;
41 
44 {
48 
50 RCL_PUBLIC
51 RCL_WARN_UNUSED
53 rcl_get_zero_initialized_guard_condition(void);
54 
56 
94 RCL_PUBLIC
95 RCL_WARN_UNUSED
96 rcl_ret_t
97 rcl_guard_condition_init(
98  rcl_guard_condition_t * guard_condition,
99  rcl_context_t * context,
100  const rcl_guard_condition_options_t options);
101 
103 
136 rcl_ret_t
137 rcl_guard_condition_init_from_rmw(
138  rcl_guard_condition_t * guard_condition,
139  const rmw_guard_condition_t * rmw_guard_condition,
140  rcl_context_t * context,
141  const rcl_guard_condition_options_t options);
142 
144 
162 RCL_PUBLIC
163 RCL_WARN_UNUSED
164 rcl_ret_t
165 rcl_guard_condition_fini(rcl_guard_condition_t * guard_condition);
166 
168 
173 RCL_PUBLIC
174 RCL_WARN_UNUSED
176 rcl_guard_condition_get_default_options(void);
177 
179 
200 RCL_PUBLIC
201 RCL_WARN_UNUSED
202 rcl_ret_t
203 rcl_trigger_guard_condition(rcl_guard_condition_t * guard_condition);
204 
206 
225 RCL_PUBLIC
226 RCL_WARN_UNUSED
228 rcl_guard_condition_get_options(const rcl_guard_condition_t * guard_condition);
229 
231 
256 RCL_PUBLIC
257 RCL_WARN_UNUSED
259 rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition);
260 
261 #ifdef __cplusplus
262 }
263 #endif
264 
265 #endif // RCL__GUARD_CONDITION_H_
rcl_guard_condition_t::impl
struct rcl_guard_condition_impl_t * impl
Pointer to the guard condition implementation.
Definition: guard_condition.h:39
rcl_guard_condition_options_t
Options available for a rcl guard condition.
Definition: guard_condition.h:43
rmw_guard_condition_t
rcl_guard_condition_t
Handle for a rcl guard condition.
Definition: guard_condition.h:33
rcl_guard_condition_options_t::allocator
rcl_allocator_t allocator
Custom allocator for the guard condition, used for internal allocations.
Definition: guard_condition.h:46
rcutils_allocator_t
rcl_context_t
Encapsulates the non-global state of an init/shutdown cycle.
Definition: context.h:108
rcl_guard_condition_t::context
rcl_context_t * context
Context associated with this guard condition.
Definition: guard_condition.h:36