Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: e32base.h
Link against: euser.lib

Class CArrayPakBase

class CArrayPakBase : public CBase;

Description

An implementation base class for all variable length, packed arrays.

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

Derivation

Members

Defined in CArrayPakBase:
Compress(), Count(), Delete(), Delete(), Length(), Reset(), SortL(), ~CArrayPakBase()

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


Construction and destruction


~CArrayPakBase()

IMPORT_C ~CArrayPakBase();

Description

Destructor.

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()

IMPORT_C TInt Length(TInt anIndex) const;

Description

Gets the length of the specified element.

Parameters

TInt anIndex

The position of the element within the array. The position is relative to zero, (i.e. the first element in the array is at position 0).

Return value

TInt

The length of the element at position anIndex.

Panic codes

E32USER-CBase

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


Compress()

IMPORT_C void Compress();

Description

Removes 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.

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.


SortL()

IMPORT_C void SortL(TKeyArrayVar &aKey);

Description

Sorts the elements of the array into key sequence.

Note that the function requires a TKeyArrayVar key object because SortL() creates a temporary CArrayVarFlat array in its implementation and uses that array's Sort() member function.

Parameters

TKeyArrayVar &aKey

The key object defining the properties of the key.

See also:


Delete()

IMPORT_C void Delete(TInt anIndex);

Description

Removes a single element from the array.

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

Parameters

TInt anIndex

The position within the array of the element to delete, relative to zero.

Panic codes

E32USER-CBase

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


Delete()

IMPORT_C void Delete(TInt anIndex, TInt aCount);

Description

Removes 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 CArrayPakBase::Compress() to return excess space to the heap.

Parameters

TInt anIndex

The position within the array from where deletion of elements is to start, relative to zero.

TInt aCount

The number of elements to be deleted from the array.

Panic codes

E32USER-CBase

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

E32USER-CBase

26, if aCount is negative.