Function rcutils_string_map_copy

Function Documentation

rcutils_ret_t rcutils_string_map_copy(const rcutils_string_map_t *src_string_map, rcutils_string_map_t *dst_string_map)

Copy all the key value pairs from one map into another, overwritting and resizing if needed.

If the destination string map does not have enough storage, then it is will be resized. If a key value pair exists in the destination map, its value will be replaced with the source map’s value.

It is possible for only some of the values to be copied if an error happens during the copying process, e.g. if memory allocation fails.

Parameters:
  • src_string_map[in] rcutils_string_map_t to be copied from

  • dst_string_map[inout] rcutils_string_map_t to be copied to

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_STRING_MAP_INVALID if the string map is invalid, or

Returns:

RCUTILS_RET_ERROR if an unknown error occurs.