Function rmw_init_subscription_allocation
Defined in File rmw.h
Function Documentation
-
rmw_ret_t rmw_init_subscription_allocation(const rosidl_message_type_support_t *type_support, const rosidl_runtime_c__Sequence__bound *message_bounds, rmw_subscription_allocation_t *allocation)
Initialize a subscription allocation to be used with later
take
s.This creates an allocation object that can be used in conjunction with the rmw_take method to perform more carefully control memory allocations.
This will allow the middleware to preallocate the correct amount of memory for a given message type and message bounds. As allocation is performed in this method, it will not be necessary to allocate in the
rmw_take
method.- Parameters:
type_support – [in] Type support of the message to be preallocated.
message_bounds – [in] Bounds structure of the message to be preallocated.
allocation – [out] Allocation structure to be passed to
rmw_take
.
- Returns:
RMW_RET_OK
if successful, or- Returns:
RMW_RET_UNSUPPORTED
if it’s unimplemented- Returns:
RMW_RET_INVALID_ARGUMENT
if an argument is null, or- Returns:
RMW_RET_ERROR
if an unexpected error occurs.