#include <hashtable.h>
Public Member Functions | |
hashtable (int size) | |
Function for a new hash table including targeted size. | |
~hashtable () | |
Free data of the hashtable again. | |
void | insert (K *key, T *value) |
Insert a record into the hashtable. | |
void | remove (K *key) |
Remove a record again. | |
T * | operator[] (K *key) |
Read a record from the hashtable. | |
bool | lookup_extended (K *key, K **orig_key_ret, T **value_ret) |
Return the pointer to the orginal key and the data record to free it again if needed. | |
void | foreach (void(*func)(K *, T *, void *closure), void *closure) |
Call the handler for each record. | |
void | foreach_remove (gboolean(*func)(K *, T *, void *closure), void *closure) |
Call the handler and remove the record when the handler returns 1. | |
int | size () const |
Number of elements in the hashtable. |
Function for a new hash table including targeted size.
Free data of the hashtable again.
void hashtable< K, T >::insert | ( | K * | key, | |
T * | value | |||
) | [inline] |
void hashtable< K, T >::remove | ( | K * | key | ) | [inline] |
Remove a record again.
T* hashtable< K, T >::operator[] | ( | K * | key | ) | [inline] |
bool hashtable< K, T >::lookup_extended | ( | K * | key, | |
K ** | orig_key_ret, | |||
T ** | value_ret | |||
) | [inline] |
Return the pointer to the orginal key and the data record to free it again if needed.
void hashtable< K, T >::foreach | ( | void(*)(K *, T *, void *closure) | func, | |
void * | closure | |||
) | [inline] |
Call the handler for each record.
void hashtable< K, T >::foreach_remove | ( | gboolean(*)(K *, T *, void *closure) | func, | |
void * | closure | |||
) | [inline] |
Call the handler and remove the record when the handler returns 1.
int hashtable< K, T >::size | ( | ) | const [inline] |
Number of elements in the hashtable.