Function rmw_service_endpoint_info_array_init_with_size
Defined in File service_endpoint_info_array.h
Function Documentation
-
rmw_ret_t rmw_service_endpoint_info_array_init_with_size(rmw_service_endpoint_info_array_t *service_endpoint_info_array, size_t size, rcutils_allocator_t *allocator)
Initialize an array of service endpoint information.
This function allocates space to hold
sizeservice endpoint information elements. Bothinfo_arrayandsizemembers are updated accordingly.Attribute
Adherence
Allocates Memory
Yes
Thread-Safe
No
Uses Atomics
No
Lock-Free
Yes
Remark
This function sets the RMW error state on failure.
- Thread-safety
Initialization is a reentrant procedure, but:
Access to the array of service endpoint information is not synchronized. It is not safe to read or write
service_endpoint_info_arrayduring initialization.The default allocators are thread-safe objects, but any custom
allocatormay not be. Check your allocator documentation for further reference.
- Parameters:
service_endpoint_info_array – [inout] Array to be initialized on success, but left unchanged on failure.
size – [in] Size of the array.
allocator – [in] Allocator to be used to populate
names_and_types.
- Returns:
RMW_RET_OKif successful, or- Returns:
RMW_RET_INVALID_ARGUMENTifservice_endpoint_info_arrayis NULL, or- Returns:
RMW_RET_INVALID_ARGUMENTifservice_endpoint_info_arrayis not a zero initialized array, or- Returns:
RMW_RET_INVALID_ARGUMENTifallocatoris invalid, by rcutils_allocator_is_valid() definition, or- Returns:
RMW_BAD_ALLOCif memory allocation fails, or- Returns:
RMW_RET_ERRORwhen an unspecified error occurs.