Go to the documentation of this file.
32 #include <type_traits>
111 template<
typename ValueType>
115 return InitBase(io_pHashTable, in_pAllocator, in_uInitialReserveCount,
sizeof(ValueType),
alignof(ValueType));
119 template<
typename KeyType,
typename ValueType>
122 if (!std::is_trivially_destructible<ValueType>::value)
126 (io_pHashTable->
ValueAt(uSlot)).~ValueType();
136 template<
typename KeyType,
typename ValueType>
140 if (ValueType* pInsertedValue = (ValueType*)
AddKey(io_pHashTable, in_pAllocator, in_uKey))
144 return pInsertedValue;
153 template<
typename ValueType>
155 AkUInt64 in_uKey, ValueType* in_pNewValue)
157 if (ValueType* pInsertedValue = (ValueType*)
AddKey(io_pHashTable, in_pAllocator, in_uKey))
161 return pInsertedValue;
169 template<
typename KeyType,
typename ValueType>
172 io_pHashTable->
ValueAt(in_iSlotToRemove).~ValueType();
173 return RemoveSlot(io_pHashTable, in_iSlotToRemove);
181 template<
typename KeyType,
typename FuncType>
187 while (uSlotsToEvaluate > 0)
189 AKASSERT(uSlot < in_pHashTable->uNumReservedEntries);
190 if (pbSlotOccupied[uSlot])
209 template<
typename KeyType,
typename ValueType,
typename FuncType>
215 while (uSlotsToEvaluate > 0)
217 AKASSERT(uSlot < in_pHashTable->uNumReservedEntries);
218 if (pbSlotOccupied[uSlot])
233 #define AK_GET_PLUGIN_SERVICE_HASHTABLE(plugin_ctx) static_cast<AK::IAkPluginServiceHashTable*>(plugin_ctx->GetPluginService(AK::PluginServiceType_HashTable))
virtual ~IAkPluginServiceHashTable()
AkForceInline AkUInt64 GetObjectChannelHash(AkUInt64 in_uAudioObjectId, AkUInt32 in_uChannelIdx)
Common hash function for getting a unique hash for a channel on an audio object.
void ForEachSlot(const AkHashTableBase< KeyType > *in_pHashTable, FuncType in_func)
Definition of data structures for AkAudioObject.
static AkInt32 GetNextSlotByKey(AkHashTableBase< AkUInt64 > *in_pHashTable, AkUInt64 in_uKey, AkInt32 in_iPreviousSlot)
static const AkUInt64 kObjectKeyNumBits
#define AkPlacementNew(_memory)
static const AkUInt64 kObjectKeyMask
virtual bool RemoveSlot(AkHashTableBase< AkUInt64 > *io_pHashTable, AkInt32 in_iSlot)=0
AKRESULT
Standard function call result.
AkInt32 GetNextSlotForKey(const AkHashTableBase< KeyType > *pHashTable, KeyType uKey, AkInt32 iPreviousSlot)
Common interface for plug-in services accessed through the global plug-in context.
AkForceInline void RemoveIfValue(AkHashTable< KeyType, ValueType > *in_pHashTable, FuncType in_func)
virtual AKRESULT InitBase(AK::AkHashTableBase< AkUInt64 > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, AkUInt32 in_uInitialReserveCount, AkUInt32 in_uValueElementSize, AkUInt32 in_uValueElementAlign)=0
int32_t AkInt32
Signed 32-bit integer.
virtual void * AddKey(AkHashTableBase< AkUInt64 > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, AkUInt64 in_uKey)=0
A common hashtable for mapping audioobjectIds to a combination of audio buffers and objects.
virtual void Term(AkHashTableBase< AkUInt64 > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator)=0
#define AKASSERT(Condition)
AkForceInline void AkMemCpy(void *pDest, const void *pSrc, AkUInt32 uSize)
Platform Independent Helper for memcpy/memmove/memset.
AK::AkHashTable< AkAudioObjectID, AkAudioObjectBuffer > AkAudioObjectBufferMap
AkAudioObject * pMetadata
AkForceInline void * AddKeyDefaultValue(AkHashTable< KeyType, ValueType > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, KeyType in_uKey)
AkForceInline void TermValues(AkHashTable< KeyType, ValueType > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator)
AkForceInline void RemoveIf(AkHashTableBase< KeyType > *in_pHashTable, FuncType in_func)
AkInt32 GetFirstSlotForKey(const AkHashTableBase< KeyType > *pHashTable, KeyType uKey)
virtual void Reset(AkHashTableBase< AkUInt64 > *io_pHashTable)=0
uint64_t AkUInt64
Unsigned 64-bit integer.
AkForceInline bool RemoveSlotValue(AkHashTable< KeyType, ValueType > *io_pHashTable, AkInt32 in_iSlotToRemove)
AkForceInline AKRESULT Init(AkHashTable< AkUInt64, ValueType > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, AkUInt32 in_uInitialReserveCount)
AkUInt16 uValueElementSize
uint32_t AkUInt32
Unsigned 32-bit integer.
static AkInt32 GetFirstSlotByKey(AkHashTableBase< AkUInt64 > *in_pHashTable, AkUInt64 in_uKey)
ValueType & ValueAt(AkUInt32 uSlot)
virtual void RemoveKey(AkHashTableBase< AkUInt64 > *io_pHashTable, AkUInt64 in_uKey)=0
AkForceInline ValueType * AddKeyValue(AkHashTable< AkUInt64, ValueType > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, AkUInt64 in_uKey, ValueType *in_pNewValue)
AkForceInline AkUInt64 AkHashMurMurMix64(AkUInt64 uValue)
Tell us about your project. We're here to help.
Register your project and we'll help you get started with no strings attached!
Get started with Wwise