Public Member Functions | |
LongArray () | |
The constructor for LongArray simply calls the Construct function. | |
~LongArray () | |
The destructor for LongArray simply calls the Destruct function. | |
void | Construct () |
The Construct function readies the internal structure of the LongArray for use. | |
void | Destruct () |
The Destruct function cleans up the internal structure of the LongArray. | |
void | AddLong (unsigned long t) |
The AddLong function adds a new unsigned long to the LongArray. | |
unsigned long | ReturnAt (unsigned long i) const |
The ReturnAt function is used to get an unsigned long stored in a specific position within the array. | |
void | AddAt (unsigned long i, unsigned long t) |
The AddAt function replaces an element of the array with a new unsigned long. | |
void | RemoveAt (unsigned long i) |
The RemoveAt function removes the unsigned long at a given position from the array. | |
unsigned long | NumberOfLongs () const |
The NumberOfLongs function returns the number of elements currently in the array. | |
unsigned long | Find (unsigned long v) const |
The Find function returns the index of the first element of a certain unsigned long value. | |
Public Attributes | |
unsigned long * | 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. |
This class' implementation is nearly identical to Int8Array, CThingArray, and PointerArray.
|
The constructor for LongArray 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 unsigned long. If you try to replace an element at a position greater than the number of elements in the array nothing will happen.
|
|
The AddLong function adds a new unsigned long to the LongArray. If there is not enough storage in the internal array it will be expanded. The new unsigned long 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 LongArray for use. To reset an LongArray you can call Destruct on it followed by a call to Construct.
|
|
The Destruct function cleans up the internal structure of the LongArray.
|
|
The Find function returns the index of the first element of a certain unsigned long value. The find function searches from the first element to the last element and returns the zero based index when it finds the item. If it cannot be found -1, cast to an unsigned long, is returned.
|
|
The RemoveAt function removes the unsigned long at a given position from the array. The old unsigned long is replaced by what was previously the last unsigned long 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 an unsigned long stored in a specific position within the array. If you attempt to return an unsigned long at a position greater than the number of elements stored in the array 0 will be the result.
|