EHS
|
#include <Vector.h>
Public Member Functions | |
~Vector () | |
Frees any data created on the heap. | |
Vector () | |
Default members initialization. | |
Vector (const N size, const N stride) | |
Vector (std::initializer_list< T > list, const N stride=5) | |
Vector (const T *data, const N size, const N stride) | |
Vector (const Vector &vec) | |
Vector (Vector &&vec) noexcept | |
Vector & | operator= (const Vector &vec) |
Vector & | operator= (Vector &&vec) noexcept |
bool | operator== (const Vector &in) const |
bool | operator!= (const Vector &in) const |
Vector & | operator+= (std::initializer_list< T > value) |
Vector & | operator+= (const T value) |
operator T* () const | |
Retrieves the raw C-style array from casting an array object. | |
N | RawSize () const |
N | Size () const |
N | Stride () const |
N | End () const |
void | Copy (const N dstOffset, Vector< T, N > src, const N srcOffset=0) |
void | Copy (const N dstOffset, const T *src, const N inSize) |
void | Swap (N a, N b) |
void | Insert (const N index, const T value) |
T | Remove (const N index) |
void | Push (const T *const value, const N size) |
void | Push (Vector< T > value) |
void | Push (std::initializer_list< T > value) |
void | Push (T value) |
T | Pop () |
T | Pop (const N index) |
void | Resize (const N newSize) |
void | ExactSize () |
Removes any extra allocated memory. | |
void | Clear () |
Releases the resources of the vector. | |
Protected Attributes | |
N | rawSize |
N | size |
N | stride |
T * | data |
An array with extra memory pre-allocated for fast pushes.
T | Array data type to use. |
N | Number data type to use. |
|
inline |
Frees any data created on the heap.
|
inline |
Default members initialization.
|
inline |
Initializes members for pre-allocated memory to write to later.
[in] | size | The size of memory to pre-allocate. |
[in] | stride | The stride size of memory to pre-allocate. |
|
inline |
Initializes this vector with an initializer list object.
[in] | list | The given initializer list. |
[in] | stride | The extra amount of memory to allocate. |
|
inline |
Initializes members with given C-style array.
[in] | data | The C-style array. |
[in] | size | The size of the given C-style array. |
[in] | stride | The size of the extra memory allocated. |
|
inline |
Copies all members from the given vector object.
[in] | vec | The vector object to copy from. |
|
inlinenoexcept |
|
inline |
Releases the resources of the vector.
|
inline |
Copies a C-style array with offsets.
[in] | dstOffset | The offset index to copy the given C-style array to. |
[in] | src | The given C-style array. |
[in] | size | The size from the given C-style array to copy. |
|
inline |
Copies a vector object with offsets.
[in] | dstOffset | The offset index to copy the given vector object to. |
[in] | src | The given vector object. |
[in] | srcOffset | The offset index from the given vector object to copy from. |
|
inline |
Retrieves the index at the end of the array.
|
inline |
Removes any extra allocated memory.
|
inline |
Inserts a value at a specified index that is available.
[in] | index | The index to insert the value at. |
[in] | value | The given value to insert. |
|
inline |
Retrieves the raw C-style array from casting an array object.
|
inline |
|
inline |
Adds a given value at the end of the vector.
[in] | value | The given value to push to the end of the vector. |
|
inline |
Adds a given initializer list at the end of the vector.
[in] | value | The given initializer list to push to the end of the vector. |
|
inline |
Copies all members from the given vector object.
[in] | vec | The vector object to copy from. |
|
inlinenoexcept |
|
inline |
|
inline |
Much like the stack it pops a value at the end of the vector.
|
inline |
Will swap the value at the given index with the value at the end of the vector and pops it.
[in] | index | The index of the value to swap with. |
|
inline |
Adds a given C-style array at the end of the vector.
[in] | value | The given C-style array to push to the end of the vector. |
[in] | size | The size of the given C-style array. |
|
inline |
Adds a given initializer at the end of the vector.
[in] | value | The given initializer list to push to the end of the vector. |
|
inline |
Adds a given value at the end of the vector.
[in] | value | The given value to push to the end of the vector. |
|
inline |
Adds a given vector object at the end of the vector.
[in] | value | The given vector object to push to the end of the vector. |
|
inline |
Retrieves the size of the vector object including the extra memory allocated.
|
inline |
Removes a value at a specified index.
[in] | index | The index to remove the value at. |
|
inline |
Resizes the vector while keeping its alignment.
[in] | newSize | The size to change to. |
|
inline |
Retrieves the size of the array not including the extra memory allocated.
|
inline |
Retrieves the size of the extra memory allocated.
|
inline |
Swaps two values in the vector.
[in] | a | The first index to swap with. |
[in] | b | The second index to swap with. |
|
protected |
|
protected |
|
protected |
|
protected |