Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: e32base.h
Link against: euser.lib

Class CArrayFixBase

class CArrayFixBase : public CBase;

Description

Base class for arrays of fixed length objects.

It provides implementation and public functions which are common to all arrays of this type.

The class is always derived from and is never instantiated explicitly.

Derivation

Members

Defined in CArrayFixBase:
Compress(), Count(), Delete(), Delete(), Length(), Reset(), Sort(), ~CArrayFixBase()

Inherited from CBase:
Extension_(), operator new()


Construction and destruction


~CArrayFixBase()

IMPORT_C ~CArrayFixBase();

Description

Destructor.

This frees all resources owned by the object, prior to its destruction.

[Top]


Member functions


Count()

inline TInt Count() const;

Description

Gets the number of elements held in the array.

Return value

TInt

The number of array elements


Length()

inline TInt Length() const;

Description

Gets the length of an element.

Return value

TInt

The length of an element of type class T.


Compress()

IMPORT_C void Compress();

Description

Compresses the array.

The function removes the excess space from the array buffer. The effect is to reduce the memory allocated to the array buffer so that it is just sufficient to contain the elements of the array. This applies to both flat and segmented array buffers.

If the array is empty, then the memory allocated to the array buffer is freed.


Reset()

IMPORT_C void Reset();

Description

Deletes all elements from the array and frees the memory allocated to the array buffer.


Sort()

IMPORT_C TInt Sort(TKeyArrayFix &aKey);

Description

Sorts the elements of the array into key sequence.

Parameters

TKeyArrayFix &aKey

The key object defining the properties of the key.

Return value

TInt

KErrNone if the sort completes successfully. KErrGeneral if the stack overflows


Delete()

IMPORT_C void Delete(TInt anIndex);

Description

Deletes a single element from the array at a specified position.

Deleting elements from the array does not cause the array buffer to be automatically compressed. Call CArrayFixBase::Compress() to return excess space to the heap.

Parameters

TInt anIndex

The position within the array at which to delete the element, This is a value relative to zero.

Panic codes

E32USER-CBase

21, if anIndex is negative or is greater than or equal to the number of elements currently in the array.


Delete()

IMPORT_C void Delete(TInt anIndex, TInt aCount);

Description

Deletes one or more contiguous elements from the array, starting at a specific position.

Deleting elements from the array does not cause the array buffer to be automatically compressed. Call CArrayFixBase::Compress() to return excess space to the heap.

Parameters

TInt anIndex

The position within the array from where deletion of elements is to start. The position is relative to zero, i.e. zero implies that elements, starting with the first, are deleted from the array.

TInt aCount

The number of contiguous elements to be deleted from the array.

Panic codes

E32USER-CBase

21, if anIndex is negative, or is greater than or equal to the number of elements currently in the array.

E32USER-CBase

22, if aCount is negative.

E32USER-CBase

29, if the sum of anIndex and aCount is greater than or equal to the number of elements currently in the array.