| GPL_Reference | public |
GPL_Array(const unsigned long size)
Initialize the array by pre-allocating size elements of storage.
GPL_Array(const GPL_Array<T> & array)
Perform a shallow copy of array.
GPL_Reference::~GPL_Reference().
GPL_Reference::operator=(). Return the array.
T & operator[](const unsigned long i)
Return a reference to the i-th element in the array, counting from
zero. This method blindly steps into the data and is invalid if the
object is null or the index out-of-bounds. This method makes a private
copy of the data first, since the caller may modify the internal state.
const T & operator[](const unsigned long i) const
Return a reference to the i-th element in the array, counting from
zero. This method blindly steps into the data and is invalid if the
object is null or the index out-of-bounds.
operator T *(void)
Return the address of the block of elements. This provides access to
the internal data of the object and should be used with caution.
operator T *(void) const
Return the address of the block of elements. This provides access to
the internal data of the object and should be used with caution.
operator const T *(void) const
Return the address of the block of elements. This provides access to
the internal data of the object and should be used with caution.
GPL_Boolean operator==(const GPL_Array<T> & array) const
Return TRUE if every element of this array is exactly equivalent
to the corresponding element in array. Return FALSE otherwise.
GPL_Boolean operator!=(const GPL_Array<T> & array) const
Return TRUE if every element of this array is exactly equivalent
to the corresponding element in array. Return FALSE otherwise.
0 if the array is null.
unsigned long GetCount(void) const
Return the number of elements which have been accessed or 0 if
the array is null. The algorithm for determining access is to track the
largest index used.
T *GetData(void) const
Return the address of the block of elements. This provides access to
the internal data of the object and should be used with caution.
const T & GetElement(const unsigned long i) const
Return a reference to the i-th element in the array, counting from
zero. This method blindly steps into the data and is invalid if the
object is null or the index out-of-bounds.
GPL_Array<T> GetRange(const unsigned long from, const unsigned long to)
Return an array consisting of all of the elements starting at the
location specified by from and finishing at the location specified
by to or the end of the array, whichever is less.
void CopyToBuffer(T *buffer) const
Copy all of the elements of the array into the buffer buffer, which
is presumed to have at least GetSize() elements.
long Compare(const GPL_Array<T> & array) const
Perform an element-by-element comparison of this array with array.
Return 0 if the elements are identical and anything but 0 otherwise.
long Compare(T *data, const unsigned long count, const unsigned long from) const
Perform an element-by-element comparison of this array with the first
count elements of data starting at from.
Return 0 if the elements are identical and anything but 0 otherwise.
void SetData(T *data, const unsigned long count)
Set the data elements used by the array to be the first count
elements of data. The elements are copied from data.
void SetElement(const T & element, const unsigned long i)
Set the element at location i to be element. This method
blindly steps into the data and is invalid if the object is null or the
index out-of-bounds. This method makes a private copy of the data
first, since the caller may modify the internal state.
void SetRange(const GPL_Array<T> & array, const unsigned long at)
Update the array at the position at with array.
This method modifies the count.
void SetRange(const T *data, const unsigned long count, const unsigned long at)
Update the array at the position at with the first count
elements of data. This method modifies the count.
void Clear(void)
Clear the array of all elements. This method modifies the count.
void Resize(const unsigned long size)
Increase or decrease the number of elements allocated for the array.
This method modifies the count.
GPL_Boolean InsertElement(const T & element, const unsigned long at)
Insert an element element in the array at the location specified by
at. Return FALSE if the location is out of bounds or the
array does not have enough space and TRUE otherwise. This method
modifies the count.
GPL_Boolean InsertRange(const GPL_Array<T> & array, const unsigned long at)
Insert an array of elements, array, at the location specified by
at. Return FALSE if the location is out of bounds or the
array does not have enough space and TRUE otherwise. This method
modifies the count.
GPL_Boolean InsertRange(const T *data, const unsigned long count, const unsigned long at)
Insert the first count elements of data at the location
specified by at. Return FALSE if the location is out of
bounds or the array does not have enough space and TRUE otherwise.
This method modifies the count.
GPL_Boolean AppendElement(const T & element)
Append an element element to the end of the array. Return
FALSE if the location is out of bounds or the array does not have
enough space and TRUE otherwise. This method modifies the count.
GPL_Boolean AppendRange(const GPL_Array<T> & array)
Append the array of elements, array, to the end of the array. Return
FALSE if the array does not have enough space and TRUE
otherwise. This method modifies the count.
GPL_Boolean RemoveElement(const unsigned long i)
Removes the element at i. Return FALSE if i is out of
bounds and TRUE otherwise. This method modifies the count.
GPL_Boolean RemoveRange(const unsigned long from, const unsigned long to)
Removes elements starting with the element at from and finishing
with the element at to. Return FALSE of from is not less
than to or to is out of bounds and TRUE otherwise. This
method modifies the count.
GPL_Boolean MoveRange(const unsigned long count, const unsigned long from, const unsigned long to)
Move count elements from the location at from to the location at
to. Return FALSE if the array does not have enough space to
contain the moved range or TRUE if it does.
virtual void DataChanged(void)
This method is hook for sub-classes to use to know when the internal
state of an object has changed.