5#include <Common/assertion.h>
13template<
typename T, std::
size_t N,
typename IsLess>
18template<
typename T, std::
size_t N,
typename IsLess>
22 , m_isLess(
std::move(isLess))
25template<
typename T, std::
size_t N,
typename IsLess>
29 PH_ASSERT_IN_RANGE(m_currentIndex + 1, Index(0), Index(N));
31 m_data[++m_currentIndex] = std::forward<U>(item);
32 std::push_heap(m_data.begin(), m_data.begin() + m_currentIndex + 1, m_isLess);
35template<
typename T, std::
size_t N,
typename IsLess>
38 PH_ASSERT_IN_RANGE(m_currentIndex - 1, Index(-1), Index(N - 1));
40 std::pop_heap(m_data.begin(), m_data.begin() + m_currentIndex + 1, m_isLess);
44template<
typename T, std::
size_t N,
typename IsLess>
47 PH_ASSERT_IN_RANGE(m_currentIndex, Index(0), Index(N));
52template<
typename T, std::
size_t N,
typename IsLess>
55 PH_ASSERT_IN_RANGE(m_currentIndex, Index(0), Index(N));
60template<
typename T, std::
size_t N,
typename IsLess>
63 PH_ASSERT_GE(m_currentIndex + 1, Index(0));
65 return static_cast<std::size_t
>(m_currentIndex + 1);
68template<
typename T, std::
size_t N,
typename IsLess>
74template<
typename T, std::
size_t N,
typename IsLess>
77 return m_currentIndex == -1;
A fixed size heap backed by an array. The container inherits the properties of a fixed size array of ...
Definition TArrayHeap.h:21
TArrayHeap()
Definition TArrayHeap.ipp:14
void pop()
Removes the top item from the heap. The item originally at the target index is still alive after this...
Definition TArrayHeap.ipp:36
bool isEmpty() const
Definition TArrayHeap.ipp:75
void clear()
Definition TArrayHeap.ipp:69
std::size_t size() const
Definition TArrayHeap.ipp:61
void push(U &&item)
Adds an item to the heap. The item originally at the target index will be overwritten.
Definition TArrayHeap.ipp:27
T & top()
Access the top item of the heap. By default, the top item is the maximum item (max heap)....
Definition TArrayHeap.ipp:45
The root for all renderer implementations.
Definition EEngineProject.h:6