Go to the source code of this file.
◆ unordered_multiset
The unordered_multiset data structure, which is a collection of keys, hashed by keys.
◆ unordered_multiset_clear()
Clears the keys from the unordered multi-set.
- Parameters
-
me | the unordered multi-set to clear |
- Returns
- BK_OK if no error
-
-BK_ENOMEM if out of memory
◆ unordered_multiset_contains()
Determines if the unordered multi-set contains the specified element. The pointer to the key being passed in should point to the key type which this unordered multi-set holds. For example, if this unordered multi-set holds key integers, the key pointer should be a pointer to an integer. Since the key is being copied, the pointer only has to be valid when this function is called.
- Parameters
-
me | the unordered multi-set to check for the key |
key | the key to check |
- Returns
- BK_TRUE if the unordered multi-set contained the key, otherwise BK_FALSE
◆ unordered_multiset_count()
Determines the count of a specific key in the unordered multi-set. The pointer to the key being passed in should point to the key type which this unordered multi-set holds. For example, if this unordered multi-set holds key integers, the key pointer should be a pointer to an integer. Since the key is being copied, the pointer only has to be valid when this function is called.
- Parameters
-
me | the unordered multi-set to check for the count |
key | the element to check |
- Returns
- the count of a specific key in the unordered multi-set
◆ unordered_multiset_destroy()
Frees the unordered multi-set memory. Performing further operations after calling this function results in undefined behavior. Freeing NULL is legal, and causes no operation to be performed.
- Parameters
-
me | the unordered multi-set to free from memory |
- Returns
- NULL
◆ unordered_multiset_init()
unordered_multiset unordered_multiset_init |
( |
size_t |
key_size, |
|
|
unsigned long(*)(const void *const key) |
hash, |
|
|
int(*)(const void *const one, const void *const two) |
comparator |
|
) |
| |
◆ unordered_multiset_is_empty()
Determines whether or not the unordered multi-set is empty.
- Parameters
-
me | the unordered multi-set to check |
- Returns
- BK_TRUE if the unordered multi-set is empty, otherwise BK_FALSE
◆ unordered_multiset_put()
Adds an element to the unordered multi-set. The pointer to the key being passed in should point to the key type which this unordered multi-set holds. For example, if this multi-set holds key integers, the key pointer should be a pointer to an integer. Since the key is being copied, the pointer only has to be valid when this function is called.
- Parameters
-
me | the unordered multi-set to add to |
key | the element to add |
- Returns
- BK_OK if no error
-
-BK_ENOMEM if out of memory
◆ unordered_multiset_rehash()
Rehashes all the keys in the unordered multi-set. Used when storing references and changing the keys. This should rarely be used.
- Parameters
-
me | the unordered multi-set to rehash |
- Returns
- BK_OK if no error
-
-BK_ENOMEM if out of memory
◆ unordered_multiset_remove()
Removes a key from the unordered multi-set if it contains it. The pointer to the key being passed in should point to the key type which this unordered multi-set holds. For example, if this unordered multi-set holds key integers, the key pointer should be a pointer to an integer. Since the key is being copied, the pointer only has to be valid when this function is called.
- Parameters
-
me | the unordered multi-set to remove a key from |
key | the key to remove |
- Returns
- BK_TRUE if the unordered multi-set contained the key, otherwise BK_FALSE
◆ unordered_multiset_remove_all()
Removes all the keys specified by the key from an unordered multi-set if it contains the key. The pointer to the key being passed in should point to the key type which this multi-set holds. For example, if this multi-set holds key integers, the key pointer should be a pointer to an integer. Since the key is being copied, the pointer only has to be valid when this function is called.
- Parameters
-
me | the unordered multi-set to remove a key from |
key | the key to remove |
- Returns
- BK_TRUE if the unordered multi-set contained the key, otherwise BK_FALSE
◆ unordered_multiset_size()
Gets the size of the unordered multi-set.
- Parameters
-
me | the unordered multi-set to check |
- Returns
- the size of the unordered multi-set