Function rcutils_hash_map_get_capacity

Function Documentation

rcutils_ret_t rcutils_hash_map_get_capacity(const rcutils_hash_map_t *hash_map, size_t *capacity)

Get the current capacity of the hash_map.

This function will return the internal capacity of the hash_map, which is the number of buckets the hash_map uses to sort the keys. The capacity does not indicate how many key value pairs are stored in the hash_map, the rcutils_hash_map_get_size() function can provide that, nor the maximum number that can be stored without increasing the capacity. The capacity can be set initially with rcutils_hash_map_init().

Attribute

Adherence

Allocates Memory

No

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • hash_map[in] rcutils_hash_map_t to be queried

  • capacity[out] capacity of the hash_map

Returns:

RCUTILS_RET_OK if successful, or

Returns:

RCUTILS_RET_INVALID_ARGUMENT for invalid arguments, or

Returns:

RCUTILS_RET_NOT_INITIALIZED if the hash_map is invalid, or

Returns:

RCUTILS_RET_ERROR if an unknown error occurs.