rclcpp
master
C++ ROS Client Library API
|
Completely static memory allocation strategy for messages. More...
#include <message_pool_memory_strategy.hpp>
Classes | |
struct | PoolMember |
Public Member Functions | |
MessagePoolMemoryStrategy () | |
Default constructor. More... | |
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::array< PoolMember, Size > | pool_ |
size_t | next_array_index_ |
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).
|
inline |
Default constructor.
|
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 >.
|
inlinevirtual |
Return a message to the message pool.
Manage metadata in the message pool ring buffer to release the message.
[in] | msg | Shared pointer to the message to return. |
Reimplemented from rclcpp::message_memory_strategy::MessageMemoryStrategy< MessageT >.
|
protected |
|
protected |