bool th_oa_table_delete(th_generic_table_t generic_table, th_any_t data, size_t data_size)
Delete a key value pair in an open addressing table. Return true on success.
 
bool th_oa_table_put(th_generic_table_t generic_table, th_any_t data, size_t data_size, th_any_t value)
Insert a value within an open addressing table. Return true on success.
 
th_any_t th_oa_table_get(th_generic_table_t generic_table, th_any_t data, size_t data_size)
Get a value from an open addressing table. Return NULL if it does exist.
 
void th_oa_table_free(th_generic_table_t generic_table)
Free an open addressing table.
 
th_iterator_t * th_oa_iterator_begin(th_generic_table_t generic_table, bool is_begin)
Return a new iterator.
 
int th_oa_table_len(th_generic_table_t generic_table)
Returns the table length.
 
th_generic_table_t th_oa_table_create()
Return an allocated open addressing table struct.
 
th_iterator_t * th_sc_iterator_begin(th_generic_table_t generic_table, bool is_begin)
Return a new iterator.
 
void th_sc_table_free(th_generic_table_t generic_table)
Free an separate chaining table.
 
int th_sc_table_len(th_generic_table_t generic_table)
Returns the table length.
 
th_any_t th_sc_table_get(th_generic_table_t generic_table, th_any_t data, size_t data_size)
Get a value from an separate chaining table. Return NULL if it does exist.
 
bool th_sc_table_put(th_generic_table_t generic_table, th_any_t data, size_t data_size, th_any_t value)
Insert a value within an separate chaining table. Return true on success.
 
th_generic_table_t th_sc_table_create()
Return an allocated separate chaining table.
 
bool th_sc_table_delete(th_generic_table_t generic_table, th_any_t data, size_t data_size)
Delete a key value pair in an separate chaining table. Return true on success.
 
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.
 
static size_t th_funcs_length
 
th_t th_create(th_method_t method)
Allocate then initialize a hashmap controller. based on the given method.
 
static th_funcs_t th_funcs[]
Static array containing functions that accomplish hashmap operation associated with an implementation...
 
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.
 
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.
 
void th_clear(th_t *th)
Clear a hashmap.
 
th_t th_create_default()
Allocate then initialize a hashmap controller with its default values.
 
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.
 
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.
 
th_method_t
Implementation methods.
 
void * th_any_t
Represent any type of data.