Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::TArrayStack< T, N > Class Template Referencefinal

A fixed size stack backed by an array. The container inherits the properties of a fixed size array of type T. The container keeps all N elements alive until its lifetime ends, even if elements are popped/removed from the stack. It is guaranteed that no dynamic memory allocation takes place. More...

#include <TArrayStack.h>

Public Member Functions

 TArrayStack ()
 
template<typename U >
void push (U &&item)
 Adds an item to the stack. The item originally at the target index will be overwritten.
 
void pop ()
 Removes the top item from the stack. The item originally at the target index is still alive after this call.
 
T & top ()
 
const T & top () const
 
std::size_t height () const
 
void clear ()
 
bool isEmpty () const
 
T & operator[] (std::size_t index)
 
const T & operator[] (std::size_t index) const
 

Detailed Description

template<typename T, std::size_t N>
class ph::TArrayStack< T, N >

A fixed size stack backed by an array. The container inherits the properties of a fixed size array of type T. The container keeps all N elements alive until its lifetime ends, even if elements are popped/removed from the stack. It is guaranteed that no dynamic memory allocation takes place.

Constructor & Destructor Documentation

◆ TArrayStack()

template<typename T , std::size_t N>
ph::TArrayStack< T, N >::TArrayStack ( )
inline

Creates empty stack.

Member Function Documentation

◆ clear()

template<typename T , std::size_t N>
void ph::TArrayStack< T, N >::clear ( )
inline

◆ height()

template<typename T , std::size_t N>
std::size_t ph::TArrayStack< T, N >::height ( ) const
inline

◆ isEmpty()

template<typename T , std::size_t N>
bool ph::TArrayStack< T, N >::isEmpty ( ) const
inline

◆ operator[]() [1/2]

template<typename T , std::size_t N>
T & ph::TArrayStack< T, N >::operator[] ( std::size_t index)
inline

◆ operator[]() [2/2]

template<typename T , std::size_t N>
const T & ph::TArrayStack< T, N >::operator[] ( std::size_t index) const
inline

◆ pop()

template<typename T , std::size_t N>
void ph::TArrayStack< T, N >::pop ( )
inline

Removes the top item from the stack. The item originally at the target index is still alive after this call.

◆ push()

template<typename T , std::size_t N>
template<typename U >
void ph::TArrayStack< T, N >::push ( U && item)
inline

Adds an item to the stack. The item originally at the target index will be overwritten.

◆ top() [1/2]

template<typename T , std::size_t N>
T & ph::TArrayStack< T, N >::top ( )
inline

◆ top() [2/2]

template<typename T , std::size_t N>
const T & ph::TArrayStack< T, N >::top ( ) const
inline

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