Functions | |
| EAPI Cmaid_Set * | cmaid_hash_set_new (const Cmaid_Value *v) |
| Creates a new set using the hash implementation. | |
| EAPI Cmaid_Map * | cmaid_hash_map_new (const Cmaid_Value *key, const Cmaid_Value *value) |
| Creates a new map using the hash implementation. | |
| EAPI Cmaid_Cache * | cmaid_hash_cache_new (const Cmaid_Value *v) |
| Creates a new cache using the hash implementation. | |
| void | cmaid_hash_dump (Cmaid_Container *c) |
Variables | |
| EAPI const Cmaid_Set_Interface | cmaid_hash_set_if |
| EAPI const Cmaid_Map_Interface | cmaid_hash_map_if |
| EAPI const Cmaid_Cache_Interface | cmaid_hash_cache_if |
| EAPI const Cmaid_Iter_Interface | cmaid_hash_key_iter_if |
| EAPI const Cmaid_Iter_Interface | cmaid_hash_value_iter_if |
The hash table implementation provides a growing hash table used for fast insertions, removes and look-ups. All these operations are in mean constant in time, i.e. O(1) for the best case. Depending on the hash value function, this can become linear in time, i.e. O(N), in the worst case scenario. Keep this in mind and adjust your hash function to the hashed data if you find the basic operations, not constant in time. Unlike like in the tree, the values are not lexically ordered.
The hash table is implement with a growing bucket size, that means, once the hash table table is too full, the bucket array is reallocated with a larger size, and the nodes are re-insert. This happens automatically and you have not to care about it. But it is important to know when using iterators.
As soon as an iterator is attached to the hash table, the hash bucket size is frozen, so that the order of the nodes is not changed. So doing massive adds with an attached iterator may reduce the performance of the hash table.
| EAPI Cmaid_Cache* cmaid_hash_cache_new | ( | const Cmaid_Value * | v | ) |
Creates a new cache using the hash implementation.
| v | The value structure defining the type of the objects that are cached. |
| EAPI Cmaid_Map* cmaid_hash_map_new | ( | const Cmaid_Value * | key, | |
| const Cmaid_Value * | value | |||
| ) |
Creates a new map using the hash implementation.
| key | The value structure defining the type of the objects used for the key object. | |
| value | The value structure defining the type of the objects used for the value object. |
| EAPI Cmaid_Set* cmaid_hash_set_new | ( | const Cmaid_Value * | v | ) |
Creates a new set using the hash implementation.
| v | The value structure defining the type of the objects used in the set |
1.5.8