From 5d0f70767750b6093e692c0d98ca802d750aba36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Fri, 20 Dec 2024 21:31:45 +0100 Subject: [PATCH] Deprecate RealtimeClock class (#244) --- include/realtime_tools/realtime_clock.hpp | 2 +- test/realtime_clock_tests.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/realtime_tools/realtime_clock.hpp b/include/realtime_tools/realtime_clock.hpp index 6be35449..8f4ca26a 100644 --- a/include/realtime_tools/realtime_clock.hpp +++ b/include/realtime_tools/realtime_clock.hpp @@ -43,7 +43,7 @@ namespace realtime_tools { -class RealtimeClock +class [[deprecated("Use rclcpp::Clock or std::chrono::steady_clock instead")]] RealtimeClock { public: /** diff --git a/test/realtime_clock_tests.cpp b/test/realtime_clock_tests.cpp index c7f3e572..ed986e45 100644 --- a/test/realtime_clock_tests.cpp +++ b/test/realtime_clock_tests.cpp @@ -34,6 +34,10 @@ #include "rclcpp/utilities.hpp" #include "realtime_tools/realtime_clock.hpp" +// Disable deprecated warnings +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + using realtime_tools::RealtimeClock; TEST(RealtimeClock, get_system_time) @@ -59,3 +63,5 @@ TEST(RealtimeClock, get_system_time) } rclcpp::shutdown(); } + +#pragma GCC diagnostic pop