PArrayObjects
to a specific object type.
More...
#include <array.h>
Inheritance diagram for PArray< T >:
Public Member Functions | |
Construction | |
PArray (PINDEX initialSize=0) | |
Create a new array of objects. | |
Overrides from class PObject | |
virtual PObject * | Clone () const |
Make a complete duplicate of the array. | |
New functions for class | |
T & | operator[] (PINDEX index) const |
Retrieve a reference to the object in the array. | |
Protected Member Functions | |
PArray (int dummy, const PArray *c) |
PArrayObjects
to a specific object type.
The functions in this class primarily do all the appropriate casting of types.
Note that if templates are not used the PARRAY
macro will simulate the template instantiation.
Create a new array of objects.
The array is initially set to the specified size with each entry having NULL as is pointer value.
Note that by default, objects placed into the list will be deleted when removed or when all references to the list are destroyed.
initialSize | Initial number of objects in the array. |
Make a complete duplicate of the array.
Note that all objects in the array are also cloned, so this will make a complete copy of the array.
Reimplemented from PObject.
T& PArray< T >::operator[] | ( | PINDEX | index | ) | const [inline] |
Retrieve a reference to the object in the array.
If there was not an object at that ordinal position or the index was beyond the size of the array then the function asserts.
index
position. index | Index position in the collection of the object. |
Reimplemented in PStringArray.