From a29f58edcbe3a0347d71d0fec3e2232d699ea918 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Wed, 24 Jan 2024 18:51:25 -0500 Subject: [PATCH] Make sure to mark RingBuffer methods as 'override'. (#2410) This gets rid of a warning when building under clang. Signed-off-by: Chris Lalancette --- .../buffers/ring_buffer_implementation.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rclcpp/include/rclcpp/experimental/buffers/ring_buffer_implementation.hpp b/rclcpp/include/rclcpp/experimental/buffers/ring_buffer_implementation.hpp index f476fa556a..b8fe79a5ff 100644 --- a/rclcpp/include/rclcpp/experimental/buffers/ring_buffer_implementation.hpp +++ b/rclcpp/include/rclcpp/experimental/buffers/ring_buffer_implementation.hpp @@ -67,7 +67,7 @@ class RingBufferImplementation : public BufferImplementationBase * * \param request the element to be stored in the ring buffer */ - void enqueue(BufferT request) + void enqueue(BufferT request) override { std::lock_guard lock(mutex_); @@ -93,7 +93,7 @@ class RingBufferImplementation : public BufferImplementationBase * * \return the element that is being removed from the ring buffer */ - BufferT dequeue() + BufferT dequeue() override { std::lock_guard lock(mutex_); @@ -144,7 +144,7 @@ class RingBufferImplementation : public BufferImplementationBase * * \return `true` if there is data and `false` otherwise */ - inline bool has_data() const + inline bool has_data() const override { std::lock_guard lock(mutex_); return has_data_(); @@ -169,13 +169,13 @@ class RingBufferImplementation : public BufferImplementationBase * * \return the number of free capacity for new messages */ - size_t available_capacity() const + size_t available_capacity() const override { std::lock_guard lock(mutex_); return available_capacity_(); } - void clear() + void clear() override { TRACETOOLS_TRACEPOINT(rclcpp_ring_buffer_clear, static_cast(this)); }