83 inline void push(
int item) {
resize(m_size+1); m_data[m_size-1] = item; }
87 inline int pop() {
if (m_size > 0) m_size--;
return m_data[m_size]; }
92 inline const int&
operator[](
int i)
const {
return m_data[i]; }
100 inline int size()
const {
return m_size; }
108 inline T* operator=(T* p);
121 inline operator T*() {
return ptr; }
rcIntArray(int n)
Constructs an instance initialized to the specified size.
int & operator[](int i)
The value at the specified array index.
int size() const
The current size of the integer array.
rcAllocHint
Provides hint values to the memory allocator on how long the memory is expected to be used...
A simple helper class used to delete an array when it goes out of scope.
void *( rcAllocFunc)(int size, rcAllocHint hint)
A memory allocation function.
void rcFree(void *ptr)
Deallocates a memory block.
void * rcAlloc(int size, rcAllocHint hint)
Allocates a memory block.
int pop()
Returns the value at the end of the array and reduces the size by one.
const int & operator[](int i) const
The value at the specified array index.
Memory will persist after a function call.
void rcAllocSetCustom(rcAllocFunc *allocFunc, rcFreeFunc *freeFunc)
Sets the base custom allocation functions to be used by Recast.
rcScopedDelete()
Constructs an instance with a null pointer.
rcScopedDelete(T *p)
Constructs an instance with the specified pointer.
Memory used temporarily within a function.
rcIntArray()
Constructs an instance with an initial array size of zero.
void( rcFreeFunc)(void *ptr)
A memory deallocation function.
void resize(int n)
Specifies the new size of the integer array.
void push(int item)
Push the specified integer onto the end of the array and increases the size by one.
A simple dynamic array of integers.