Skip to content

Commit d8c52b3

Browse files
committed
update waitable api to use refs and const correctly
Signed-off-by: William Woodall <[email protected]>
1 parent 5632a09 commit d8c52b3

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

rclcpp/include/rclcpp/waitable.hpp

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ class Waitable
101101
size_t
102102
get_number_of_ready_guard_conditions();
103103

104+
/// Deprecated.
105+
/**
106+
* \sa add_to_wait_set(rcl_wait_set_t &)
107+
*/
108+
[[deprecated("Use add_to_wait_set(rcl_wait_set_t & wait_set) signature")]]
109+
RCLCPP_PUBLIC
110+
virtual
111+
void
112+
add_to_wait_set(rcl_wait_set_t * wait_set) = 0;
113+
104114
/// Add the Waitable to a wait set.
105115
/**
106116
* \param[in] wait_set A handle to the wait set to add the Waitable to.
@@ -109,7 +119,17 @@ class Waitable
109119
RCLCPP_PUBLIC
110120
virtual
111121
void
112-
add_to_wait_set(rcl_wait_set_t * wait_set) = 0;
122+
add_to_wait_set(rcl_wait_set_t & wait_set) = 0;
123+
124+
/// Deprecated.
125+
/**
126+
* \sa is_ready(const rcl_wait_set_t &)
127+
*/
128+
[[deprecated("Use is_ready(const rcl_wait_set_t & wait_set) signature")]]
129+
RCLCPP_PUBLIC
130+
virtual
131+
bool
132+
is_ready(rcl_wait_set_t * wait_set) = 0;
113133

114134
/// Check if the Waitable is ready.
115135
/**
@@ -124,7 +144,7 @@ class Waitable
124144
RCLCPP_PUBLIC
125145
virtual
126146
bool
127-
is_ready(rcl_wait_set_t * wait_set) = 0;
147+
is_ready(const rcl_wait_set_t & wait_set) = 0;
128148

129149
/// Take the data so that it can be consumed with `execute`.
130150
/**
@@ -178,6 +198,16 @@ class Waitable
178198
std::shared_ptr<void>
179199
take_data_by_entity_id(size_t id);
180200

201+
/// Deprecated.
202+
/**
203+
* \sa execute(const std::shared_ptr<void> &)
204+
*/
205+
[[deprecated("Use execute(const std::shared_ptr<void> & data) signature")]]
206+
RCLCPP_PUBLIC
207+
virtual
208+
void
209+
execute(std::shared_ptr<void> & data) = 0;
210+
181211
/// Execute data that is passed in.
182212
/**
183213
* Before calling this method, the Waitable should be added to a wait set,
@@ -203,7 +233,7 @@ class Waitable
203233
RCLCPP_PUBLIC
204234
virtual
205235
void
206-
execute(std::shared_ptr<void> & data) = 0;
236+
execute(const std::shared_ptr<void> & data) = 0;
207237

208238
/// Exchange the "in use by wait set" state for this timer.
209239
/**

0 commit comments

Comments
 (0)