MIHASH< _ITEMTYPE > Class Template Reference

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>

List of all members.

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)

Detailed Description

template<typename _ITEMTYPE>
class MIHASH< _ITEMTYPE >

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.


Constructor & Destructor Documentation

template<typename _ITEMTYPE>
MIHASH< _ITEMTYPE >::MIHASH ( UINT32  NumBuckets = 32  )  [inline, explicit]

Constructor.

Parameters:
NumBuckets Number of buckets to hash into
template<typename _ITEMTYPE>
MIHASH< _ITEMTYPE >::MIHASH ( const MIHASH< _ITEMTYPE > &  rhs  )  [inline]

Copy constructor.

template<typename _ITEMTYPE>
MIHASH< _ITEMTYPE >::~MIHASH (  )  [inline]

Destructor.


Member Function Documentation

template<typename _ITEMTYPE>
void MIHASH< _ITEMTYPE >::Add ( const _ITEMTYPE &  item  )  [inline]

Add an item to the hash.

template<typename _ITEMTYPE>
ITERATOR MIHASH< _ITEMTYPE >::Begin (  )  [inline]

Create iterator to the beginning of the hash table.

Returns:
Iterator to hash table
template<typename _ITEMTYPE>
CONST_ITERATOR MIHASH< _ITEMTYPE >::Begin (  )  const [inline]

Create const iterator to the beginning of the hash table.

Returns:
Constant iterator to hash table
template<typename _ITEMTYPE>
void MIHASH< _ITEMTYPE >::Clear (  )  [inline]

Clear the hash of all entries.

template<typename _ITEMTYPE>
ITERATOR MIHASH< _ITEMTYPE >::End (  )  [inline]

Create iterator to the end of the hash table.

Returns:
Iterator to hash table
template<typename _ITEMTYPE>
CONST_ITERATOR MIHASH< _ITEMTYPE >::End (  )  const [inline]

Create const iterator to the end of the hash table.

Returns:
Constant iterator to hash table
template<typename _ITEMTYPE>
template<typename _CMP >
bool MIHASH< _ITEMTYPE >::Exists ( const _CMP &  item  )  const [inline]

Determine if an item is in the hash table.

Returns:
True if item is in the hash table
template<typename _ITEMTYPE>
template<typename _CMP >
CONST_ITERATOR MIHASH< _ITEMTYPE >::Find ( const _CMP &  item  )  const [inline]

Locate an item in the hash table.

Returns:
Constant iterator if item exists, End() if not

< The comparison MUST remain in this order, changing it will break much code.

template<typename _ITEMTYPE>
template<typename _CMP >
ITERATOR MIHASH< _ITEMTYPE >::Find ( const _CMP &  item  )  [inline]

Locate an item in the hash table.

Returns:
Iterator if item exists, End() if not

< The comparison MUST remain in this order, changing it will break much code.

template<typename _ITEMTYPE>
void MIHASH< _ITEMTYPE >::Remove ( ITERATOR  item  )  [inline]

Remove item from hash table.

template<typename _ITEMTYPE>
void MIHASH< _ITEMTYPE >::Resize ( INT32  NumBuckets  )  [inline]

Resize the number of buckets in the hash table, clears the table first.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:33:37 2012 for TNTsdk 2012 by  doxygen 1.6.1