Wwise SDK 2023.1.3

#include <IAkPluginHashTable.h>

Inheritance diagram for AK::IAkPluginServiceHashTable:

Public Member Functions

virtual AKRESULT InitBase (AK::AkHashTableBase< AkUInt64 > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, AkUInt32 in_uInitialReserveCount, AkUInt32 in_uValueElementSize, AkUInt32 in_uValueElementAlign)=0
virtual void Term (AkHashTableBase< AkUInt64 > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator)=0
virtual void Reset (AkHashTableBase< AkUInt64 > *io_pHashTable)=0
virtual void * AddKey (AkHashTableBase< AkUInt64 > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, AkUInt64 in_uKey)=0
virtual bool RemoveSlot (AkHashTableBase< AkUInt64 > *io_pHashTable, AkInt32 in_iSlot)=0
virtual void RemoveKey (AkHashTableBase< AkUInt64 > *io_pHashTable, AkUInt64 in_uKey)=0
template<typename ValueType >
AkForceInline AKRESULT Init (AkHashTable< AkUInt64, ValueType > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, AkUInt32 in_uInitialReserveCount)
template<typename KeyType , typename ValueType >
AkForceInline void TermValues (AkHashTable< KeyType, ValueType > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator)
template<typename KeyType , typename ValueType >
AkForceInline void * AddKeyDefaultValue (AkHashTable< KeyType, ValueType > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, KeyType in_uKey)
template<typename ValueType >
AkForceInline ValueType * AddKeyValue (AkHashTable< AkUInt64, ValueType > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, AkUInt64 in_uKey, ValueType *in_pNewValue)
template<typename KeyType , typename ValueType >
AkForceInline bool RemoveSlotValue (AkHashTable< KeyType, ValueType > *io_pHashTable, AkInt32 in_iSlotToRemove)
template<typename KeyType , typename FuncType >
AkForceInline void RemoveIf (AkHashTableBase< KeyType > *in_pHashTable, FuncType in_func)
template<typename KeyType , typename ValueType , typename FuncType >
AkForceInline void RemoveIfValue (AkHashTable< KeyType, ValueType > *in_pHashTable, FuncType in_func)

Static Public Member Functions

static AkInt32 GetFirstSlotByKey (AkHashTableBase< AkUInt64 > *in_pHashTable, AkUInt64 in_uKey)
static AkInt32 GetNextSlotByKey (AkHashTableBase< AkUInt64 > *in_pHashTable, AkUInt64 in_uKey, AkInt32 in_iPreviousSlot)

Protected Member Functions

virtual ~IAkPluginServiceHashTable ()
- Protected Member Functions inherited from AK::IAkPluginService
virtual ~IAkPluginService ()

Detailed Description

Interface for an open-addressed hash table (or key-value array). Relatively low-cost (O(1)) lookup, add, and removal by key. Typical use is to add values by key, and then using GetFirstSlotByKey (and GetNextSlotByKey, if keys are not guaranteed to be unique) to get a Slot into the AkHashTableBase, and then indexing AkHashTableBase::pValues by the provided Slot.

Note that the AkHashTableBase referred to is not inherently thread-safe, so appropriate protections will be required if the same hashTable is shared across multiple plug-in instances.

Some hash functions are provided in AkMurMurHash.h which can be used for key generation. In particular, this can be very useful for storing data on audio objects, or audio object channels, over time. Note that if indexing by object-channel is desired, GetObjectChannelHash is recommended to mitigate key-collisions from multiple channels of data. However, Audio Object IDs themselves are chaotic enough that they can be used directly.

Definition at line 56 of file IAkPluginHashTable.h.

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

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