Public Member Functions | |
PointerArray () | |
The constructor for PointerArray simply calls the Construct function. | |
~PointerArray () | |
The destructor for LongArray simply calls the Destruct function. | |
void | Construct () |
The Construct function readies the internal structure of the PointerArray for use. | |
void | Destruct () |
The Destruct function cleans up the internal structure of the PointerArray. | |
void | AddPointer (char *t) |
The AddPointer function adds a new unsigned long to the PointerArray. | |
char * | ReturnAt (unsigned long i) const |
The ReturnAt function is used to get a pointer stored in a specific position within the array. | |
void | AddAt (unsigned long i, char *t) |
The AddAt function replaces an element of the array with a new pointer. | |
void | RemoveAt (unsigned long i) |
The RemoveAt function removes the pointer at a given position from the array. | |
unsigned long | NumberOfPointers () const |
The NumberOfPointers function returns the number of elements currently in the array. | |
Public Attributes | |
char ** | ar |
The internal array data. | |
unsigned long | size |
The number of available elements in the internal array. | |
unsigned long | used |
The number of elements in the internal array that are currently used. |
The pointer data is returned and pased to functions as char pointers, so you will need to use casts for other kinds of pointers. This class' implementation is nearly identical to Int8Array, CThingArray, and LongArray.
|
The constructor for PointerArray simply calls the Construct function.
|
|
The destructor for LongArray simply calls the Destruct function.
|
|
The AddAt function replaces an element of the array with a new pointer. If you try to replace an element at a position greater than the number of elements in the array nothing will happen.
|
|
The AddPointer function adds a new unsigned long to the PointerArray. If there is not enough storage in the internal array it will be expanded. The new pointer is always added to the end of the array. The size of the array is expanded by 8 every time it needs to be resized.
|
|
The Construct function readies the internal structure of the PointerArray for use. To reset an PointerArray you can call Destruct on it followed by a call to Construct.
|
|
The Destruct function cleans up the internal structure of the PointerArray. The Destruct function does not attempt to free the pointers in any way.
|
|
The RemoveAt function removes the pointer at a given position from the array. The old pointerg is replaced by what was previously the last pointer in the array and then the active part of the array is reduced by one. The RemoveAt function does not preserve the order of elements. Attempting to remove a position greater than the number of elements in the array has no effect.
|
|
The ReturnAt function is used to get a pointer stored in a specific position within the array. If you attempt to return a pointer at a position greater than the number of elements stored in the array NULL will be the result.
|