Skip to content

Commit

Permalink
Implement the pure-virtual functions in the Waitable class. (#548)
Browse files Browse the repository at this point in the history
* Implement the pure-virtual functions in the Waitable class.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
  • Loading branch information
clalancette authored Aug 2, 2024
1 parent 1026322 commit 5f73908
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion test_rclcpp/test/test_waitable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,24 @@
// limitations under the License.

#include <chrono>
#include <cstddef>
#include <functional>
#include <future>
#include <memory>
#include <stdexcept>

#include "gtest/gtest.h"

#include "rclcpp/rclcpp.hpp"
#include "rcl/allocator.h"
#include "rcl/time.h"
#include "rcl/timer.h"

#include "rclcpp/callback_group.hpp"
#include "rclcpp/clock.hpp"
#include "rclcpp/contexts/default_context.hpp"
#include "rclcpp/executors.hpp"
#include "rclcpp/node.hpp"
#include "rclcpp/waitable.hpp"

class WaitableWithTimer : public rclcpp::Waitable
{
Expand Down Expand Up @@ -87,6 +99,11 @@ class WaitableWithTimer : public rclcpp::Waitable
execute_promise_.set_value(RCL_RET_OK == ret);
}

void set_on_ready_callback(std::function<void(size_t, int)>) override {}
void clear_on_ready_callback() override {}

std::shared_ptr<void> take_data_by_entity_id(size_t) override {return nullptr;}

std::shared_ptr<rcl_timer_t> timer_;
size_t timer_idx_;
std::promise<bool> execute_promise_;
Expand Down

0 comments on commit 5f73908

Please sign in to comment.