Wwise SDK
_i_ak_plugin_hash_table_8h_source
버전
menu_open
알림: 고객님의 주요 출시 버전( 2023.1.3.8471 )에 해당하는 최신 설명서로 이동했습니다. 특정 버전의 설명서를 보시려면 Audiokinetic 런처에서 오프라인 설명서를 다운로드하고 Wwise Authoring의 Offline Documentation을 확인하세요.
link
Wwise SDK 2023.1.3
|
IAkPluginHashTable.h
이 파일의 문서화 페이지로 가기
43 /// Relatively low-cost (O(1)) lookup, add, and removal by key. Typical use is to add values by key,
44 /// and then using GetFirstSlotByKey (and GetNextSlotByKey, if keys are not guaranteed to be unique)
45 /// to get a Slot into the AkHashTableBase, and then indexing AkHashTableBase::pValues by the provided Slot.
47 /// Note that the AkHashTableBase referred to is not inherently thread-safe, so appropriate protections
51 /// In particular, this can be very useful for storing data on audio objects, or audio object channels,
52 /// over time. Note that if indexing by object-channel is desired, GetObjectChannelHash is recommended
53 /// to mitigate key-collisions from multiple channels of data. However, Audio Object IDs themselves are
67 virtual AKRESULT InitBase(AK::AkHashTableBase<AkUInt64>* io_pHashTable, AK::IAkPluginMemAlloc* in_pAllocator,
68 AkUInt32 in_uInitialReserveCount, AkUInt32 in_uValueElementSize, AkUInt32 in_uValueElementAlign) = 0;
71 virtual void Term(AkHashTableBase<AkUInt64>* io_pHashTable, AK::IAkPluginMemAlloc* in_pAllocator) = 0;
77 // and returns a pointer to the value made available, or nullptr if a grow occurred but memory could not be provided
79 // - this function can move entries in the table around, so previous pointers to elements, etc, should be considered invalidated
80 virtual void* AddKey(AkHashTableBase<AkUInt64>* io_pHashTable, AK::IAkPluginMemAlloc* in_pAllocator, AkUInt64 in_uKey) = 0;
83 // Returns true when a move of data around the end of the list occurred, e.g. in case iteration over the table needs to be modified
84 // - this function can move entries in the table around, so previous pointers to elements, etc, should be considered invalidated
88 // - this function can move entries in the table around, so previous pointers to elements, etc, should be considered invalidated
93 // Inline/static helpers that call the interface functions, or other hashtable funcs are as follows:
105 static AkInt32 GetNextSlotByKey(AkHashTableBase<AkUInt64>* in_pHashTable, AkUInt64 in_uKey, AkInt32 in_iPreviousSlot) {
111 AkForceInline AKRESULT Init(AkHashTable<AkUInt64, ValueType>* io_pHashTable, AK::IAkPluginMemAlloc* in_pAllocator,
114 return InitBase(io_pHashTable, in_pAllocator, in_uInitialReserveCount, sizeof(ValueType), alignof(ValueType));
117 // frees memory allocated for entries, and invokes the destructor for all value types along the way
119 AkForceInline void TermValues(AkHashTable<KeyType, ValueType>* io_pHashTable, AK::IAkPluginMemAlloc* in_pAllocator)
131 // adds the provided key to the hash table, performs default initialization of the table's valueType,
132 // and returns a pointer to the value made available, or nullptr if a grow occurred but memory could not be provided
134 // - this function can move entries in the table around, so previous pointers to elements, etc, should be considered invalidated
136 AkForceInline void* AddKeyDefaultValue(AkHashTable<KeyType, ValueType>* io_pHashTable, AK::IAkPluginMemAlloc* in_pAllocator,
148 // adds the provided key to the hash table, copies the provided value into the newly allocated value,
149 // and returns a pointer to the value made available, or nullptr if a grow occurred but memory could not be provided
151 // - this function can move entries in the table around, so previous pointers to elements, etc, should be considered invalidated
153 AkForceInline ValueType* AddKeyValue(AkHashTable<AkUInt64, ValueType>* io_pHashTable, AK::IAkPluginMemAlloc* in_pAllocator,
166 // Returns true when a move of data around the end of the list occurred, e.g. in case iteration over the table needs to be modified
167 // - this function can move entries in the table around, so previous pointers to elements, etc, should be considered invalidated
169 AkForceInline bool RemoveSlotValue(AkHashTable<KeyType, ValueType>* io_pHashTable, AkInt32 in_iSlotToRemove)
175 // runs the provided function over every active slot in the hashtable, which is used to determine if the element should be removed
179 // - this function can move entries in the table around, so previous pointers to elements, etc, should be considered invalidated
190 // if slot is occupied, and the function confirmed removal, remove this slot, but don't advance uSlot
192 // if the removeSlot process moved data around the end of the table, then we need to lower numReservedEntries to compensate
205 // runs the provided function over every active slot in the hashtable, which is used to determine if the element should be removed
206 // For each element where this function returns true, it removes the entry at the slot provided, and performs destruction of the table's valuetype
209 // - this function can move entries in the table around, so previous pointers to elements, etc, should be considered invalidated
211 AkForceInline void RemoveIfValue(AkHashTable<KeyType, ValueType>* in_pHashTable, FuncType in_func)
220 // if slot is occupied, and the function confirmed removal, remove this slot, but don't advance uSlot
222 // if the removeSlot process moved data around the end of the table, then we need to lower numReservedEntries to compensate
236 #define AK_GET_PLUGIN_SERVICE_HASHTABLE(plugin_ctx) static_cast<AK::IAkPluginServiceHashTable*>(plugin_ctx->GetPluginService(AK::PluginServiceType_HashTable))
249 AkForceInline AkUInt64 GetObjectChannelHash(AkUInt64 in_uAudioObjectId, AkUInt32 in_uChannelIdx)
251 return AkHashMurMurMix64(((AkUInt64)in_uChannelIdx << AkAudioObject::kObjectKeyNumBits) | (in_uAudioObjectId & AkAudioObject::kObjectKeyMask));
virtual ~IAkPluginServiceHashTable()
Definition: IAkPluginHashTable.h:59
AkForceInline AkUInt64 GetObjectChannelHash(AkUInt64 in_uAudioObjectId, AkUInt32 in_uChannelIdx)
Common hash function for getting a unique hash for a channel on an audio object
Definition: IAkPluginHashTable.h:249
void ForEachSlot(const AkHashTableBase< KeyType > *in_pHashTable, FuncType in_func)
Definition: AkHashTableFuncs.h:134
static AkInt32 GetNextSlotByKey(AkHashTableBase< AkUInt64 > *in_pHashTable, AkUInt64 in_uKey, AkInt32 in_iPreviousSlot)
Definition: IAkPluginHashTable.h:105
static const AkUInt64 kObjectKeyNumBits
Definition: AkCommonDefs.h:319
virtual bool RemoveSlot(AkHashTableBase< AkUInt64 > *io_pHashTable, AkInt32 in_iSlot)=0
AkInt32 GetNextSlotForKey(const AkHashTableBase< KeyType > *pHashTable, KeyType uKey, AkInt32 iPreviousSlot)
Definition: AkHashTableFuncs.h:104
Common interface for plug-in services accessed through the global plug-in context
Definition: IAkPlugin.h:1204
AkForceInline void RemoveIfValue(AkHashTable< KeyType, ValueType > *in_pHashTable, FuncType in_func)
Definition: IAkPluginHashTable.h:211
virtual AKRESULT InitBase(AK::AkHashTableBase< AkUInt64 > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, AkUInt32 in_uInitialReserveCount, AkUInt32 in_uValueElementSize, AkUInt32 in_uValueElementAlign)=0
virtual void * AddKey(AkHashTableBase< AkUInt64 > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, AkUInt64 in_uKey)=0
Definition: AkCommonDefs.h:303
Definition: IAkPluginMemAlloc.h:43
AkForceInline void AkMemCpy(void *pDest, const void *pSrc, AkUInt32 uSize)
Platform Independent Helper
Definition: AkPlatformFuncs.h:361
A common hashtable for mapping audioobjectIds to a combination of audio buffers and objects
Definition: IAkPluginHashTable.h:240
virtual void Term(AkHashTableBase< AkUInt64 > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator)=0
Definition: AkHashTableTypes.h:30
AK::AkHashTable< AkAudioObjectID, AkAudioObjectBuffer > AkAudioObjectBufferMap
Definition: IAkPluginHashTable.h:246
AkForceInline void * AddKeyDefaultValue(AkHashTable< KeyType, ValueType > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, KeyType in_uKey)
Definition: IAkPluginHashTable.h:136
AkForceInline void TermValues(AkHashTable< KeyType, ValueType > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator)
Definition: IAkPluginHashTable.h:119
AkForceInline void RemoveIf(AkHashTableBase< KeyType > *in_pHashTable, FuncType in_func)
Definition: IAkPluginHashTable.h:181
AkUInt32 uNumReservedEntries
Definition: AkHashTableTypes.h:44
AkInt32 GetFirstSlotForKey(const AkHashTableBase< KeyType > *pHashTable, KeyType uKey)
Definition: AkHashTableFuncs.h:91
AkAudioObjectBuffer()
Definition: IAkPluginHashTable.h:241
virtual void Reset(AkHashTableBase< AkUInt64 > *io_pHashTable)=0
AkForceInline bool RemoveSlotValue(AkHashTable< KeyType, ValueType > *io_pHashTable, AkInt32 in_iSlotToRemove)
Definition: IAkPluginHashTable.h:169
AkForceInline AKRESULT Init(AkHashTable< AkUInt64, ValueType > *io_pHashTable, AK::IAkPluginMemAlloc *in_pAllocator, AkUInt32 in_uInitialReserveCount)
Definition: IAkPluginHashTable.h:111
Definition: AkHashTableTypes.h:58
static AkInt32 GetFirstSlotByKey(AkHashTableBase< AkUInt64 > *in_pHashTable, AkUInt64 in_uKey)
Definition: IAkPluginHashTable.h:98
Definition: AkCommonDefs.h:464
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)
Definition: IAkPluginHashTable.h:153
AkForceInline AkUInt64 AkHashMurMurMix64(AkUInt64 uValue)
Definition: AkMurMurHash.h:50
이 페이지가 도움이 되었나요?
작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.
프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.
Wwise를 시작해 보세요