|
CartoType API
|
#include <cartotype_array.h>
Public Member Functions | |
| CArray (int32 aIncrement=0) | |
| TResult | Append (const T *aElement, int32 aCount) |
| TResult | Append (const T &aElement) |
| TResult | Insert (const T *aElement, int32 aIndex, int32 aCount) |
| TResult | Insert (const T &aElement, int32 aIndex) |
| TResult | Replace (int32 aIndex, int32 aOldCount, const T *aElement, int32 aNewCount) |
| void | Delete (int32 aIndex, int32 aCount=1) |
| void | Clear () |
| void | SetSizeToZero () |
| TResult | SetSize (int32 aSize) |
| int32 | Count () const |
| T * | Data () |
| const T * | Data () const |
| T & | operator[] (int32 aIndex) |
| const T & | operator[] (int32 aIndex) const |
| TResult | Reserve (int32 aCount) |
| T * | RemoveData () |
| int32 | MemoryUsed () const |
A variable-size array of objects of type T. This class should be used for arrays of T-class objects - that is, objects that do not have a destructor and act like relatively simple types, and can be copied using a bitwise copy of their bytes.
| CartoType::CArray< T >::CArray | ( | int32 | aIncrement = 0 | ) | [inline] |
Create an array with an increment specified by aIncrement. If aIncrement is zero, space for 8 elements is reserved when the first element is added, and after that, every time the size is exceeded the number of reserved elements is doubled.
The default behaviour is usually appropriate. However, if you specify a positive increment, the number of reserved elements is increased by that number when the size is exceeded. In both cases, the number of new elements reserved will be overridden when appending a larger number of elements all at once.
| TResult CartoType::CArray< T >::Append | ( | const T * | aElement, |
| int32 | aCount | ||
| ) | [inline] |
Append aCount elements stored contiguously in the C++ array aElement.
| TResult CartoType::CArray< T >::Append | ( | const T & | aElement | ) | [inline] |
Append a single element.
| void CartoType::CArray< T >::Clear | ( | ) | [inline] |
Delete all the elements.
Reimplemented from CartoType::CArrayBase.
| int32 CartoType::CArray< T >::Count | ( | ) | const [inline] |
Return the number of elements.
| T* CartoType::CArray< T >::Data | ( | ) | [inline] |
Return a writable pointer to the underlying C++ array of elements.
| const T* CartoType::CArray< T >::Data | ( | ) | const [inline] |
Return a read-only pointer to the underlying C++ array of elements.
| void CartoType::CArray< T >::Delete | ( | int32 | aIndex, |
| int32 | aCount = 1 |
||
| ) | [inline] |
Delete aCount elements, starting with aIndex.
Reimplemented from CartoType::CArrayBase.
| TResult CartoType::CArray< T >::Insert | ( | const T * | aElement, |
| int32 | aIndex, | ||
| int32 | aCount | ||
| ) | [inline] |
Insert aCount elements before the element indexed by aIndex.
| TResult CartoType::CArray< T >::Insert | ( | const T & | aElement, |
| int32 | aIndex | ||
| ) | [inline] |
Insert a single element before the element indexed by aIndex.
| int32 CartoType::CArray< T >::MemoryUsed | ( | ) | const [inline] |
Return the number of heap bytes used by the array.
| T& CartoType::CArray< T >::operator[] | ( | int32 | aIndex | ) | [inline] |
The writable array index operator, allowing the array to be treated like a C++ array.
| const T& CartoType::CArray< T >::operator[] | ( | int32 | aIndex | ) | const [inline] |
The constant array index operator, allowing the array to be treated like a C++ array.
| T* CartoType::CArray< T >::RemoveData | ( | ) | [inline] |
Extract the underlying C++ array and take ownership of it.
| TResult CartoType::CArray< T >::Replace | ( | int32 | aIndex, |
| int32 | aOldCount, | ||
| const T * | aElement, | ||
| int32 | aNewCount | ||
| ) | [inline] |
Replace aOldCount elements starting at aIndex with aNewCount elements from aElement.
| TResult CartoType::CArray< T >::Reserve | ( | int32 | aCount | ) | [inline] |
Reserve space for at least aCount elements.
Reimplemented from CartoType::CArrayBase.
| TResult CartoType::CArray< T >::SetSize | ( | int32 | aSize | ) | [inline] |
Set the size of the array.
Reimplemented from CartoType::CArrayBase.
| void CartoType::CArray< T >::SetSizeToZero | ( | ) | [inline] |
Set the size of the array to zero without discarding reserved memory.
Reimplemented from CartoType::CArrayBase.
1.7.5.1