![]() |
Polygon Crucher SDK - Documentation
Documentation
|
CXArray is an array of simple data information which does not requires to call a constructor / destructor. More...
CXArray is an array of simple data information which does not requires to call a constructor / destructor.
If you intend to manage array of more complex data, please look at CElementArray.
TYPE | specified the data type stored in the array. |
#include <XTemplate.h>
Public Types | |
enum | GrowMode { GROW_DEFAULT = 0 , GROW_KEEP_MODE = -1 , GROW_DOUBLE_SIZE = -2 } |
typedef enum CXArray::GrowMode | GrowMode |
Public Member Functions | |
CXArray (bool enableMemcpy=true) | |
CXArray (const CXArray< TYPE, ARG_TYPE > ©From) | |
int | GetSizeOfElement () const |
int | GetSize () const |
void | SetSize (int newCount, int newGrowCount=GROW_KEEP_MODE) |
The buffer always grows unless FreeExtra / RemoveAll(false) is called. | |
void | PreAllocate (int size, int newGrowCount=GROW_KEEP_MODE) |
Preallocate size elements. GetSize() return 0 after the call. | |
void | FreeExtra () |
Remove extra data allocated when adding data. | |
void | RemoveAll (bool keepBuffer=false) |
Remove all data and set size to 0. | |
const TYPE * | GetData () const |
Get raw array const data access. | |
TYPE * | GetData () |
Get raw array data access for modifying data directly. | |
void | SetAtGrow (int index, ARG_TYPE newElement, int nGrowBy=GROW_KEEP_MODE) |
int | Add (ARG_TYPE newElement, int nGrowBy=GROW_KEEP_MODE) |
int | AddArray (const CXArray< TYPE, ARG_TYPE > &src) |
Add an array to another array. There might be duplicated items. | |
void | Copy (const CXArray< TYPE, ARG_TYPE > &src) |
void | Copy (const CXArray< TYPE, ARG_TYPE > *src) |
const TYPE & | operator[] (int index) const |
TYPE & | operator[] (int index) |
void | InsertAt (int index, ARG_TYPE newElement, int insertCount=1) |
void | RemoveAt (int index, int removedCount=1) |
bool | Remove (ARG_TYPE newElement, bool firstonly=true) |
Remove newElement and return true if found. If firstonly = true, the return return once the first newElement has been removed. | |
void | Serialize (CXArchive &) |
GrowMode control the way the array inflate while adding data.