Function rosidl_runtime_c_type_description_utils_copy_init_sequence_from_referenced_type_descriptions_map

Function Documentation

rcutils_ret_t rosidl_runtime_c_type_description_utils_copy_init_sequence_from_referenced_type_descriptions_map(const rcutils_hash_map_t *hash_map, rosidl_runtime_c__type_description__IndividualTypeDescription__Sequence **sequence, bool sort)

Deep copy a map of individual type descriptions into a new IndividualTypeDescription__Sequence.

The sequence output arg must be passed in pointing to NULL.

This method also validates that each IndividualTypeDescription in the map has a type name that matches the key it was indexed by.

Ownership:

  • The caller assumes ownership of the output IndividualTypeDescription__Sequence and must free it.

  • The output IndividualTypeDescription__Sequence deep copies the values from the hash_map arg and so has a separate lifetime from the hash_map.

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • hash_map[in] the referenced type descriptions map to convert (via deep copy) to a sequence

  • sequence[out] the IndividualTypeDescription__Sequence containing copies of the IndividualTypeDescription objects stored in the values of the input hash_map arg. Must point to NULL, outputs pointing to NULL if error.

  • sort[in] sorts the referenced type descriptions if true, best effort

Returns:

#RCUTILS_RET_OK if successful, or

Returns:

#RCUTILS_RET_INVALID_ARGUMENT for invalid arguments, or

Returns:

#RCUTILS_RET_BAD_ALLOC if memory allocation fails, or

Returns:

#RCUTILS_RET_ERROR if an unknown error occurs.