Function rosidl_runtime_c_type_description_utils_get_referenced_type_description_map
Defined in File type_description_utils.h
Function Documentation
-
rcutils_ret_t rosidl_runtime_c_type_description_utils_get_referenced_type_description_map(const rosidl_runtime_c__type_description__IndividualTypeDescription__Sequence *referenced_types, const rcutils_allocator_t *allocator, rcutils_hash_map_t **hash_map)
Construct a hash map of an
IndividualTypeDescription__Sequence
’sIndividualTypeDescription
objects, keyed by type name. Thehash_map
output arg must be passed in pointing toNULL
. Furthermore, if the inputreferenced_types
sequence has types with identical names but differing structures, this function will returnRCUTILS_RET_INVALID_ARGUMENT
and fail.Ownership:
The caller assumes ownership of the output
rcutils_hash_map_t
and must free it and its elements, but NOT finalize its values.The output
rcutils_hash_map_t
has values that borrows thereferenced_types
arg’sIndividualTypeDescription
elements. It is not authorized to deallocate them and it cannot outlive thereferenced_types
it borrows from.Finalizing the output
rcutils_hash_map_t
should not result in its values getting finalized.
Attribute
Adherence
Allocates Memory
Yes
Thread-Safe
No
Uses Atomics
No
Lock-Free
Yes
- Parameters:
referenced_types – [in] the referenced individual type descriptions to get the referenced types from
allocator – [in] the allocator to use through out the lifetime of the hash_map
hash_map – [out]
rcutils_hash_map_t
to be initialized, containingIndividualTypeDescription
objects keyed by their type names. Must point toNULL
, outputs pointing toNULL
if error.
- Returns:
#RCUTILS_RET_OK if successful, or
- Returns:
#RCUTILS_RET_BAD_ALLOC if memory allocation fails, or
- Returns:
#RCUTILS_RET_INVALID_ARGUMENT for invalid arguments, or
- Returns:
#RCUTILS_RET_ERROR if an unknown error occurs.