Turnstone Operating System
|
hashmap interface More...
Macros | |
#define | ___HASHMAP_H 0 |
#define | hashmap_new_with_hkg(c, hkg) |
create hashmap with key generator, uses default key comparator | |
#define | hashmap_new_with_hkc(c, hkc) |
create hashmap with key comparator, uses default key generator | |
#define | hashmap_new_with_heap(heap, c) |
create hashmap with key generator and key comparator, uses default memory heap | |
#define | hashmap_new(c) |
create hashmap, uses default key generator and key comparator | |
#define | hashmap_string(c) |
create hashmap with string key, uses string key generator and key comparator | |
#define | hashmap_integer(c) |
create hashmap with integer key, uses integer key generator and key comparator | |
#define | hashmap_integer_with_heap(heap, c) |
create hashmap with integer key, uses integer key generator and key comparator | |
Typedefs | |
typedef struct hashmap_t | hashmap_t |
opaque hashmap type | |
typedef uint64_t(* | hashmap_key_generator_f) (const void *item) |
hashmap key generator function type | |
typedef int8_t(* | hashmap_key_comparator_f) (const void *item1, const void *item2) |
hashmap key comparator function type | |
Functions | |
hashmap_t * | hashmap_new_with_hkg_with_hkc (memory_heap_t *heap, uint64_t capacity, hashmap_key_generator_f hkg, hashmap_key_comparator_f hkc) |
create hashmap with key generator and key comparator | |
hashmap_t * | hashmap_string_with_heap (memory_heap_t *heap, uint64_t capacity) |
create hashmap with string key, uses string key generator and key comparator | |
boolean_t | hashmap_destroy (hashmap_t *hm) |
destroy hashmap | |
const void * | hashmap_put (hashmap_t *hm, const void *key, const void *item) |
put item to hashmap | |
const void * | hashmap_get (hashmap_t *hm, const void *key) |
get item from hashmap | |
const void * | hashmap_get_key (hashmap_t *hm, const void *key) |
get key from hashmap | |
boolean_t | hashmap_exists (hashmap_t *hm, const void *key) |
check existence of key in hashmap | |
boolean_t | hashmap_delete (hashmap_t *hm, const void *key) |
delete item from hashmap | |
uint64_t | hashmap_size (hashmap_t *hm) |
get size of hashmap | |
iterator_t * | hashmap_iterator_create (hashmap_t *hm) |
create iterator of hashmap | |
hashmap interface
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
#define ___HASHMAP_H 0 |
macro for avoiding multiple inclusion
#define hashmap_integer | ( | c | ) |
create hashmap with integer key, uses integer key generator and key comparator
[in] | c | capacity of hashmap |
#define hashmap_integer_with_heap | ( | heap, | |
c ) |
create hashmap with integer key, uses integer key generator and key comparator
[in] | heap | memory heap |
[in] | c | capacity of hashmap |
#define hashmap_new | ( | c | ) |
create hashmap, uses default key generator and key comparator
[in] | c | capacity of hashmap |
#define hashmap_new_with_heap | ( | heap, | |
c ) |
create hashmap with key generator and key comparator, uses default memory heap
[in] | heap | memory heap |
[in] | c | capacity of hashmap |
#define hashmap_new_with_hkc | ( | c, | |
hkc ) |
create hashmap with key comparator, uses default key generator
[in] | c | capacity of hashmap |
[in] | hkc | key comparator function |
#define hashmap_new_with_hkg | ( | c, | |
hkg ) |
create hashmap with key generator, uses default key comparator
[in] | c | capacity of hashmap |
[in] | hkg | key generator function |
#define hashmap_string | ( | c | ) |
create hashmap with string key, uses string key generator and key comparator
[in] | c | capacity of hashmap |
typedef int8_t(* hashmap_key_comparator_f) (const void *item1, const void *item2) |
hashmap key comparator function type
[in] | item1 | item to compare |
[in] | item2 | item to compare |
typedef uint64_t(* hashmap_key_generator_f) (const void *item) |
hashmap key generator function type
[in] | item | item to generate key |
boolean_t hashmap_delete | ( | hashmap_t * | hm, |
const void * | key ) |
delete item from hashmap
[in] | hm | hashmap to delete item |
[in] | key | key of item |
boolean_t hashmap_destroy | ( | hashmap_t * | hm | ) |
destroy hashmap
[in] | hm | hashmap to destroy |
boolean_t hashmap_exists | ( | hashmap_t * | hm, |
const void * | key ) |
check existence of key in hashmap
[in] | hm | hashmap to check existence |
[in] | key | key of item |
const void * hashmap_get | ( | hashmap_t * | hm, |
const void * | key ) |
get item from hashmap
[in] | hm | hashmap to get item |
[in] | key | key of item |
const void * hashmap_get_key | ( | hashmap_t * | hm, |
const void * | key ) |
get key from hashmap
[in] | hm | hashmap to get key |
[in] | key | key of item |
iterator_t * hashmap_iterator_create | ( | hashmap_t * | hm | ) |
create iterator of hashmap
[in] | hm | hashmap to create iterator |
hashmap_t * hashmap_new_with_hkg_with_hkc | ( | memory_heap_t * | heap, |
uint64_t | capacity, | ||
hashmap_key_generator_f | hkg, | ||
hashmap_key_comparator_f | hkc ) |
create hashmap with key generator and key comparator
[in] | heap | memory heap |
[in] | capacity | capacity of hashmap |
[in] | hkg | key generator function |
[in] | hkc | key comparator function |
const void * hashmap_put | ( | hashmap_t * | hm, |
const void * | key, | ||
const void * | item ) |
put item to hashmap
[in] | hm | hashmap to put item |
[in] | key | key of item |
[in] | item | item to put |
get size of hashmap
[in] | hm | hashmap to get size |
hashmap_t * hashmap_string_with_heap | ( | memory_heap_t * | heap, |
uint64_t | capacity ) |
create hashmap with string key, uses string key generator and key comparator
[in] | heap | memory heap |
[in] | capacity | capacity of hashmap |