TrinityCore
|
A simple dynamic array of integers. More...
#include <RecastAlloc.h>
Public Member Functions | |
rcIntArray () | |
Constructs an instance with an initial array size of zero. More... | |
rcIntArray (int n) | |
~rcIntArray () | |
void | resize (int n) |
void | push (int item) |
int | pop () |
const int & | operator[] (int i) const |
int & | operator[] (int i) |
int | size () const |
The current size of the integer array. More... | |
Private Member Functions | |
rcIntArray (const rcIntArray &) | |
rcIntArray & | operator= (const rcIntArray &) |
Private Attributes | |
int * | m_data |
int | m_size |
int | m_cap |
A simple dynamic array of integers.
While it is possible to pre-allocate a specific array size during construction or by using the resize method, certain methods will automatically resize the array as needed.
|
inlineprivate |
|
inline |
Constructs an instance with an initial array size of zero.
|
inline |
Constructs an instance initialized to the specified size.
[in] | n | The initial size of the integer array. |
|
inline |
|
inlineprivate |
|
inline |
The value at the specified array index.
[in] | i | The index of the value. |
|
inline |
The value at the specified array index.
[in] | i | The index of the value. |
|
inline |
Returns the value at the end of the array and reduces the size by one.
|
inline |
Push the specified integer onto the end of the array and increases the size by one.
[in] | item | The new value. |
void rcIntArray::resize | ( | int | n | ) |
Specifies the new size of the integer array.
[in] | n | The new size of the integer array. |
Using this method ensures the array is at least large enough to hold the specified number of elements. This can improve performance by avoiding auto-resizing during use.
|
inline |
The current size of the integer array.
|
private |
|
private |
|
private |