Items to be stored in the hash MUST define a GetHashNumber() method and define an operator==() for the hash entry for each type of object that will be used to locate the hash entry. More...
#include <mi32/mihash.h>
Classes | |
| class | CONST_ITERATOR |
| class | ITERATOR |
| CLASS iterator. More... | |
Public Member Functions | |
| MIHASH (const MIHASH &rhs) | |
| MIHASH (UINT32 NumBuckets=32) | |
| ~MIHASH () | |
| void | Add (const _ITEMTYPE &item) |
| ITERATOR | Begin () |
| CONST_ITERATOR | Begin () const |
| void | Clear () |
| ITERATOR | End () |
| CONST_ITERATOR | End () const |
| template<typename _CMP > | |
| bool | Exists (const _CMP &item) const |
| template<typename _CMP > | |
| CONST_ITERATOR | Find (const _CMP &item) const |
| template<typename _CMP > | |
| ITERATOR | Find (const _CMP &item) |
| void | Remove (ITERATOR item) |
| void | Resize (INT32 NumBuckets) |
Items to be stored in the hash MUST define a GetHashNumber() method and define an operator==() for the hash entry for each type of object that will be used to locate the hash entry.
Eg. For RVC object searches, the hash stores the inode number and file handle, the object defined to search with contains the name parentinode, and object type. Therefore an operator==() must be defined to compare the hash entry with the search object.
| MIHASH< _ITEMTYPE >::MIHASH | ( | UINT32 | NumBuckets = 32 |
) | [inline, explicit] |
Constructor.
| NumBuckets | Number of buckets to hash into |
| MIHASH< _ITEMTYPE >::MIHASH | ( | const MIHASH< _ITEMTYPE > & | rhs | ) | [inline] |
Copy constructor.
| void MIHASH< _ITEMTYPE >::Add | ( | const _ITEMTYPE & | item | ) | [inline] |
Add an item to the hash.
Create iterator to the beginning of the hash table.
| CONST_ITERATOR MIHASH< _ITEMTYPE >::Begin | ( | ) | const [inline] |
Create const iterator to the beginning of the hash table.
| void MIHASH< _ITEMTYPE >::Clear | ( | ) | [inline] |
Clear the hash of all entries.
Create iterator to the end of the hash table.
| CONST_ITERATOR MIHASH< _ITEMTYPE >::End | ( | ) | const [inline] |
Create const iterator to the end of the hash table.
| bool MIHASH< _ITEMTYPE >::Exists | ( | const _CMP & | item | ) | const [inline] |
Determine if an item is in the hash table.
| CONST_ITERATOR MIHASH< _ITEMTYPE >::Find | ( | const _CMP & | item | ) | const [inline] |
Locate an item in the hash table.
< The comparison MUST remain in this order, changing it will break much code.
| ITERATOR MIHASH< _ITEMTYPE >::Find | ( | const _CMP & | item | ) | [inline] |
Locate an item in the hash table.
< The comparison MUST remain in this order, changing it will break much code.
Remove item from hash table.
Resize the number of buckets in the hash table, clears the table first.
1.6.1