gwnavruntime/querysystem/workingmemcontainers/workingmembinaryheap.h Source File
Go to the documentation of this file.
19 static const IndexInBinHeap IndexInBinHeap_Removed = IndexInBinHeap_UnSet - 1;
22 class WorkingMemBinaryHeapIndexTracker_None
26 static void OnRemove(T& ) {}
27 static void OnSwap(T& , T& ) {}
30 template <
class Item,
typename Comparator = DefaultLess<Item>,
typename BinaryHeapIndexTracker = WorkingMemBinaryHeapIndexTracker_None<Item> >
31 class WorkingMemBinaryHeap
34 WorkingMemBinaryHeap();
35 WorkingMemBinaryHeap(WorkingMemory* workingMemory);
37 void Init(WorkingMemory* workingMemory);
39 KY_INLINE
bool IsInitialized()
const;
41 KY_INLINE
KyUInt32 GetCapacity()
const;
43 KY_INLINE
bool IsEmpty()
const;
44 KY_INLINE
bool IsFull();
46 KY_INLINE
void Clear();
50 KY_INLINE
void GetFirst(Item& item)
const;
54 KY_INLINE
const Item& GetFirst()
const;
57 void Insert(
const Item& item);
62 void ExtractFirst(Item& item);
69 Comparator& GetComparator() {
return m_comparator; }
71 void ReleaseWorkingMemoryBuffer() { m_heap.ReleaseWorkingMemoryBuffer(); }
74 KY_INLINE
KyUInt32 GetParentIndex(
KyUInt32 index) {
return (index - 1) >> 1; }
75 KY_INLINE
KyUInt32 GetLeftChildIndex(
KyUInt32 index) {
return (index << 1) + 1; }
76 KY_INLINE
KyUInt32 GetRigthChildIndex(
KyUInt32 index) {
return (index << 1) + 2; }
79 void PercolateUp(
KyUInt32 HoleIndex);
85 WorkingMemArray<Item> m_heap;
87 Comparator m_comparator;
88 BinaryHeapIndexTracker m_binayHeapTracker;
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
std::uint16_t KyUInt16
uint16_t
Definition: types.h:28
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
#define KyUInt16MAXVAL
KyUInt16 max value
Definition: types.h:67