cdcontainers
0.1.1
Library of data containers and collections for C programming language.
|
Functions | |
static void | cdc_map_clear (struct cdc_map *m) |
Removes all the elements from the map. More... | |
static enum cdc_stat | cdc_map_insert (struct cdc_map *m, void *key, void *value, struct cdc_map_iter *it, bool *inserted) |
Inserts an element into the container, if the container doesn't already contain an element with an equivalent key. More... | |
static enum cdc_stat | cdc_map_insert_or_assign (struct cdc_map *m, void *key, void *value, struct cdc_map_iter *it, bool *inserted) |
Inserts an element or assigns to the current element if the key already exists. More... | |
static size_t | cdc_map_erase (struct cdc_map *m, void *key) |
Removes the element (if one exists) with the key equivalent to key. More... | |
static void | cdc_map_swap (struct cdc_map *a, struct cdc_map *b) |
Swaps maps a and b. This operation is very fast and never fails. More... | |
|
inlinestatic |
Removes all the elements from the map.
[in] | m | - cdc_map |
|
inlinestatic |
Inserts an element into the container, if the container doesn't already contain an element with an equivalent key.
[in] | m | - cdc_map |
[in] | key | - key of the element |
[in] | value | - value of the element |
[out] | it | - iterator to the inserted element (or to the element that prevented the insertion). The pointer can be equal to NULL. |
[out] | inserted | - bool denoting whether the insertion took place. The pointer can be equal to NULL. |
|
inlinestatic |
Inserts an element or assigns to the current element if the key already exists.
[in] | m | - cdc_map |
[in] | key | - key of the element |
[in] | value | - value of the element |
[out] | it | - iterator is pointing at the element that was inserted or updated. The pointer can be equal to NULL |
[out] | inserted | - bool is true if the insertion took place and false if the assignment took place. The pointer can be equal to NULL |
|
inlinestatic |
Removes the element (if one exists) with the key equivalent to key.
[in] | m | - cdc_map |
[in] | key | - key value of the elements to remove |