7 #ifndef _INC_cHashTable_H
8 #define _INC_cHashTable_H
48 template<
class _TYPEARRAY,
class TYPE,
typename TYPE_HASHCODE = HASHCODE_t,
int TYPE_HASHBITS = 5 >
112 iTotalCount +=
m_aTable[i].GetSize();
127 this->m_aTable[i].RemoveAll();
139 template<
class TYPE,
typename TYPE_HASHCODE = HASHCODE_t,
int TYPE_HASHBITS = 5 >
152 return this->
m_aTable[iBucket].FindArgForKey(rid);
189 template<
class TYPE,
typename TYPE_HASHCODE = HASHCODE_t,
int TYPE_HASHBITS = 5 >
235 #define FOR_HASH_TABLE(h,i) for ( ; i.m_i<h.k_HASH_ARRAY_QTY; i.m_i++ ) for ( i.m_j=0; i.m_j<h.m_aTable[i.m_i].GetSize(); i.m_j++ )
#define IS_INDEX_GOOD_ARRAY(i, a)
Definition: Index.h:38
#define IS_INDEX_GOOD(i, q)
cast the (likely) int to unsigned to check for negatives.
Definition: Index.h:35
#define TYPE
Definition: StrT.cpp:38
#define _1BITMASK(b)
default bitmask type = size_t. Use cBits::Mask1() for other type.
Definition: cBits.h:32
#define ASSERT(exp)
Definition: cDebugAssert.h:87
#define UNITTEST_FRIEND(n)
Define this in the class body to be unit tested. Allow the unit test to access private/protected stuf...
Definition: cUnitTestDecl.h:17
TYPE_PTR FindArgForKey(TYPE_KEY key1) const noexcept
Definition: cArraySort.h:455
bool RemoveArgKey(TYPE *pBase)
Definition: cArraySortRef.h:101
void DisposeAll()
Definition: cArraySortRef.h:30
ITERATE_t Add(TYPE_ARG pNew)
Definition: cArraySort.h:186
REF_t ConstElementAt(ITERATE_t nIndex) const
Definition: cArray.h:534
Definition: cHashTable.h:20
ITERATE_t m_i
array/Bucket number in the hash.
Definition: cHashTable.h:24
ITERATE_t m_j
element inside a array/Bucket.
Definition: cHashTable.h:25
void SkipRemoved() noexcept
Definition: cHashTable.h:32
ITERATE_t get_ArrayNum() const noexcept
Definition: cHashTable.h:37
cHashIterator(ITERATE_t nBucket=0, ITERATE_t jj=0) noexcept
Definition: cHashTable.h:27
bool isValid() const noexcept
Definition: cHashTable.h:42
Definition: cHashTable.h:191
void DisposeAll()
Definition: cHashTable.h:224
PTR_t GetAt(TYPE_HASHCODE rid, ITERATE_t index) const
Definition: cHashTable.h:220
PTR_t GetAtHash(const cHashIterator &i) const
Definition: cHashTable.h:213
PTR_t FindArgForKey(TYPE_HASHCODE rid) const
Definition: cHashTable.h:197
cRefPtr< TYPE > PTR_t
Definition: cHashTable.h:195
bool DeleteArg(TYPE *pObj)
Definition: cHashTable.h:207
ITERATE_t Add(TYPE *pNew)
Definition: cHashTable.h:202
Definition: cHashTable.h:141
const TYPE & REF_t
Definition: cHashTable.h:146
const TYPE * FindArgForKey(TYPE_HASHCODE rid) const
Definition: cHashTable.h:149
const TYPE & GetAtHash(const cHashIterator &i) const
Definition: cHashTable.h:154
cHashIterator FindHash(TYPE_HASHCODE rid) const
Definition: cHashTable.h:160
TYPE * AddSpecial(REF_t rNew)
Definition: cHashTable.h:172
const TYPE & Add(REF_t rNew)
Definition: cHashTable.h:166
cHashTableT< cArraySortStructHash< TYPE, TYPE_HASHCODE >, TYPE, TYPE_HASHCODE, TYPE_HASHBITS > SUPER_t
Definition: cHashTable.h:145
Definition: cHashTable.h:50
void RemoveAll()
Definition: cHashTable.h:123
TYPE_HASHCODE FindKeyFree(TYPE_HASHCODE rid) const
Definition: cHashTable.h:84
bool IsEmpty() const
Definition: cHashTable.h:98
ITERATE_t get_HashArrayQty() const
Definition: cHashTable.h:65
_TYPEARRAY m_aTable[k_HASH_ARRAY_QTY]
Definition: cHashTable.h:58
iterator FindIForKey(TYPE_HASHCODE rid) const
Definition: cHashTable.h:79
ITERATE_t get_TotalCount() const
Definition: cHashTable.h:107
ITERATE_t GetArraySize(ITERATE_t iArray) const
Definition: cHashTable.h:74
int get_HashBits() const
Definition: cHashTable.h:61
ITERATE_t GetHashArray(TYPE_HASHCODE rid) const
Definition: cHashTable.h:69
void Empty()
Definition: cHashTable.h:131
cHashIterator iterator
Definition: cHashTable.h:57
static const ITERATE_t k_HASH_ARRAY_QTY
Definition: cHashTable.h:56
bool DeleteKey(TYPE_HASHCODE rid)
Definition: cHashTable.h:93
void RemoveAt(iterator &i)
Definition: cHashTable.h:116
< The main namespace for all Core functions.
Definition: GrayCore.cpp:14
int COMPARE_t
result of compare. 0=same, 1=a>b, -1=a<b
Definition: cValT.h:17
int ITERATE_t
like size_t but signed
Definition: Index.h:28
@ COMPARE_Equal
VARCMP_EQ.
Definition: cValT.h:23
uint16 index
Definition: sample3.cpp:29