Location:
e32base.h
Link against: euser.lib
CArrayPakBase
Supported from 5.0
An implementation base class for variable length, packed, arrays. It provides implementation and public functions which are common to all variable length, packed, type arrays.
The class is always derived from and is never instantiated explicitly.
|
Defined in CArrayPakBase
:
Compress()
, Count()
, Delete()
, Length()
, Reset()
, SortL()
, ~CArrayPakBase()
Inherited from CBase
:
operator new()
TInt Count() const;
Returns the number of elements held in the array.
|
TInt Length(TInt anIndex) const;
Returns the length of a specific element.
|
|
void Reset();
Deletes all elements from the array and frees the memory allocated to the array buffer.
void Compress();
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.
void SortL(TKeyArrayVar &aKey);
Sorts the elements of the array into key sequence.
Notes
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.
|
|
void Delete(TInt anIndex);
void Delete(TInt anIndex,TInt aCount);
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.
Notes
The sum of anIndex
and aCount
must not be
greater than the number of elements currently in the array, otherwise the
function raises an E32USER-CBase 29 panic.
|