rclcpp
master
C++ ROS Client Library API
|
Store elements in a fixed-size, FIFO buffer. More...
#include <ring_buffer_implementation.hpp>
Public Member Functions | |
RingBufferImplementation (size_t capacity) | |
virtual | ~RingBufferImplementation () |
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 () |
Public Member Functions inherited from rclcpp::experimental::buffers::BufferImplementationBase< BufferT > | |
virtual | ~BufferImplementationBase () |
Store elements in a fixed-size, FIFO buffer.
All public member functions are thread-safe.
|
inlineexplicit |
|
inlinevirtual |
|
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 >.
|
inlinevirtual |
Remove the oldest element from ring buffer.
This member function is thread-safe.
Implements rclcpp::experimental::buffers::BufferImplementationBase< BufferT >.
|
inline |
Get the next index value for the ring buffer.
This member function is thread-safe.
val | the current index value |
|
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 >.
|
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
|
inlinevirtual |