#include <xphashtable.h>

Classes

struct  SNode
 

Public Member Functions

 CXpHashTable (const INT_PTR nHashTableSize, const bool bCalculate=true)
 
virtual ~CXpHashTable ()
 
HRESULT Insert (const KEY &Key, const TYPE &Value)
 
HRESULT Remove (const KEY &Key)
 
void RemoveAll ()
 
INT_PTR GetCount () const
 
bool HasKey (const KEY &Key) const
 
TXpTableItem FindKey (const KEY &Key) const
 
bool FindValue (const KEY &Key, TYPE &Value) const
 
const KEY & GetKey (const TXpTableItem Item) const
 
const TYPE & GetValue (const TXpTableItem Item) const
 
TYPE & GetValue (const TXpTableItem Item)
 
void GetPair (const TXpTableItem Item, KEY &Key, TYPE &Value) const
 
TXpTableItem GetFirst () const
 
TXpTableItem GetNext (const TXpTableItem Item) const
 
HRESULT Copy (const CXpHashTable &HashTable)
 
HRESULT Intersection (const CXpHashTable &HashTable, CXpHashTable &Result)
 
HRESULT Union (const CXpHashTable &HashTable, CXpHashTable &Result)
 
HRESULT Difference (const CXpHashTable &HashTable, CXpHashTable &Result)
 
bool operator== (const CXpHashTable &HashTable) const
 

Protected Types

typedef CXpArray< SNode * > CPtrArray
 

Protected Member Functions

CXpHashTableoperator= (const CXpHashTable &HashTable)
 
INT_PTR GetBucket (const KEY &Key) const
 
bool IsPrime (const INT_PTR nNbr)
 
INT_PTR GetClosestPrime (const INT_PTR nNbr)
 

Protected Attributes

CPtrArray m_Buckets
 
INT_PTR m_nCount
 

Member Typedef Documentation

◆ CPtrArray

template<class KEY , class TYPE >
typedef CXpArray<SNode*> CXpHashTable< KEY, TYPE >::CPtrArray
protected

Constructor & Destructor Documentation

◆ CXpHashTable()

template<class KEY , class TYPE >
CXpHashTable< KEY, TYPE >::CXpHashTable ( const INT_PTR  nHashTableSize,
const bool  bCalculate = true 
)

◆ ~CXpHashTable()

template<class KEY , class TYPE >
virtual CXpHashTable< KEY, TYPE >::~CXpHashTable ( )
virtual

Member Function Documentation

◆ Copy()

template<class KEY , class TYPE >
HRESULT CXpHashTable< KEY, TYPE >::Copy ( const CXpHashTable< KEY, TYPE > &  HashTable)
inline

◆ Difference()

template<class KEY , class TYPE >
HRESULT CXpHashTable< KEY, TYPE >::Difference ( const CXpHashTable< KEY, TYPE > &  HashTable,
CXpHashTable< KEY, TYPE > &  Result 
)
inline

◆ FindKey()

template<class KEY , class TYPE >
TXpTableItem CXpHashTable< KEY, TYPE >::FindKey ( const KEY &  Key) const
inline

◆ FindValue()

template<class KEY , class TYPE >
bool CXpHashTable< KEY, TYPE >::FindValue ( const KEY &  Key,
TYPE &  Value 
) const
inline

◆ GetBucket()

template<class KEY , class TYPE >
INT_PTR CXpHashTable< KEY, TYPE >::GetBucket ( const KEY &  Key) const
inlineprotected

◆ GetClosestPrime()

template<class KEY , class TYPE >
INT_PTR CXpHashTable< KEY, TYPE >::GetClosestPrime ( const INT_PTR  nNbr)
protected

◆ GetCount()

template<class KEY , class TYPE >
INT_PTR CXpHashTable< KEY, TYPE >::GetCount ( ) const
inline

◆ GetFirst()

template<class KEY , class TYPE >
TXpTableItem CXpHashTable< KEY, TYPE >::GetFirst ( ) const
inline

◆ GetKey()

template<class KEY , class TYPE >
const KEY& CXpHashTable< KEY, TYPE >::GetKey ( const TXpTableItem  Item) const
inline

◆ GetNext()

template<class KEY , class TYPE >
TXpTableItem CXpHashTable< KEY, TYPE >::GetNext ( const TXpTableItem  Item) const
inline

◆ GetPair()

template<class KEY , class TYPE >
void CXpHashTable< KEY, TYPE >::GetPair ( const TXpTableItem  Item,
KEY &  Key,
TYPE &  Value 
) const
inline

◆ GetValue() [1/2]

template<class KEY , class TYPE >
const TYPE& CXpHashTable< KEY, TYPE >::GetValue ( const TXpTableItem  Item) const
inline

◆ GetValue() [2/2]

template<class KEY , class TYPE >
TYPE& CXpHashTable< KEY, TYPE >::GetValue ( const TXpTableItem  Item)
inline

◆ HasKey()

template<class KEY , class TYPE >
bool CXpHashTable< KEY, TYPE >::HasKey ( const KEY &  Key) const
inline

◆ Insert()

template<class KEY , class TYPE >
HRESULT CXpHashTable< KEY, TYPE >::Insert ( const KEY &  Key,
const TYPE &  Value 
)
inline

◆ Intersection()

template<class KEY , class TYPE >
HRESULT CXpHashTable< KEY, TYPE >::Intersection ( const CXpHashTable< KEY, TYPE > &  HashTable,
CXpHashTable< KEY, TYPE > &  Result 
)
inline

◆ IsPrime()

template<class KEY , class TYPE >
bool CXpHashTable< KEY, TYPE >::IsPrime ( const INT_PTR  nNbr)
protected

◆ operator=()

template<class KEY , class TYPE >
CXpHashTable& CXpHashTable< KEY, TYPE >::operator= ( const CXpHashTable< KEY, TYPE > &  HashTable)
protected

◆ operator==()

template<class KEY , class TYPE >
bool CXpHashTable< KEY, TYPE >::operator== ( const CXpHashTable< KEY, TYPE > &  HashTable) const
inline

◆ Remove()

template<class KEY , class TYPE >
HRESULT CXpHashTable< KEY, TYPE >::Remove ( const KEY &  Key)
inline

◆ RemoveAll()

template<class KEY , class TYPE >
void CXpHashTable< KEY, TYPE >::RemoveAll ( )
inline

◆ Union()

template<class KEY , class TYPE >
HRESULT CXpHashTable< KEY, TYPE >::Union ( const CXpHashTable< KEY, TYPE > &  HashTable,
CXpHashTable< KEY, TYPE > &  Result 
)
inline

Member Data Documentation

◆ m_Buckets

template<class KEY , class TYPE >
CPtrArray CXpHashTable< KEY, TYPE >::m_Buckets
protected

◆ m_nCount

template<class KEY , class TYPE >
INT_PTR CXpHashTable< KEY, TYPE >::m_nCount
protected