Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure to mark RingBuffer methods as 'override'. #2410

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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