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

A fixed size vector 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 vector. It is guaranteed that no dynamic memory allocation takes place. More...

#include <TArrayVector.h>

Public Member Functions

 TArrayVector ()
 
template<typename U >
void pushBack (U &&item)
 Add an item to the back of the vector. The item originally at the target index will be overwritten.
 
void popBack ()
 Removes an item from the back of the vector. The item originally at the target index is still alive after this call.
 
T & front ()
 
const T & front () const
 
T & back ()
 
const T & back () const
 
std::size_t size () const
 
void clear ()
 
bool isEmpty () const
 
bool isFull () const
 
T * get (std::size_t index)
 
const T * get (std::size_t index) const
 
T & operator[] (std::size_t index)
 
const T & operator[] (std::size_t index) const
 
Iterators

Iterators for stored objects.

std::array< T, N >::iterator begin () noexcept
 
std::array< T, N >::const_iterator begin () const noexcept
 
std::array< T, N >::iterator end () noexcept
 
std::array< T, N >::const_iterator end () const noexcept
 

Detailed Description

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

A fixed size vector 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 vector. It is guaranteed that no dynamic memory allocation takes place.

Constructor & Destructor Documentation

◆ TArrayVector()

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

Member Function Documentation

◆ back() [1/2]

template<typename T , std::size_t N>
T & ph::TArrayVector< T, N >::back ( )
inline

◆ back() [2/2]

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

◆ begin() [1/2]

template<typename T , std::size_t N>
std::array< T, N >::const_iterator ph::TArrayVector< T, N >::begin ( ) const
noexcept

◆ begin() [2/2]

template<typename T , std::size_t N>
std::array< T, N >::iterator ph::TArrayVector< T, N >::begin ( )
noexcept

◆ clear()

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

◆ end() [1/2]

template<typename T , std::size_t N>
std::array< T, N >::const_iterator ph::TArrayVector< T, N >::end ( ) const
noexcept

◆ end() [2/2]

template<typename T , std::size_t N>
std::array< T, N >::iterator ph::TArrayVector< T, N >::end ( )
noexcept

◆ front() [1/2]

template<typename T , std::size_t N>
T & ph::TArrayVector< T, N >::front ( )
inline

◆ front() [2/2]

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

◆ get() [1/2]

template<typename T , std::size_t N>
T * ph::TArrayVector< T, N >::get ( std::size_t index)
inline

◆ get() [2/2]

template<typename T , std::size_t N>
const T * ph::TArrayVector< T, N >::get ( std::size_t index) const
inline

◆ isEmpty()

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

◆ isFull()

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

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

◆ popBack()

template<typename T , std::size_t N>
void ph::TArrayVector< T, N >::popBack ( )
inline

Removes an item from the back of the vector. The item originally at the target index is still alive after this call.

◆ pushBack()

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

Add an item to the back of the vector. The item originally at the target index will be overwritten.

◆ size()

template<typename T , std::size_t N>
std::size_t ph::TArrayVector< T, N >::size ( ) const
inline

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