Skip to content

Commit d9d2885

Browse files
author
Mauro Passerino
committed
Implement take_data only on derived classes
1 parent 17180b1 commit d9d2885

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

rclcpp/include/rclcpp/executors/event_waitable.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@ class EventWaitable : public rclcpp::Waitable
5353
return false;
5454
}
5555

56-
virtual
57-
std::shared_ptr<void>
58-
take_data()
59-
{
60-
throw std::runtime_error("Custom EventWaitable's should define their own take_data");
61-
return nullptr;
62-
}
63-
6456
// Stub API: not used by EventsExecutor
6557
RCLCPP_PUBLIC
6658
bool

rclcpp/include/rclcpp/executors/events_executor_entities_collector.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ class EventsExecutorEntitiesCollector final
192192
void
193193
add_waitable(rclcpp::Waitable::SharedPtr waitable);
194194

195+
RCLCPP_PUBLIC
196+
std::shared_ptr<void>
197+
take_data()
198+
{
199+
// This waitable doesn't handle any data
200+
return nullptr;
201+
}
202+
195203
private:
196204
void
197205
set_callback_group_entities_callbacks(rclcpp::CallbackGroup::SharedPtr group);

rclcpp/include/rclcpp/executors/events_executor_notify_waitable.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,11 @@ class EventsExecutorNotifyWaitable final : public EventWaitable
7777
}
7878
}
7979

80-
8180
RCLCPP_PUBLIC
8281
std::shared_ptr<void>
83-
take_data() override
82+
take_data()
8483
{
85-
// This waitable doesn't handle any data, return void ptr
84+
// This waitable doesn't handle any data
8685
return nullptr;
8786
}
8887

0 commit comments

Comments
 (0)