Function rcutils_hash_map_unset

Function Documentation

rcutils_ret_t rcutils_hash_map_unset(rcutils_hash_map_t *hash_map, const void *key)

Unset a key value pair in the hash_map.

Unsets the key value pair in the hash_map and frees any internal resources allocated for the entry. This function will never decrease the capacity when removing keys. If the given key is not found, RCUTILS_RET_STRING_KEY_NOT_FOUND is returned.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • hash_map[inout] rcutils_hash_map_t to be updated

  • key[in] hash_map key, must be null terminated c string

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_STRING_KEY_NOT_FOUND if the key is not found in the map, or

Returns:

RCUTILS_RET_ERROR if an unknown error occurs.