버전
menu_open
link
Wwise SDK 2023.1.3
AkHashTableTypes.h
이 파일의 문서화 페이지로 가기
1 /***********************************************************************
2  The content of this file includes source code for the sound engine
3  portion of the AUDIOKINETIC Wwise Technology and constitutes "Level
4  Two Source Code" as defined in the Source Code Addendum attached
5  with this file. Any use of the Level Two Source Code shall be
6  subject to the terms and conditions outlined in the Source Code
7  Addendum and the End User License Agreement for Wwise(R).
8 
9  Copyright (c) 2024 Audiokinetic Inc.
10  ***********************************************************************/
11 
12 #pragma once
13 
15 
16 // Basic types for an open-addressed hash array (or, otherwise, keyState-value array).
17 // Exposing enough data and structures to used for forward declarations of types.
18 // Helper and inlineable functions, especially for use by IAkPluginServiceHashTable,
19 // are available in AkHashTableFuncs.h
20 
21 // While the AkHashTableBase structures are exposed here, it is strongly recommended to use either the
22 // AkHashTable namespace functions to modify it, or the IAkPluginHashTable plug-in service, instead.
23 
24 namespace AK
25 {
26  // template instantiations available, in AkHashTable.cpp, are
27  // template<AkUInt32>
28  // template<AkUInt64>
29  template<typename KeyType>
30  struct AkHashTableBase {
32  : pKeys(nullptr)
33  , pbSlotOccupied(nullptr)
34  , pValues(nullptr)
36  , uNumUsedEntries(0)
38  {
39  }
40  KeyType* pKeys;
42  void* pValues;
43 
49 
50  static const AkUInt32 kDefaultMaxLoadFactor = 28; // divided by 32 = 87% load. Robin-hood-style storage ensures that most probe lengths should be low even at this ratio
51 
52  };
53 
54  // main class to use; trivially convertible to AkHashTableBase
55  // This allows for static disambiguation of hashtables for different value types; it's just syntactic sugar
56  template<typename KeyType, typename ValueType>
57  struct AkHashTable : public AkHashTableBase<KeyType>
58  {
59  ValueType* ValueData() { return (ValueType*)AkHashTableBase<KeyType>::pValues; }
60  const ValueType* ValueData() const { return (const ValueType*)AkHashTableBase<KeyType>::pValues; }
61 
62  ValueType& ValueAt(AkInt32 uSlot) { return ((ValueType*)AkHashTableBase<KeyType>::pValues)[uSlot]; }
63  const ValueType& ValueAt(AkInt32 uSlot) const { return ((ValueType*)AkHashTableBase<KeyType>::pValues)[uSlot]; }
64  };
65 
66 } // namespace AK
uint16_t AkUInt16
Unsigned 16-bit integer
Audiokinetic namespace
int32_t AkInt32
Signed 32-bit integer
const ValueType & ValueAt(AkInt32 uSlot) const
ValueType * ValueData()
static const AkUInt32 kDefaultMaxLoadFactor
ValueType & ValueAt(AkInt32 uSlot)
uint32_t AkUInt32
Unsigned 32-bit integer
const ValueType * ValueData() const

이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요