Function rcutils_string_map_get_capacity

Function Documentation

rcutils_ret_t rcutils_string_map_get_capacity(const rcutils_string_map_t *string_map, size_t *capacity)

Get the current capacity of the string map.

This function will return the internal capacity of the map, which is the maximum number of key value pairs the map could hold. The capacity can be set initially with rcutils_string_map_init() or with rcutils_string_map_reserve(). The capacity does not indicate how many key value paris are stored in the map, the rcutils_string_map_get_size() function can provide that.

Parameters:
  • string_map[in] rcutils_string_map_t to be queried

  • capacity[out] capacity of the string map

Returns:

RCUTILS_RET_OK if successful, or

Returns:

RCUTILS_RET_INVALID_ARGUMENT for invalid arguments, or

Returns:

RCUTILS_RET_STRING_MAP_INVALID if the string map is invalid, or

Returns:

RCUTILS_RET_ERROR if an unknown error occurs.