|
ROS 2 rclcpp + rcl - humble
humble
ROS 2 C++ Client Library with ROS Client Library
|
Store elements in a fixed-size, FIFO buffer. More...
#include <rclcpp/experimental/buffers/ring_buffer_implementation.hpp>


Public Member Functions | |
| RingBufferImplementation (size_t capacity) | |
| void | enqueue (BufferT request) |
| Add a new element to store in the ring buffer. More... | |
| BufferT | dequeue () |
| Remove the oldest element from ring buffer. More... | |
| size_t | next (size_t val) |
| Get the next index value for the ring buffer. More... | |
| bool | has_data () const |
| Get if the ring buffer has at least one element stored. More... | |
| bool | is_full () const |
| Get if the size of the buffer is equal to its capacity. More... | |
| void | clear () |
Store elements in a fixed-size, FIFO buffer.
All public member functions are thread-safe.
Definition at line 41 of file ring_buffer_implementation.hpp.
|
inlinevirtual |
Remove the oldest element from ring buffer.
This member function is thread-safe.
Implements rclcpp::experimental::buffers::BufferImplementationBase< BufferT >.
Definition at line 84 of file ring_buffer_implementation.hpp.
|
inlinevirtual |
Add a new element to store in the ring buffer.
This member function is thread-safe.
| request | the element to be stored in the ring buffer |
Implements rclcpp::experimental::buffers::BufferImplementationBase< BufferT >.
Definition at line 64 of file ring_buffer_implementation.hpp.
|
inlinevirtual |
Get if the ring buffer has at least one element stored.
This member function is thread-safe.
true if there is data and false otherwise Implements rclcpp::experimental::buffers::BufferImplementationBase< BufferT >.
Definition at line 119 of file ring_buffer_implementation.hpp.
|
inline |
Get if the size of the buffer is equal to its capacity.
This member function is thread-safe.
true if the size of the buffer is equal is capacity and false otherwise Definition at line 132 of file ring_buffer_implementation.hpp.
|
inline |
Get the next index value for the ring buffer.
This member function is thread-safe.
| val | the current index value |
Definition at line 107 of file ring_buffer_implementation.hpp.