orx  stable
Portable Game Engine
OrxHashTable

Macros

#define orxHASHTABLE_KU32_FLAG_NONE   0x00000000
 
#define orxHASHTABLE_KU32_FLAG_NOT_EXPANDABLE   0x00000001
 

Typedefs

typedef struct __orxHASHTABLE_t orxHASHTABLE
 

Functions

orxDLLAPI orxU32 orxFASTCALL orxHashTable_GetCounter (const orxHASHTABLE *_pstHashTable)
 
orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Optimize (orxHASHTABLE *_pstHashTable)
 

HashTable creation/destruction.

orxDLLAPI orxHASHTABLE *orxFASTCALL orxHashTable_Create (orxU32 _u32NbKey, orxU32 _u32Flags, orxMEMORY_TYPE _eMemType)
 
orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Delete (orxHASHTABLE *_pstHashTable)
 
orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Clear (orxHASHTABLE *_pstHashTable)
 

HashTable key manipulation.

orxDLLAPI void *orxFASTCALL orxHashTable_Get (const orxHASHTABLE *_pstHashTable, orxU64 _u64Key)
 
orxDLLAPI void **orxFASTCALL orxHashTable_Retrieve (orxHASHTABLE *_pstHashTable, orxU64 _u64Key)
 
orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Set (orxHASHTABLE *_pstHashTable, orxU64 _u64Key, void *_pData)
 
orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Add (orxHASHTABLE *_pstHashTable, orxU64 _u64Key, void *_pData)
 
orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Remove (orxHASHTABLE *_pstHashTable, orxU64 _u64Key)
 

HashTable iteration.

Used to iterate on all elements of the hashtable.

orxDLLAPI orxHANDLE orxFASTCALL orxHashTable_GetNext (const orxHASHTABLE *_pstHashTable, orxHANDLE _hIterator, orxU64 *_pu64Key, void **_ppData)
 

Detailed Description

Hashtable module Module that handles Hashtables

Macro Definition Documentation

#define orxHASHTABLE_KU32_FLAG_NONE   0x00000000

No flags (default behaviour)

Definition at line 53 of file orxHashTable.h.

#define orxHASHTABLE_KU32_FLAG_NOT_EXPANDABLE   0x00000001

The Hash table will not be expandable

Definition at line 54 of file orxHashTable.h.

Typedef Documentation

typedef struct __orxHASHTABLE_t orxHASHTABLE

Definition at line 50 of file orxHashTable.h.

Function Documentation

orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Add ( orxHASHTABLE _pstHashTable,
orxU64  _u64Key,
void _pData 
)

Add an item value.

Parameters
[in]_pstHashTableThe hash table where set.
[in]_u64KeyKey to assign.
[in]_pDataData to assign.
Returns
Returns the status of the operation. (fails if key already used)
orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Clear ( orxHASHTABLE _pstHashTable)

Clear a hash table.

Parameters
[in]_pstHashTableHash table to clear.
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxHASHTABLE* orxFASTCALL orxHashTable_Create ( orxU32  _u32NbKey,
orxU32  _u32Flags,
orxMEMORY_TYPE  _eMemType 
)

Create a new hash table and return it.

Parameters
[in]_u32NbKeyNumber of keys that will be inserted.
[in]_u32FlagsFlags used by the hash table
[in]_eMemTypeMemory type to use
Returns
Returns the hashtable pointer or orxNULL if failed.
orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Delete ( orxHASHTABLE _pstHashTable)

Delete a hash table.

Parameters
[in]_pstHashTableHash table to delete.
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI void* orxFASTCALL orxHashTable_Get ( const orxHASHTABLE _pstHashTable,
orxU64  _u64Key 
)

Find an item in a hash table.

Parameters
[in]_pstHashTableThe hash table where search.
[in]_u64KeyKey to find.
Returns
The Element associated to the key or orxNULL if not found.
orxDLLAPI orxU32 orxFASTCALL orxHashTable_GetCounter ( const orxHASHTABLE _pstHashTable)

Gets a hash table item counter

Parameters
[in]_pstHashTableConcerned hash table
Returns
Item number
orxDLLAPI orxHANDLE orxFASTCALL orxHashTable_GetNext ( const orxHASHTABLE _pstHashTable,
orxHANDLE  _hIterator,
orxU64 *  _pu64Key,
void **  _ppData 
)

Gets the next item in the hashtable and returns an iterator for next search

Parameters
[in]_pstHashTableConcerned HashTable
[in]_hIteratorIterator from previous search or orxHANDLE_UNDEFINED/orxNULL for a new search
[out]_pu64KeyCurrent element key
[out]_ppDataCurrent element data
Returns
Iterator for next element if an element has been found, orxHANDLE_UNDEFINED otherwise
orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Optimize ( orxHASHTABLE _pstHashTable)

Optimizes a hashtable for read accesses (minimizes number of cache misses upon collisions)

Parameters
[in]_pstHashTableHashTable to optimize
Returns
orxSTATUS_SUCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Remove ( orxHASHTABLE _pstHashTable,
orxU64  _u64Key 
)

Remove an item.

Parameters
[in]_pstHashTableThe hash table where remove.
[in]_u64KeyKey to remove.
Returns
Returns the status of the operation.
orxDLLAPI void** orxFASTCALL orxHashTable_Retrieve ( orxHASHTABLE _pstHashTable,
orxU64  _u64Key 
)

Retrieves the bucket of an item in a hash table, if the item wasn't present, a new bucket will be created.

Parameters
[in]_pstHashTableConcerned hashtable
[in]_u64KeyKey to find
Returns
The bucket associated to the given key if success, orxNULL otherwise
orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Set ( orxHASHTABLE _pstHashTable,
orxU64  _u64Key,
void _pData 
)

Set an item value.

Parameters
[in]_pstHashTableThe hash table where set.
[in]_u64KeyKey to assign.
[in]_pDataData to assign.
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Generated for orx by doxygen 1.5.6