5#include <Common/assertion.h>
12template<
typename T, std::
size_t N>
14 m_data{}, m_currentIndex(-1)
17template<
typename T, std::
size_t N>
21 PH_ASSERT_IN_RANGE(m_currentIndex + 1, Index(0), Index(N));
23 m_data[++m_currentIndex] = std::forward<U>(item);
26template<
typename T, std::
size_t N>
29 PH_ASSERT_IN_RANGE(m_currentIndex - 1, Index(-1), Index(N - 1));
34template<
typename T, std::
size_t N>
37 PH_ASSERT_IN_RANGE(m_currentIndex, Index(0), Index(N));
39 return m_data[m_currentIndex];
42template<
typename T, std::
size_t N>
45 PH_ASSERT_IN_RANGE(m_currentIndex, Index(0), Index(N));
47 return m_data[m_currentIndex];
50template<
typename T, std::
size_t N>
53 PH_ASSERT_GE(m_currentIndex + 1, Index(0));
55 return static_cast<std::size_t
>(m_currentIndex + 1);
58template<
typename T, std::
size_t N>
64template<
typename T, std::
size_t N>
67 return m_currentIndex == -1;
70template<
typename T, std::
size_t N>
73 PH_ASSERT_IN_RANGE(index, 0, m_data.size());
78template<
typename T, std::
size_t N>
81 PH_ASSERT_IN_RANGE(index, 0, m_data.size());
void push(U &&item)
Adds an item to the stack. The item originally at the target index will be overwritten.
Definition TArrayStack.ipp:19
T & top()
Definition TArrayStack.ipp:35
std::size_t height() const
Definition TArrayStack.ipp:51
T & operator[](std::size_t index)
Definition TArrayStack.ipp:71
void clear()
Definition TArrayStack.ipp:59
bool isEmpty() const
Definition TArrayStack.ipp:65
TArrayStack()
Definition TArrayStack.ipp:13
void pop()
Removes the top item from the stack. The item originally at the target index is still alive after thi...
Definition TArrayStack.ipp:27
The root for all renderer implementations.
Definition EEngineProject.h:6