Jolt Physics
A multi core friendly Game Physics Engine
|
Simple variable length array backed by a fixed size buffer. More...
#include <StaticArray.h>
Classes | |
struct | Storage |
Public Types | |
using | value_type = T |
using | size_type = uint |
using | const_iterator = const T * |
using | iterator = T * |
Public Member Functions | |
StaticArray ()=default | |
Default constructor. | |
StaticArray (std::initializer_list< T > inList) | |
Constructor from initializer list. | |
StaticArray (const StaticArray< T, N > &inRHS) | |
Copy constructor. | |
~StaticArray () | |
Destruct all elements. | |
void | clear () |
Destruct all elements and set length to zero. | |
void | push_back (const T &inElement) |
Add element to the back of the array. | |
template<class... A> | |
void | emplace_back (A &&... inElement) |
Construct element at the back of the array. | |
void | pop_back () |
Remove element from the back of the array. | |
bool | empty () const |
Returns true if there are no elements in the array. | |
size_type | size () const |
Returns amount of elements in the array. | |
size_type | capacity () const |
Returns maximum amount of elements the array can hold. | |
void | resize (size_type inNewSize) |
Resize array to new length. | |
const_iterator | begin () const |
Iterators. | |
const_iterator | end () const |
iterator | begin () |
iterator | end () |
const T * | data () const |
T * | data () |
T & | operator[] (size_type inIdx) |
Access element. | |
const T & | operator[] (size_type inIdx) const |
T & | at (size_type inIdx) |
Access element. | |
const T & | at (size_type inIdx) const |
const T & | front () const |
First element in the array. | |
T & | front () |
const T & | back () const |
Last element in the array. | |
T & | back () |
void | erase (const_iterator inIter) |
Remove one element from the array. | |
void | erase (const_iterator inBegin, const_iterator inEnd) |
Remove multiple element from the array. | |
StaticArray< T, N > & | operator= (const StaticArray< T, N > &inRHS) |
Assignment operator. | |
template<uint M> | |
StaticArray< T, N > & | operator= (const StaticArray< T, M > &inRHS) |
Assignment operator with static array of different max length. | |
bool | operator== (const StaticArray< T, N > &inRHS) const |
Comparing arrays. | |
bool | operator!= (const StaticArray< T, N > &inRHS) const |
uint64 | GetHash () const |
Get hash for this array. | |
Static Public Attributes | |
static constexpr uint | Capacity = N |
Protected Attributes | |
size_type | mSize = 0 |
Storage | mElements [N] |
Simple variable length array backed by a fixed size buffer.
using StaticArray< T, N >::const_iterator = const T * |
using StaticArray< T, N >::iterator = T * |
using StaticArray< T, N >::size_type = uint |
using StaticArray< T, N >::value_type = T |
|
default |
Default constructor.
|
inlineexplicit |
Constructor from initializer list.
|
inline |
Copy constructor.
|
inline |
Destruct all elements.
|
inline |
Access element.
|
inline |
|
inline |
|
inline |
Last element in the array.
|
inline |
|
inline |
Iterators.
|
inline |
Returns maximum amount of elements the array can hold.
|
inline |
Destruct all elements and set length to zero.
|
inline |
|
inline |
|
inline |
Construct element at the back of the array.
|
inline |
Returns true if there are no elements in the array.
|
inline |
|
inline |
|
inline |
Remove multiple element from the array.
|
inline |
Remove one element from the array.
|
inline |
|
inline |
First element in the array.
|
inline |
Get hash for this array.
|
inline |
|
inline |
Assignment operator with static array of different max length.
|
inline |
Assignment operator.
|
inline |
Comparing arrays.
|
inline |
Access element.
|
inline |
|
inline |
Remove element from the back of the array.
|
inline |
Add element to the back of the array.
|
inline |
Resize array to new length.
|
inline |
Returns amount of elements in the array.
|
staticconstexpr |
|
protected |
|
protected |