This is a growable LIFO stack with an initial capacity of N. If the stack size exceeds the initial capacity, the heap is used to increase the size of the stack. More...
#include <GrowableStack.hpp>
Public Types | |
using | ElementType = T |
Element type. | |
using | CountType = std::size_t |
Count type. | |
Public Member Functions | |
GrowableStack (const GrowableStack &other)=delete | |
GrowableStack (GrowableStack &&other)=delete | |
GrowableStack & | operator= (const GrowableStack ©)=delete |
GrowableStack & | operator= (GrowableStack &©)=delete |
void | push (const ElementType &element) |
Pushes the given elements onto this stack. | |
ElementType | top () const |
Accesses the "top" element. More... | |
void | pop () noexcept |
Pops the "top" element. | |
constexpr CountType | size () const noexcept |
Gets the current size in numbers of elements. | |
constexpr CountType | capacity () const noexcept |
Gets the capacity in number of elements. | |
constexpr bool | empty () const noexcept |
Whether this stack is empty. | |
Static Public Member Functions | |
static constexpr CountType | GetInitialCapacity () noexcept |
Gets the initial capacity. | |
static constexpr CountType | GetBufferGrowthRate () noexcept |
Gets the buffer growth rate. | |
Private Attributes | |
ElementType | m_array [N] |
Array data. | |
ElementType * | m_stack = m_array |
Pointer to array of data. | |
CountType | m_count = 0 |
Count of elements. | |
CountType | m_capacity = N |
Capacity for storing elements. | |
This is a growable LIFO stack with an initial capacity of N. If the stack size exceeds the initial capacity, the heap is used to increase the size of the stack.
|
inline |
Accesses the "top" element.
Referenced by playrho::d2::Query(), and playrho::d2::RayCast().