OAHash Struct Reference
OAHash class definition.
More...
#include <OAHash_private.h>
Data Fields |
void * | custom_arg |
size_t | fill |
OA_HASH_FREE_FUN | free_entry_fun |
void * | free_fun_arg |
OA_HASH_EQ_FUN | key_eq_fun |
OA_HASH_HASH_FUN | key_hash_fun |
size_t | mask |
OAEntry | small_table [OA_HASH_MINSIZE] |
OAEntry * | table |
size_t | used |
Related Functions |
(Note that these are not member functions.)
|
void | oa_hash_deinit (OAHash_ptr self) |
void | oa_hash_init (OAHash_ptr self, OA_HASH_EQ_FUN key_eq_fun, OA_HASH_HASH_FUN key_hash_fun, OA_HASH_FREE_FUN free_entry_fun, void *custom_arg) |
void | OAHash_clear (OAHash_ptr self) |
| Clears all entries in the hash.
|
OAHash_ptr | OAHash_copy (const OAHash_ptr self) |
| The OAHash class constructor.
|
OAHash_ptr | OAHash_create (OA_HASH_EQ_FUN key_eq_fun, OA_HASH_HASH_FUN key_hash_fun, OA_HASH_FREE_FUN free_entry_fun, void *custom_arg) |
| The OAHash class constructor.
|
void | OAHash_destroy (OAHash_ptr self) |
| The OAHash class destructor.
|
OAHashIter | OAHash_get_first_iter (const OAHash_ptr self) |
| Returns the first iterator for the given OAHash.
|
size_t | OAHash_get_size (OAHash_ptr self) |
| Returns the number of elements in the OAHash.
|
boolean | OAHash_has_key (OAHash_ptr self, const void *key) |
| Checks if the given key is in the OAHash.
|
boolean | OAHash_insert (OAHash_ptr self, const void *key, const void *value) |
| Inserts the given pair key -> value in the OAHash.
|
boolean | OAHash_iter_is_end (const OAHash_ptr self, const OAHashIter iter) |
| Checks if the given iterator is not valid.
|
OAHashIter | OAHash_iter_next (const OAHash_ptr self, const OAHashIter iter) |
| Returns the next iterator for the given OAHash.
|
void | OAHash_iter_values (const OAHash_ptr self, const OAHashIter iter, void **key, void **value) |
| Retrieves the key and value entries associated with the given iterator.
|
void * | OAHash_lookup (OAHash_ptr self, const void *key) |
| Looks up for the given key in the OAHash.
|
boolean | OAHash_remove (OAHash_ptr self, const void *key) |
| Removes the entry added with key "key" from the OAHash.
|
Detailed Description
OAHash class definition.
Public interface of class 'OAHash'.
- Author:
- Alessandro Mariotti
- Todo:
- : Missing description
Definition of the public accessor for class OAHash
Friends And Related Function Documentation
Clears all entries in the hash.
Clears all entries in the hash
The OAHash class constructor.
AutomaticStart
The OAHash class constructor
For key_eq_fun and key_hash_fun there are a few utilities like OAHash_pointer_eq_fun and OAHash_pointer_hash_fun, respectively.
- Parameters:
-
| free_entry_fun | can be NULL |
| custom_arg | can be NULL |
- See also:
- OAHash_destroy
Returns the first iterator for the given OAHash.
Returns the first iterator for the given OAHash
size_t OAHash_get_size |
( |
OAHash_ptr |
self |
) |
[related] |
Returns the number of elements in the OAHash.
Returns the number of elements in the OAHash
Checks if the given key is in the OAHash.
Checks if the given key is in the OAHash
boolean OAHash_insert |
( |
OAHash_ptr |
self, |
|
|
const void * |
key, |
|
|
const void * |
value | |
|
) |
| | [related] |
Inserts the given pair key -> value in the OAHash.
Inserts the given pair key -> value in the OAHash.
If the key already exists, it is replaced and the old value is returned. Returns true if the key has been replaced
Checks if the given iterator is not valid.
Checks if the given iterator is not valid (i.e. it points over the end)
Returns the next iterator for the given OAHash.
Returns the next iterator for the given OAHash
void OAHash_iter_values |
( |
const OAHash_ptr |
self, |
|
|
const OAHashIter |
iter, |
|
|
void ** |
key, |
|
|
void ** |
value | |
|
) |
| | [related] |
Retrieves the key and value entries associated with the given iterator.
Retrieves the key and value entries associated with the given iterator. Both key and value can be NULL
void * OAHash_lookup |
( |
OAHash_ptr |
self, |
|
|
const void * |
key | |
|
) |
| | [related] |
Looks up for the given key in the OAHash.
Looks up for the given key in the OAHash.
NULL is returned if not found (NOTE: NULL values are admitted by the OAHash. If one inserts an entry such as OAHash_insert(k, NULL) in the hash, OAHash_lookup(k) will return NULL. Use OAHash_has_key for a correct interpretation of the return value
Removes the entry added with key "key" from the OAHash.
Removes the entry added with key "key" from the OAHash.
Returns true if the key has been actually removed (i.e. the key was in the hash
Field Documentation
The documentation for this struct was generated from the following files: