This document is an overview of dynamic arrays.
A large number of concrete classes provide dynamic arrays that are suitable for different circumstances. Unlike standard C++ arrays or the Symbian platform Fixed Size Arrays, the number of elements in a dynamic array can be altered at run-time.
The arrays are divided into two families:
the simple dynamic array family is for use in most cases
the extended dynamic array family allows advanced properties, such as the organisation of the array storage in memory, to be specified
The array classes are all templated. The template parameter defines the type of object which is to form an array element.
Simple dynamic array family
The simple dynamic array family offers arrays of objects, integers, and pointers. The array is always stored in a single memory area.
Object arrays are provided by RArray .
Integer arrays are provided by RArray<TInt> and RArray<TUint> .
Pointer arrays are provided by RPointerArray .
Extended dynamic array family
The extended dynamic array family, derived from CBase , allows the client to specify explicitly combinations of element properties and storage type. These terms are explained below.
Options for element properties are:
All elements are of the same size ( CArrayFixBase ).
Elements can be of different sizes ( CArrayVarBase ).
Elements are pointers to CBase -derived objects.
Elements are TAny objects.
Options for storage type are:
The elements are stored in a single memory area, and are of fixed length.
The elements are stored in multiple memory areas.
The elements are stored in a single memory area, but can be of variable length.
Different storage types present trade-offs between efficiency of memory usage and speed.
The following matrix demonstrates the concrete classes that are available. Storage type is shown horizontally, element properties vertically.
|CBase -pointer elements|
|Untyped elements (fixed length)|
|Untyped elements (variable length)|
Base classes are not shown on the above table. The inheritance hierarchies are based on the flat, segmented, packed divisions.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License v1.0.