CartoType API
Public Member Functions
CartoType::CPointerArray< T > Class Template Reference

#include <cartotype_array.h>

Inheritance diagram for CartoType::CPointerArray< T >:
CartoType::CArrayBase CartoType::CNonOwningPointerArray< T >

List of all members.

Public Member Functions

 CPointerArray (bool aOwnData=true, int32 aIncrement=0)
TResult Append (const T *const *aElement, int32 aCount)
TResult Append (const T *aElement)
T * Append (TResult &aError)
TResult Insert (const T *const *aElement, int32 aIndex, int32 aCount)
TResult Insert (const T *aElement, int32 aIndex)
void Delete (int32 aIndex, int32 aCount=1)
void Clear ()
void SetSizeToZero ()
TResult SetSize (int32 aSize)
int32 Count () const
T ** Data ()
const T *const * Data () const
T *& operator[] (int32 aIndex)
const T * operator[] (int32 aIndex) const
TResult Reserve (int32 aCount)
int32 MemoryUsed () const

Detailed Description

template<class T>
class CartoType::CPointerArray< T >

A variable-size array of objects of type T*. This class can be used for any type of object but is most convenient for an array of C-class objects or objects of variable size or variable derived class.


Constructor & Destructor Documentation

template<class T>
CartoType::CPointerArray< T >::CPointerArray ( bool  aOwnData = true,
int32  aIncrement = 0 
) [inline]

Create an array. If aOwnData is true the elements are owned by the array and deleted by its destructor, and when individually deleted; and ownership is transferred to the array when they are added to it. The meaning of aIncrement is the same as in CArray.


Member Function Documentation

template<class T>
TResult CartoType::CPointerArray< T >::Append ( const T *const *  aElement,
int32  aCount 
) [inline]

Append aCount elements stored contiguously in the C++ array aElement.

template<class T>
TResult CartoType::CPointerArray< T >::Append ( const T *  aElement) [inline]

Append a single element.

template<class T>
T* CartoType::CPointerArray< T >::Append ( TResult aError) [inline]

Create and append a new element and return a pointer to it.

template<class T>
void CartoType::CPointerArray< T >::Clear ( ) [inline]

Delete all the elements.

Reimplemented from CartoType::CArrayBase.

template<class T>
int32 CartoType::CPointerArray< T >::Count ( ) const [inline]

Return the number of elements.

template<class T>
T** CartoType::CPointerArray< T >::Data ( ) [inline]

Return a writable pointer to the underlying C++ array of pointers to elements.

template<class T>
const T* const* CartoType::CPointerArray< T >::Data ( ) const [inline]

Return a read-only pointer to the underlying C++ array of pointers to elements.

template<class T>
void CartoType::CPointerArray< T >::Delete ( int32  aIndex,
int32  aCount = 1 
) [inline]

Delete aCount elements, starting with aIndex.

Reimplemented from CartoType::CArrayBase.

template<class T>
TResult CartoType::CPointerArray< T >::Insert ( const T *const *  aElement,
int32  aIndex,
int32  aCount 
) [inline]

Insert aCount elements before the element indexed by aIndex.

template<class T>
TResult CartoType::CPointerArray< T >::Insert ( const T *  aElement,
int32  aIndex 
) [inline]

Insert a single element before the element indexed by aIndex.

template<class T>
int32 CartoType::CPointerArray< T >::MemoryUsed ( ) const [inline]

Return the number of heap bytes used by the array.

template<class T>
T*& CartoType::CPointerArray< T >::operator[] ( int32  aIndex) [inline]

The writable array index operator, allowing the array to be treated like a C++ array.

template<class T>
const T* CartoType::CPointerArray< T >::operator[] ( int32  aIndex) const [inline]

The constant array index operator, allowing the array to be treated like a C++ array.

template<class T>
TResult CartoType::CPointerArray< T >::Reserve ( int32  aCount) [inline]

Reserve space for at least aCount elements.

Reimplemented from CartoType::CArrayBase.

template<class T>
TResult CartoType::CPointerArray< T >::SetSize ( int32  aSize) [inline]

Set the size of the array.

Reimplemented from CartoType::CArrayBase.

template<class T>
void CartoType::CPointerArray< T >::SetSizeToZero ( ) [inline]

Set the size of the array to zero without discarding reserved memory.

Reimplemented from CartoType::CArrayBase.


The documentation for this class was generated from the following file: