24 #include <AtomsUtils/Globals.h>
67 void rcMemCpy(
void* dst,
void* src,
int size);
92 inline void push(
int item) {
resize(m_size+1); m_data[m_size-1] = item; }
96 inline int pop() {
if (m_size > 0) m_size--;
return m_data[m_size]; }
101 inline const int&
operator[](
int i)
const {
return m_data[i]; }
109 inline int size()
const {
return m_size; }
112 bool contains(
int n)
const;
121 inline T* operator=(T* p);
135 inline operator T*() {
return ptr; }
147 if (n && newData) rcMemCpy(newData, ptr,
sizeof(T) * n);
167 inline T* operator=(T* p);
175 for (
int itemIndex = 0; itemIndex < itemCount; ++itemIndex)
184 inline operator T*() {
return ptr; }
A simple dynamic array of integers.
Definition: RecastAlloc.h:71
rcIntArray()
Constructs an instance with an initial array size of zero.
Definition: RecastAlloc.h:79
int & operator[](int i)
Definition: RecastAlloc.h:106
int size() const
The current size of the integer array.
Definition: RecastAlloc.h:109
int pop()
Definition: RecastAlloc.h:96
const int & operator[](int i) const
Definition: RecastAlloc.h:101
void push(int item)
Definition: RecastAlloc.h:92
rcIntArray(int n)
Definition: RecastAlloc.h:83
Definition: RecastAlloc.h:118
rcScopedDelete(T *p)
Definition: RecastAlloc.h:130
rcScopedDelete()
Constructs an instance with a null pointer.
Definition: RecastAlloc.h:125
bool resizeGrow(int n)
resize and copy existing memory (n = element count), doesn't destruct elements!
Definition: RecastAlloc.h:142
Definition: RecastAlloc.h:162
rcScopedStructArrayDelete(const int n)
Constructs an array of instances of T.
Definition: RecastAlloc.h:171
AtomsCore namespace.
Definition: Base64.h:13
void * rcAlloc(int size, rcAllocHint hint)
void *() rcAllocFunc(int size, rcAllocHint hint)
A memory allocation function.
Definition: RecastAlloc.h:43
rcAllocHint
Definition: RecastAlloc.h:33
@ RC_ALLOC_TEMP
Memory used temporarily within a function.
Definition: RecastAlloc.h:35
@ RC_ALLOC_PERM
Memory will persist after a function call.
Definition: RecastAlloc.h:34
void() rcFreeFunc(void *ptr)
Definition: RecastAlloc.h:48
ATOMSUTILS_EXPORT void rcAllocSetCustom(rcAllocFunc *allocFunc, rcFreeFunc *freeFunc)