Skip to content

Commit f13ffb2

Browse files
author
Mauro Passerino
committed
use void * to pass executor ptr
1 parent b39ab21 commit f13ffb2

15 files changed

+16
-18
lines changed

rclcpp/include/rclcpp/client.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class ClientBase
159159
RCLCPP_PUBLIC
160160
void
161161
set_events_executor_callback(
162-
const rclcpp::executors::EventsExecutor * executor,
162+
rclcpp::executors::EventsExecutor * executor,
163163
rmw_listener_callback_t executor_callback) const;
164164

165165
protected:

rclcpp/include/rclcpp/executors/events_executor.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,16 +185,14 @@ class EventsExecutor : public rclcpp::Executor
185185
// This function is called by the DDS entities when an event happened,
186186
// like a subscription receiving a message.
187187
static void
188-
push_event(const void * executor_ptr, rmw_listener_event_t event)
188+
push_event(void * executor_ptr, rmw_listener_event_t event)
189189
{
190190
// Check if the executor pointer is not valid
191191
if (!executor_ptr) {
192192
throw std::runtime_error("The executor pointer is not valid.");
193193
}
194194

195-
// Cast executor_ptr to this (need to remove constness)
196-
auto this_executor = const_cast<executors::EventsExecutor *>(
197-
static_cast<const executors::EventsExecutor *>(executor_ptr));
195+
auto this_executor = static_cast<executors::EventsExecutor *>(executor_ptr);
198196

199197
// Event queue mutex scope
200198
{

rclcpp/include/rclcpp/executors/events_executor_notify_waitable.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class EventsExecutorNotifyWaitable final : public EventWaitable
6161
RCLCPP_PUBLIC
6262
void
6363
set_events_executor_callback(
64-
const rclcpp::executors::EventsExecutor * executor,
64+
rclcpp::executors::EventsExecutor * executor,
6565
rmw_listener_callback_t executor_callback) const override
6666
{
6767
for (auto gc : notify_guard_conditions_) {

rclcpp/include/rclcpp/experimental/subscription_intra_process_base.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class SubscriptionIntraProcessBase : public rclcpp::Waitable
7777
RCLCPP_PUBLIC
7878
void
7979
set_events_executor_callback(
80-
const rclcpp::executors::EventsExecutor * executor,
80+
rclcpp::executors::EventsExecutor * executor,
8181
rmw_listener_callback_t executor_callback) const override;
8282

8383
protected:

rclcpp/include/rclcpp/qos_event.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class QOSEventHandlerBase : public Waitable
111111
RCLCPP_PUBLIC
112112
void
113113
set_events_executor_callback(
114-
const rclcpp::executors::EventsExecutor * executor,
114+
rclcpp::executors::EventsExecutor * executor,
115115
rmw_listener_callback_t executor_callback) const override;
116116

117117
protected:

rclcpp/include/rclcpp/service.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class ServiceBase
129129
RCLCPP_PUBLIC
130130
void
131131
set_events_executor_callback(
132-
const rclcpp::executors::EventsExecutor * executor,
132+
rclcpp::executors::EventsExecutor * executor,
133133
rmw_listener_callback_t executor_callback) const;
134134

135135
protected:

rclcpp/include/rclcpp/subscription_base.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ class SubscriptionBase : public std::enable_shared_from_this<SubscriptionBase>
272272
RCLCPP_PUBLIC
273273
void
274274
set_events_executor_callback(
275-
const rclcpp::executors::EventsExecutor * executor,
275+
rclcpp::executors::EventsExecutor * executor,
276276
rmw_listener_callback_t executor_callback) const;
277277

278278
protected:

rclcpp/include/rclcpp/waitable.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class Waitable
212212
virtual
213213
void
214214
set_events_executor_callback(
215-
const rclcpp::executors::EventsExecutor * executor,
215+
rclcpp::executors::EventsExecutor * executor,
216216
rmw_listener_callback_t executor_callback) const;
217217

218218
private:

rclcpp/src/rclcpp/client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ ClientBase::exchange_in_use_by_wait_set_state(bool in_use_state)
201201

202202
void
203203
ClientBase::set_events_executor_callback(
204-
const rclcpp::executors::EventsExecutor * executor,
204+
rclcpp::executors::EventsExecutor * executor,
205205
rmw_listener_callback_t executor_callback) const
206206
{
207207
rcl_ret_t ret = rcl_client_set_listener_callback(

rclcpp/src/rclcpp/qos_event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ QOSEventHandlerBase::is_ready(rcl_wait_set_t * wait_set)
7070

7171
void
7272
QOSEventHandlerBase::set_events_executor_callback(
73-
const rclcpp::executors::EventsExecutor * executor,
73+
rclcpp::executors::EventsExecutor * executor,
7474
rmw_listener_callback_t executor_callback) const
7575
{
7676
rcl_ret_t ret = rcl_event_set_listener_callback(

rclcpp/src/rclcpp/service.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ ServiceBase::exchange_in_use_by_wait_set_state(bool in_use_state)
8787

8888
void
8989
ServiceBase::set_events_executor_callback(
90-
const rclcpp::executors::EventsExecutor * executor,
90+
rclcpp::executors::EventsExecutor * executor,
9191
rmw_listener_callback_t executor_callback) const
9292
{
9393
rcl_ret_t ret = rcl_service_set_listener_callback(

rclcpp/src/rclcpp/subscription_base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ SubscriptionBase::exchange_in_use_by_wait_set_state(
291291

292292
void
293293
SubscriptionBase::set_events_executor_callback(
294-
const rclcpp::executors::EventsExecutor * executor,
294+
rclcpp::executors::EventsExecutor * executor,
295295
rmw_listener_callback_t executor_callback) const
296296
{
297297
rcl_ret_t ret = rcl_subscription_set_listener_callback(

rclcpp/src/rclcpp/subscription_intra_process_base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ SubscriptionIntraProcessBase::get_actual_qos() const
3939

4040
void
4141
SubscriptionIntraProcessBase::set_events_executor_callback(
42-
const rclcpp::executors::EventsExecutor * executor,
42+
rclcpp::executors::EventsExecutor * executor,
4343
rmw_listener_callback_t executor_callback) const
4444
{
4545
rcl_ret_t ret = rcl_guard_condition_set_listener_callback(

rclcpp/src/rclcpp/waitable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Waitable::exchange_in_use_by_wait_set_state(bool in_use_state)
6262

6363
void
6464
Waitable::set_events_executor_callback(
65-
const rclcpp::executors::EventsExecutor * executor,
65+
rclcpp::executors::EventsExecutor * executor,
6666
rmw_listener_callback_t executor_callback) const
6767
{
6868
(void)executor;

rclcpp/test/rclcpp/executors/test_executors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ class TestWaitable : public rclcpp::Waitable
469469

470470
void
471471
set_events_executor_callback(
472-
const rclcpp::executors::EventsExecutor * executor,
472+
rclcpp::executors::EventsExecutor * executor,
473473
rmw_listener_callback_t executor_callback) const override
474474
{
475475
rcl_ret_t ret = rcl_guard_condition_set_listener_callback(

0 commit comments

Comments
 (0)