#include <rdPtrArray.h>
Inheritance diagram for rdPtrArray:

Public Member Functions | |
| rdPtrArray (int aCapacity=128, const char *aName="UNKNOWN") | |
| Default constructor. | |
| rdPtrArray (const char *aFileName) | |
| Construct from a file. | |
| rdPtrArray (IDOM_Element *aElement) | |
| Construct based on an XML element. | |
| virtual | ~rdPtrArray () |
| Destructor. | |
| virtual void | setDescription (const char *aDescrip=NULL) |
| Set the description of this storage. | |
| virtual const char * | getDescription () const |
| Get a description of this storage. | |
| virtual bool | ensureCapacity (int aCapacity) |
| Ensure that the capacity of this expandable array is at least the specified amount. | |
| virtual int | getCapacity () const |
| Get the capacity of this storage instance. | |
| virtual void | setCapacityIncrement (int aIncrement=-1) |
| Set the amount by which the capacity is increased. | |
| virtual int | getCapacityIncrement () const |
| Get the amount by which the capacity is increased. | |
| virtual void | reset () |
| Reset the storage to start storing at index 0. | |
| virtual void | reset (int aIndex) |
| Reset the storage to start storing after the specified index. | |
| virtual int | getFirstEmpty () const |
| Get the index of the first empty array element. | |
| virtual int | getIndex (void *aObject) const |
| Get the index of an object by pointer value. | |
| virtual void * | set (int aIndex, void *aObject) |
| Set the pointer at a specified array index. | |
| virtual void * | get (int aIndex) const |
| Get the pointer at a specified array index. | |
| virtual void * | getLast () const |
| Get the last pointer in the array. | |
| virtual int | append (void *aObject) |
| Append an object. | |
| virtual int | append (rdPtrArray *aArray) |
| Append all the objects in an rdPtrArray object. | |
| virtual void * | remove (int aIndex) |
| Remove an object by index. | |
| virtual void * | remove (void *aObject) |
| Remove an object based on the object's pointer. | |
| virtual void | updateObject (bool aDeep=true) |
| Update this object based on its XML node. | |
| virtual void | updateNode (bool aDeep=true) |
| Update the XML node representing this object. | |
Protected Attributes | |
| int | _firstEmpty |
| Index of the first empty rdStateVector pointer- also the size. | |
| char * | _descrip |
| Description. | |
| int | _capacity |
| Current capacity. | |
| int | _capacityIncrement |
| Increment by which the current capacity is increased when the capacity of this storage instance is reached. | |
| void ** | _array |
| Array of void pointers. | |
Static Protected Attributes | |
| const int | CAPMIN = rdPtrArray_CAPMIN |
| Minimum capacity. | |
Private Member Functions | |
| void | allocateCapacity () |
| void | setNull () |
| Set all member variables to their null or default values. | |
Because the pointers are void pointers, this class is suitable for storing an array of pointers to objects of any type. The capacity of the class grows as needed.
When an rdPtrArray object is deleted, the delete operators for the stored elements are NOT called. The user or derived class is responsible for explicitly deleting all stored objects.
|
|
Construct from a file.
|
|
|
Construct based on an XML element.
|
|
|
Destructor. The destructor does NOT call the destructor for the pointer elements held in the array. It simply deletes the array itself. The user or derived class is responsible for deleting the array elements. |
|
|
Append an object.
Reimplemented in rdStorage. |
|
|
Ensure that the capacity of this expandable array is at least the specified amount.
|
|
|
Get the pointer at a specified array index. If the index is greater than or equal to the capacity of the array, NULL is returned.
|
|
|
Get a description of this storage.
|
|
|
Get the index of the first empty array element.
|
|
|
Get the index of an object by pointer value.
|
|
|
Get the last pointer in the array.
|
|
|
Remove an object based on the object's pointer. When an object is removed, the array locations of all objects following the removed object are shifted down by 1. This method is fairly expensive to call at this time because the entire array is searched sequentially. The caller is responsible for deleting the removed object. To remove an object without shifting the array locations of all objects following the removed object, use the method set().
|
|
|
Remove an object by index. When an object is removed, the array locations of all objects following the removed object are shifted down by 1. The caller is responsible for deleting the removed object. To remove an object without shifting the array locations of all objects following the removed object, use the method set().
|
|
||||||||||||
|
Set the pointer at a specified array index. If the index is greater than or equal to the capacity, sufficient capacity is added. It is permissible to set the value of an array element to NULL.
|
|
|
Set the amount by which the capacity is increased. If an increment is sent in that is less than 0 or this method is called with no argument, the capacity is set to double whenever the capacity is exceeded.
|
|
|
Set the description of this storage. If the last character of a description is a carriage return, it is stripped.
|
|
|
Update the XML node representing this object.
Reimplemented from rdObject. Reimplemented in rdControlSet, rdActuatorSet, rdContactForceSet, rdEdges, rdGBodies, rdTriangles, and rdVertices. |
|
|
Update this object based on its XML node.
Reimplemented from rdObject. Reimplemented in rdControlSet, rdActuatorSet, rdContactForceSet, rdEdges, rdGBodies, and rdVertices. |
1.3