ROS 2 rclcpp + rcl - jazzy
jazzy
ROS 2 C++ Client Library with ROS Client Library
|
Completely static memory allocation strategy for messages. More...
#include <rclcpp/strategies/message_pool_memory_strategy.hpp>
Classes | |
class | CircularArray |
Public Member Functions | |
std::shared_ptr< MessageT > | borrow_message () |
Borrow a message from the message pool. More... | |
void | return_message (std::shared_ptr< MessageT > &msg) |
Return a message to the message pool. More... | |
Protected Attributes | |
std::shared_ptr< std::mutex > | pool_mutex_ |
std::shared_ptr< std::array< MessageT *, Size > > | pool_ |
std::shared_ptr< CircularArray< Size > > | free_list_ |
Additional Inherited Members |
Completely static memory allocation strategy for messages.
Templated on the type of message pooled by this class and the size of the message pool. Templating allows the program to determine the memory required for this object at compile time. The size of the message pool should be at least the largest number of concurrent accesses to the subscription (usually the number of threads).
Definition at line 54 of file message_pool_memory_strategy.hpp.
|
inlinevirtual |
Borrow a message from the message pool.
Manage the message pool ring buffer. Throw an exception if the next message was not available.
Reimplemented from rclcpp::message_memory_strategy::MessageMemoryStrategy< MessageT, Alloc >.
Definition at line 87 of file message_pool_memory_strategy.hpp.
|
inlinevirtual |
Return a message to the message pool.
This does nothing since the message isn't returned to the pool until the user has dropped all references.
[in] | msg | Shared pointer to the message to return. |
Reimplemented from rclcpp::message_memory_strategy::MessageMemoryStrategy< MessageT, Alloc >.
Definition at line 117 of file message_pool_memory_strategy.hpp.