orx 1.16
Portable Game Engine
Loading...
Searching...
No Matches
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_GetCount (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

◆ orxHASHTABLE_KU32_FLAG_NONE

#define orxHASHTABLE_KU32_FLAG_NONE   0x00000000

No flags (default behaviour)

Definition at line 54 of file orxHashTable.h.

◆ orxHASHTABLE_KU32_FLAG_NOT_EXPANDABLE

#define orxHASHTABLE_KU32_FLAG_NOT_EXPANDABLE   0x00000001

The Hash table will not be expandable

Definition at line 55 of file orxHashTable.h.

Typedef Documentation

◆ orxHASHTABLE

typedef struct __orxHASHTABLE_t orxHASHTABLE

Definition at line 51 of file orxHashTable.h.

Function Documentation

◆ orxHashTable_Add()

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

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)

◆ orxHashTable_Clear()

orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Clear ( orxHASHTABLE * _pstHashTable)
extern

Clear a hash table.

Parameters
[in]_pstHashTableHash table to clear.
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxHashTable_Create()

orxDLLAPI orxHASHTABLE *orxFASTCALL orxHashTable_Create ( orxU32 _u32NbKey,
orxU32 _u32Flags,
orxMEMORY_TYPE _eMemType )
extern

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.

◆ orxHashTable_Delete()

orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Delete ( orxHASHTABLE * _pstHashTable)
extern

Delete a hash table.

Parameters
[in]_pstHashTableHash table to delete.
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxHashTable_Get()

orxDLLAPI void *orxFASTCALL orxHashTable_Get ( const orxHASHTABLE * _pstHashTable,
orxU64 _u64Key )
extern

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.

◆ orxHashTable_GetCount()

orxDLLAPI orxU32 orxFASTCALL orxHashTable_GetCount ( const orxHASHTABLE * _pstHashTable)
extern

Gets a hash table item count

Parameters
[in]_pstHashTableConcerned hash table
Returns
Item number

◆ orxHashTable_GetNext()

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

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

◆ orxHashTable_Optimize()

orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Optimize ( orxHASHTABLE * _pstHashTable)
extern

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

Parameters
[in]_pstHashTableHashTable to optimize
Returns
orxSTATUS_SUCESS / orxSTATUS_FAILURE

◆ orxHashTable_Remove()

orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Remove ( orxHASHTABLE * _pstHashTable,
orxU64 _u64Key )
extern

Remove an item.

Parameters
[in]_pstHashTableThe hash table where remove.
[in]_u64KeyKey to remove.
Returns
Returns the status of the operation.

◆ orxHashTable_Retrieve()

orxDLLAPI void **orxFASTCALL orxHashTable_Retrieve ( orxHASHTABLE * _pstHashTable,
orxU64 _u64Key )
extern

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

◆ orxHashTable_Set()

orxDLLAPI orxSTATUS orxFASTCALL orxHashTable_Set ( orxHASHTABLE * _pstHashTable,
orxU64 _u64Key,
void * _pData )
extern

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.8.11