This template class maps the PAbstractArray to a specific element type.
![]() | Construction |
![]() | Overrides from class PObject |
![]() | Overrides from class PContainer |
![]() | New functions for class |
Common functions for containers
Run Time Type functions
Comparison functions
I/O functions
Miscellaneous functions
This template class maps the 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 PBASEARRAY macro will simulate the template instantiation.
The following classes are instantiated automatically for the basic scalar types:
- PCharArray
- PBYTEArray
- PShortArray
- PWORDArray
- PIntArray
- PUnsignedArray
- PLongArray
- PDWORDArray
PBaseArray( T const * buffer, PINDEX length, BOOL dynamic = TRUE )
length - Number of elements pointed to by buffer.
dynamic - Buffer is copied and dynamically allocated.
Any dynamically allocated buffer will be freed.
It is unsafe to assume that the pointer is valid for very long after
return from this function. The array may be resized or otherwise
changed and the pointer returned invalidated. It should be used for
simple calls to atomic functions, or very careful examination of the
program logic must be performed.
T GetAt( PINDEX index ) const
void Attach( const T * buffer, PINDEX bufferSize )
bufferSize - Number of elements pointed to by buffer.T* GetPointer( PINDEX minSize = 0 )
This is functionally identical to the PContainer::GetAt() function.
This is functionally similar to the SetAt() function and allows
the array subscript to be an lvalue.
It is unsafe to assume that the pointer is valid for very long after
return from this function. The array may be resized or otherwise
changed and the pointer returned invalidated. It should be used for
simple calls to atomic functions, or very careful examination of the
program logic must be performed.
Note this does nothing and returns FALSE if the target array is not
dynamically allocated.
T& operator[]( PINDEX index )
operator T const *() const
BOOL Concatenate( const PBaseArray & array )
Alphabetic index HTML hierarchy of classes or Java