libcstl
Loading...
Searching...
No Matches
Data Structures | Functions
map.h File Reference

Go to the source code of this file.

Data Structures

struct  cstl_map_t
 The map object. More...
 
struct  cstl_map_iterator_t
 A pointer to an element within the map. More...
 

Functions

void cstl_map_init (cstl_map_t *map, cstl_compare_func_t *cmp, void *priv)
 Initialize a map.
 
static size_t cstl_map_size (const cstl_map_t *const map)
 Return the number of elements in the map.
 
int cstl_map_insert (cstl_map_t *map, const void *key, void *val, cstl_map_iterator_t *i)
 Insert a key/value pair into the map.
 
void cstl_map_find (const cstl_map_t *map, const void *key, cstl_map_iterator_t *i)
 Find an element in the map with a matching key.
 
int cstl_map_erase (cstl_map_t *map, const void *key, cstl_map_iterator_t *i)
 Erase the element with the supplied key from the map.
 
void cstl_map_erase_iterator (cstl_map_t *map, cstl_map_iterator_t *i)
 Erase the element pointed to by the iterator.
 
void cstl_map_clear (cstl_map_t *map, cstl_xtor_func_t *clr, void *priv)
 Remove all elements from the map.
 
Iterators
const cstl_map_iterator_tcstl_map_iterator_end (const cstl_map_t *map)
 Return an iterator that refers to the end of the map.
 
static bool cstl_map_iterator_eq (const cstl_map_iterator_t *const a, const cstl_map_iterator_t *const b)
 Compare two iterators for equality.