PAbstractArray
to a specific element type.
More...
#include <array.h>
Inheritance diagram for PScalarArray< T >:
Public Member Functions | |
Construction | |
PScalarArray (PINDEX initialSize=0) | |
Construct a new dynamic array of elements of the specified type. | |
PScalarArray (T const *buffer, PINDEX length, PBoolean dynamic=true) | |
Construct a new dynamic array of elements of the specified type. | |
Protected Member Functions | |
virtual void | ReadElementFrom (istream &stream, PINDEX index) |
PAbstractArray
to a specific element type.
The functions in this class primarily do all the appropriate casting of types.
Note that if templates are not used the PSCALAR_ARRAY
macro will simulate the template instantiation.
The following classes are instantiated automatically for the basic scalar types:
PScalarArray< T >::PScalarArray | ( | PINDEX | initialSize = 0 |
) | [inline] |
Construct a new dynamic array of elements of the specified type.
The array is initialised to all zero bytes. Note that this may not be logically equivalent to the zero value for the type, though this would be very rare.
initialSize | Initial number of elements in the array. |
PScalarArray< T >::PScalarArray | ( | T const * | buffer, | |
PINDEX | length, | |||
PBoolean | dynamic = true | |||
) | [inline] |
Construct a new dynamic array of elements of the specified type.
buffer | Pointer to an array of the elements of type T. |
length |
Number of elements pointed to by buffer . |
dynamic | Buffer is copied and dynamically allocated. |
virtual void PScalarArray< T >::ReadElementFrom | ( | istream & | stream, | |
PINDEX | index | |||
) | [inline, protected, virtual] |
Reimplemented from PAbstractArray.