Public Member Functions | |
CFX_ObjectArray (IFX_Allocator *pAllocator=0) | |
The constructor. More... | |
CFX_ObjectArray (const CFX_ObjectArray &other, IFX_Allocator *pAllocator=0) | |
The copy constructor. More... | |
~CFX_ObjectArray () | |
The destructor. | |
void | Add (const ObjectClass &data) |
Add a copy of an existing object to the array. More... | |
ObjectClass & | Add () |
Add an empty object to the array. More... | |
void * | AddSpace () |
Add an empty space to the array. More... | |
FX_INT32 | Append (const CFX_ObjectArray &src, FX_INT32 nStart=0, FX_INT32 nCount=-1) |
Append an array. More... | |
FX_INT32 | Copy (const CFX_ObjectArray &src, FX_INT32 nStart=0, FX_INT32 nCount=-1) |
Copy from an array. More... | |
ObjectClass * | GetDataPtr (int index) const |
Get a pointer to the specified element in the array. Direct pointer access. More... | |
int | GetSize () const |
Get the size of the array. More... | |
CFX_ObjectArray & | operator= (const CFX_ObjectArray &other) |
The assignment operator. More... | |
ObjectClass & | operator[] (int index) const |
Subscript([]) operator overload. This function returns a reference to the specified object specified by the zero-based index in nIndex. More... | |
void | RemoveAll () |
Remove all objects in the array. More... | |
void | RemoveAt (int index) |
Remove an object at specified position. More... | |
Additional Inherited Members | |
![]() | |
IFX_Allocator * | m_pAllocator |
Special allocator pointer. NULL to use default allocator. | |
The class represents Object array template. Each object in the array is "owned" by the array, so when this array is destructed, or an object is removed from the array, the object(s) will be destructed.
The template parameter <class T> must support "placement new". (any class derived from CFX_Object supports placement new).
|
inline |
The constructor.
[in] | pAllocator | An allocator. Default value: NULL. |
|
inline |
The copy constructor.
[in] | other | The other object array. |
[in] | pAllocator | An allocator. Default value: NULL. |
|
inline |
Add a copy of an existing object to the array.
To call this function, the template parameter class must support copy constructor.
[in] | data | The input object. |
|
inline |
Add an empty object to the array.
To call this function, the template parameter class must support default constructor.
|
inline |
Add an empty space to the array.
Caller should initialize object at once to make sure object is available.
|
inline |
Append an array.
[in] | src | The source array. |
[in] | nStart | The starting position to be appended in source array. Default value: 0. |
[in] | nCount | The total count of source elements to be appended. -1 means all elements from nStart position. Default value: -1. |
|
inline |
Copy from an array.
[in] | src | The source array. |
[in] | nStart | The starting position to be copied in source array. Default value: 0 |
[in] | nCount | The total count of source elements to be copied, -1 means all elements from nStart position. Default value: -1. |
|
inline |
Get a pointer to the specified element in the array. Direct pointer access.
[in] | index | Specifies the zero-based index of element in the array. |
|
inline |
Get the size of the array.
|
inline |
The assignment operator.
[in] | other | The other object array. |
|
inline |
Subscript([]) operator overload. This function returns a reference to the specified object specified by the zero-based index in nIndex.
[in] | index | Specifies the zero-based index in the array. |
|
inline |
Remove all objects in the array.
|
inline |
Remove an object at specified position.
[in] | index | Specifies the zero-based index of object in the array. |