PlayRho  2.0.0
An interactive physics engine & library.
playrho::GrowableStack< T, N > Class Template Reference

#include <playrho/GrowableStack.hpp>

Public Types

using CountType = std::size_t
 Count type.
 
using ElementType = T
 Element type.
 

Public Member Functions

 GrowableStack (const GrowableStack &other)=delete
 
 GrowableStack (GrowableStack &&other)=delete
 
constexpr CountType capacity () const noexcept
 Gets the capacity in number of elements.
 
constexpr bool empty () const noexcept
 Whether this stack is empty.
 
GrowableStackoperator= (const GrowableStack &copy)=delete
 
GrowableStackoperator= (GrowableStack &&copy)=delete
 
void pop () noexcept
 Pops the "top" element. More...
 
void push (const ElementType &element)
 Pushes the given elements onto this stack.
 
constexpr CountType size () const noexcept
 Gets the current size in numbers of elements.
 
ElementType top () const
 Accesses the "top" element. More...
 

Static Public Member Functions

static constexpr CountType GetBufferGrowthRate () noexcept
 Gets the buffer growth rate.
 
static constexpr CountType GetInitialCapacity () noexcept
 Gets the initial capacity.
 

Detailed Description

template<typename T, std::size_t N>
class playrho::GrowableStack< T, N >

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.

Member Function Documentation

◆ pop()

template<typename T , std::size_t N>
void playrho::GrowableStack< T, N >::pop ( )
inlinenoexcept

Pops the "top" element.

Precondition
size() is greater than zero.

Referenced by playrho::d2::Query(), and playrho::d2::RayCast().

◆ top()

template<typename T , std::size_t N>
ElementType playrho::GrowableStack< T, N >::top ( ) const
inline

Accesses the "top" element.

Precondition
size() is greater than zero.

Referenced by playrho::d2::Query(), and playrho::d2::RayCast().


The documentation for this class was generated from the following file: