Hashtable module Module that handles Hashtables
#define orxHASHTABLE_KU32_FLAG_NONE 0x00000000 |
#define orxHASHTABLE_KU32_FLAG_NOT_EXPANDABLE 0x00000001 |
The Hash table will not be expandable
Definition at line 55 of file orxHashTable.h.
Add an item value.
- Parameters
-
[in] | _pstHashTable | The hash table where set. |
[in] | _u64Key | Key to assign. |
[in] | _pData | Data to assign. |
- Returns
- Returns the status of the operation. (fails if key already used)
Clear a hash table.
- Parameters
-
[in] | _pstHashTable | Hash table to clear. |
- Returns
- orxSTATUS_SUCCESS / orxSTATUS_FAILURE
Create a new hash table and return it.
- Parameters
-
[in] | _u32NbKey | Number of keys that will be inserted. |
[in] | _u32Flags | Flags used by the hash table |
[in] | _eMemType | Memory type to use |
- Returns
- Returns the hashtable pointer or orxNULL if failed.
Delete a hash table.
- Parameters
-
[in] | _pstHashTable | Hash table to delete. |
- Returns
- orxSTATUS_SUCCESS / orxSTATUS_FAILURE
Find an item in a hash table.
- Parameters
-
[in] | _pstHashTable | The hash table where search. |
[in] | _u64Key | Key to find. |
- Returns
- The Element associated to the key or orxNULL if not found.
Gets a hash table item count
- Parameters
-
[in] | _pstHashTable | Concerned hash table |
- Returns
- Item number
Gets the next item in the hashtable and returns an iterator for next search
- Parameters
-
[in] | _pstHashTable | Concerned HashTable |
[in] | _hIterator | Iterator from previous search or orxHANDLE_UNDEFINED/orxNULL for a new search |
[out] | _pu64Key | Current element key |
[out] | _ppData | Current element data |
- Returns
- Iterator for next element if an element has been found, orxHANDLE_UNDEFINED otherwise
Optimizes a hashtable for read accesses (minimizes number of cache misses upon collisions)
- Parameters
-
[in] | _pstHashTable | HashTable to optimize |
- Returns
- orxSTATUS_SUCESS / orxSTATUS_FAILURE
Remove an item.
- Parameters
-
[in] | _pstHashTable | The hash table where remove. |
[in] | _u64Key | Key to remove. |
- Returns
- Returns the status of the operation.
Retrieves the bucket of an item in a hash table, if the item wasn't present, a new bucket will be created.
- Parameters
-
[in] | _pstHashTable | Concerned hashtable |
[in] | _u64Key | Key to find |
- Returns
- The bucket associated to the given key if success, orxNULL otherwise
Set an item value.
- Parameters
-
[in] | _pstHashTable | The hash table where set. |
[in] | _u64Key | Key to assign. |
[in] | _pData | Data to assign. |
- Returns
- orxSTATUS_SUCCESS / orxSTATUS_FAILURE