Centralizing every function associated with an unique implementation method.
th_begin_iterator_func_t begin_iterator
Represents an iterator that allow to iterate over a generic table.
Represent a hashmap controller.
th_generic_table_t(* th_create_func_t)(void)
Pointer on generic function that create a table.
th_t th_create(th_method_t method)
Allocate then initialize a hashmap controller. based on the given method.
void(* th_free_func_t)(th_generic_table_t)
Pointer on generic function that free a table.
bool(* th_delete_func_t)(th_generic_table_t, th_any_t, size_t)
Pointer on generic function that delete a value from a table.
th_iterator_t * th_empty_iterator(th_t *th)
Return an empty iterator.
th_any_t th_get(th_t *th, th_any_t data, size_t data_size)
Returns a value from a hashmap. Return NULL if it doest not exist.
th_any_t(* th_get_func_t)(th_generic_table_t, th_any_t, size_t)
Pointer on generic function that get a value from a table.
bool th_delete(th_t *th, th_any_t data, size_t data_size)
Delete a key value pair from a hashmap. Return true on success.
bool(* th_put_func_t)(th_generic_table_t, th_any_t, size_t, th_any_t)
Pointer on generic function that insert a value into a table.
void th_clear(th_t *th)
Clear a hashmap.
th_method_t
Implementation methods.
th_t th_create_default()
Allocate then initialize a hashmap controller with its default values.
int(* th_len_func_t)(th_generic_table_t)
int th_len(th_t *th)
Get the hashmap length (total amount of key value pairs).
void th_free(th_t *th)
Free a hashmap.
th_iterator_t *(* th_begin_iterator_func_t)(th_generic_table_t, bool)
bool th_put(th_t *th, th_any_t data, size_t data_size, th_any_t value)
Insert element within the hashmap. Return true on success.
th_iterator_t * th_begin_iterator(th_t *th)
Return a pointer on an iterator with the first element.
void * th_generic_table_t
Represents any table.
void * th_any_t
Represent any type of data.