Function rmw_topic_endpoint_info_array_init_with_size
Defined in File topic_endpoint_info_array.h
Function Documentation
-
rmw_ret_t rmw_topic_endpoint_info_array_init_with_size(rmw_topic_endpoint_info_array_t *topic_endpoint_info_array, size_t size, rcutils_allocator_t *allocator)
Initialize an array of topic endpoint information.
This function allocates space to hold
sizetopic 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 topic endpoint information is not synchronized. It is not safe to read or write
topic_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:
topic_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_ARGUMENTiftopic_endpoint_info_arrayis NULL, or- Returns:
RMW_RET_INVALID_ARGUMENTiftopic_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.