ROS 2 rclcpp + rcl - rolling
rolling-a919a6e5
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) override |
Add a new element to store in the ring buffer. More... | |
BufferT | dequeue () override |
Remove the oldest element from ring buffer. More... | |
std::vector< BufferT > | get_all_data () override |
Get all the elements from the ring buffer. More... | |
size_t | next (size_t val) |
Get the next index value for the ring buffer. More... | |
bool | has_data () const override |
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... | |
size_t | available_capacity () const override |
Get the remaining capacity to store messages. More... | |
void | clear () override |
Store elements in a fixed-size, FIFO buffer.
All public member functions are thread-safe.
Definition at line 43 of file ring_buffer_implementation.hpp.
|
inlineoverridevirtual |
Get the remaining capacity to store messages.
This member function is thread-safe.
Implements rclcpp::experimental::buffers::BufferImplementationBase< BufferT >.
Definition at line 172 of file ring_buffer_implementation.hpp.
|
inlineoverridevirtual |
Remove the oldest element from ring buffer.
This member function is thread-safe.
Implements rclcpp::experimental::buffers::BufferImplementationBase< BufferT >.
Definition at line 96 of file ring_buffer_implementation.hpp.
|
inlineoverridevirtual |
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 70 of file ring_buffer_implementation.hpp.
|
inlineoverridevirtual |
Get all the elements from the ring buffer.
This member function is thread-safe.
Implements rclcpp::experimental::buffers::BufferImplementationBase< BufferT >.
Definition at line 123 of file ring_buffer_implementation.hpp.
|
inlineoverridevirtual |
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 147 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 160 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 135 of file ring_buffer_implementation.hpp.