Function rosidl_runtime_c_type_description_utils_get_field_map
Defined in File type_description_utils.h
Function Documentation
-
rcutils_ret_t rosidl_runtime_c_type_description_utils_get_field_map(const rosidl_runtime_c__type_description__IndividualTypeDescription *individual_description, const rcutils_allocator_t *allocator, rcutils_hash_map_t **hash_map)
Construct a hash map of an
IndividualTypeDescription
’sField
objects, keyed by field name.NOTE: The
hash_map
output arg must be passed in pointing toNULL
.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 theindividual_description
arg’sField
objects. It is not authorized to deallocate them and it cannot outlive the owner it borrows from.Finalizing the
rcutils_hash_map_t
should not result in the map’s values getting finalized.
Attribute
Adherence
Allocates Memory
Yes
Thread-Safe
No
Uses Atomics
No
Lock-Free
Yes
- Parameters:
individual_description – [in] the individual type description to get the fields 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, containingField
objects keyed by their field 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.