Skip to content

Commit

Permalink
Make sure to mark RingBuffer methods as 'override'. (#2410)
Browse files Browse the repository at this point in the history
This gets rid of a warning when building under clang.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette authored Jan 24, 2024
1 parent 676897d commit a29f58e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class RingBufferImplementation : public BufferImplementationBase<BufferT>
*
* \param request the element to be stored in the ring buffer
*/
void enqueue(BufferT request)
void enqueue(BufferT request) override
{
std::lock_guard<std::mutex> lock(mutex_);

Expand All @@ -93,7 +93,7 @@ class RingBufferImplementation : public BufferImplementationBase<BufferT>
*
* \return the element that is being removed from the ring buffer
*/
BufferT dequeue()
BufferT dequeue() override
{
std::lock_guard<std::mutex> lock(mutex_);

Expand Down Expand Up @@ -144,7 +144,7 @@ class RingBufferImplementation : public BufferImplementationBase<BufferT>
*
* \return `true` if there is data and `false` otherwise
*/
inline bool has_data() const
inline bool has_data() const override
{
std::lock_guard<std::mutex> lock(mutex_);
return has_data_();
Expand All @@ -169,13 +169,13 @@ class RingBufferImplementation : public BufferImplementationBase<BufferT>
*
* \return the number of free capacity for new messages
*/
size_t available_capacity() const
size_t available_capacity() const override
{
std::lock_guard<std::mutex> lock(mutex_);
return available_capacity_();
}

void clear()
void clear() override
{
TRACETOOLS_TRACEPOINT(rclcpp_ring_buffer_clear, static_cast<const void *>(this));
}
Expand Down

0 comments on commit a29f58e

Please sign in to comment.