14 #include AK/SoundEngine/Common/AkHashTableTypes.h>
15 #include AK/Tools/Common/AkBitFuncs.h>
28 templatetypename KeyType>
31 return AkInt32(uKey) & iEntriesMask;
35 templatetypename KeyType>
41 return (iSlot -
AkInt32(uKey)) & iEntriesMask;
45 templatetypename KeyType>
52 if (!pbSlotOccupied[iSlot])
54 KeyType keyInSlot = pKeys[iSlot];
55 if (keyInSlot == uKey)
59 iSlot = (iSlot + 1) & iEntriesMask;
68 while (iSlot
75 iSlot = (iSlot >= iNumEntries) ? -1 : iSlot;
90 templatetypename KeyType>
96 AkInt32 iBestSlot = uKey & (uNumEntries - 1);
103 templatetypename KeyType>
109 AkInt32 iNextSlot = (iPreviousSlot + 1) & (uNumEntries - 1);
116 templatetypename KeyType>
125 templatetypename KeyType>
133 templatetypename KeyType,
typename FuncType>
138 for (
AkUInt32 uBaseSlot = 0; uBaseSlot
144 in_func(uBaseSlot + 7 - (slotSubIdx / 8));
145 slotOccMask ^= (0x8000000000000000ULL >> slotSubIdx);
void ForEachSlot(const AkHashTableBase *in_pHashTable, FuncType in_func)
AkForceInline AkUInt32 AkBitScanReverse64(AkUInt64 in_bits)
AkInt32 GetNextSlotForKey(const AkHashTableBase *pHashTable, KeyType uKey, AkInt32 iPreviousSlot)
AkInt32 IdealPos(KeyType uKey, AkInt32 iEntriesMask)
AkForceInline AkUInt32 AkBitScanForward64(AkUInt64 in_bits)
int32_t AkInt32
Signed 32-bit integer.
AkInt32 GetFirstActiveSlot(const AkHashTableBase *pHashTable)
AkInt32 LinearProbe(const KeyType *pKeys, const bool *pbSlotOccupied, KeyType uKey, AkInt32 iSlot, AkUInt32 uNumEntries)
AkUInt32 uNumReservedEntries
AkInt32 GetFirstSlotForKey(const AkHashTableBase *pHashTable, KeyType uKey)
uint64_t AkUInt64
Unsigned 64-bit integer.
AkInt32 DistanceFromIdealPos(AkInt32 iSlot, KeyType uKey, AkInt32 iEntriesMask)
AkInt32 OccupiedProbe(const bool *pbSlotOccupied, AkInt32 iSlot, AkInt32 iNumEntries)
uint32_t AkUInt32
Unsigned 32-bit integer.
AkInt32 GetNextActiveSlot(const AkHashTableBase *pHashTable, AkInt32 iPreviousSlot)