30 #include <AK/Tools/Common/AkKeyArray.h>
33 template <
class T_KEY,
class T_ITEM,
class U_POOL,
class U_KEY = AkGetArrayKey< T_KEY, T_ITEM >,
unsigned long TGrowBy = 1,
class TMovePolicy = AkAssignmentMovePolicy<T_ITEM>,
class TComparePolicy = AkDefaultSortedKeyCompare<T_KEY> >
34 class CAkHeap :
public AkArray< T_ITEM, const T_ITEM &, U_POOL, TGrowBy, TMovePolicy >
45 while (insertIdx != 0)
47 int parentIdx = Parent(insertIdx);
52 insertIdx = parentIdx;
63 U_KEY::Get(*pItem) = in_Key;
91 AkUInt32 left = LeftChild(idx);
92 AkUInt32 right = RightChild(idx);
93 AkUInt32 smallest = idx;
111 AkForceInline
bool Lesser(T_KEY &a, T_KEY &b)
const
113 return TComparePolicy::Lesser((
void*)
this, a, b);
116 AkForceInline
void Swap(AkUInt32 in_i0, AkUInt32 in_i1)
124 AkForceInline AkUInt32 Parent(AkUInt32 i)
126 return (i - 1U) / 2U;
129 AkForceInline AkUInt32 LeftChild(AkUInt32 i)
131 return (2U * i + 1U);
134 AkForceInline AkUInt32 RightChild(AkUInt32 i)
136 return (2U * i + 2U);
Specific implementation of array.
AkUInt32 m_uLength
number of items in the array.
AkForceInline T * AddLast()
T_ITEM * Insert(T_KEY in_Key)
T * m_pItems
pointer to the beginning of the array.
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