CArrayPakBase Class Reference

#include <e32base.h>

class CArrayPakBase : public CBase

Inherits from

Detailed Description

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

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

Constructor & Destructor Documentation

CArrayPakBase ( TBufRep, TInt )

IMPORT_CCArrayPakBase(TBufRepaRep,
TIntaGranularity
)[protected]

~CArrayPakBase ( )

IMPORT_C~CArrayPakBase()

Destructor.

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

Member Function Documentation

At ( TInt )

IMPORT_C TAny *At(TIntanIndex)const

AtR ( const CBase *, TInt )

IMPORT_C const TAny *AtR(const CBase *aPtr,
TIntanIndex
)[protected, static]

BuildVarArrayL ( CArrayVarFlat< TAny > *& )

IMPORT_C voidBuildVarArrayL(CArrayVarFlat< TAny > *&aVarFlat)[protected]

Compress ( )

IMPORT_C voidCompress()

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.

Count ( )

TInt Count()const [inline]

Gets the number of elements held in the array.

Returns: The number of array elements.

CountR ( const CBase * )

IMPORT_C TIntCountR(const CBase *aPtr)[protected, static]

Delete ( TInt )

IMPORT_C voidDelete(TIntanIndex)

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.

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

See also: CArrayPakBase::Compress

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

Delete ( TInt, TInt )

IMPORT_C voidDelete(TIntanIndex,
TIntaCount
)

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.

panic
E32USER-CBase 21, if anIndex is negative or greater than the number of elements currently in the array.
panic
E32USER-CBase 26, if aCount is negative.

See also: CArrayPakBase::Compress

ParameterDescription
anIndexThe position within the array from where deletion of elements is to start, relative to zero.
aCountThe number of elements to be deleted from the array.

ExpandL ( TInt, TInt )

IMPORT_C TAny *ExpandL(TIntanIndex,
TIntaLength
)

Find ( const TAny *, TKeyArrayPak &, TInt & )

IMPORT_C TIntFind(const TAny *aPtr,
TKeyArrayPak &aKey,
TInt &anIndex
)const

FindIsq ( const TAny *, TKeyArrayPak &, TInt & )

IMPORT_C TIntFindIsq(const TAny *aPtr,
TKeyArrayPak &aKey,
TInt &anIndex
)const

GetOffset ( TInt )

IMPORT_C TIntGetOffset(TIntanIndex)const [protected]

InsertIsqAllowDuplicatesL ( const TAny *, TInt, TKeyArrayPak & )

IMPORT_C TIntInsertIsqAllowDuplicatesL(const TAny *aPtr,
TIntaLength,
TKeyArrayPak &aKey
)

InsertIsqL ( const TAny *, TInt, TKeyArrayPak & )

IMPORT_C TIntInsertIsqL(const TAny *aPtr,
TIntaLength,
TKeyArrayPak &aKey
)

InsertL ( TInt, const TAny *, TInt )

IMPORT_C voidInsertL(TIntanIndex,
const TAny *aPtr,
TIntaLength
)

Length ( TInt )

IMPORT_C TIntLength(TIntanIndex)const

Gets the length of the specified element.

panic
E32USER-CBase 21, if anIndex is negative or is greater than the number of elements currently in the array.
ParameterDescription
anIndexThe 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).

Returns: The length of the element at position anIndex.

Reset ( )

IMPORT_C voidReset()

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

SetKey ( TKeyArrayPak & )

IMPORT_C voidSetKey(TKeyArrayPak &aKey)const [protected]

SortL ( TKeyArrayVar & )

IMPORT_C voidSortL(TKeyArrayVar &aKey)

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.

See also: CArrayVarFlat

ParameterDescription
aKeyThe key object defining the properties of the key.