CArrayFix< TAny > Class Template Reference

#include <e32base.h>

Link against: eposprvtyp.lib

template <>
class CArrayFix< TAny > : public CArrayFixBase

Inherits from

Detailed Description

A template specialisation base class for arrays of fixed length untyped objects.

The public functions provide standard array behaviour.

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

Constructor & Destructor Documentation

CArrayFix ( TBufRep, TInt, TInt )

CArrayFix(TBufRepaRep,
TIntaRecordLength,
TIntaGranularity
)[inline]

Member Function Documentation

AppendL ( const TAny * )

voidAppendL(const TAny *aPtr)[inline]

Appends the specified untyped element onto the end of the array.

leave
KErrNoMemory The function may attempt to expand the array buffer. If there is insufficient memory available, the function leaves, in which case the array is left in the state it was in before the call.
ParameterDescription
aPtrA pointer to an untyped element to be appended.

AppendL ( const TAny *, TInt )

voidAppendL(const TAny *aPtr,
TIntaCount
)[inline]

Appends one or more untyped elements onto the end of the array.

leave
KErrNoMemory The function may attempt to expand the array buffer. If there is insufficient memory available, the function leaves, in which case the array is left in the state it was in before the call.
panic
E32USER-CBase 23, if aCount is negative.
ParameterDescription
aPtrA pointer to the first of the contiguous untyped elements to be appended.
aCountThe number of contiguous elements located at aPtr to be appended.

At ( TInt )

const TAny *At(TIntanIndex)const [inline]

Reimplemented from CArrayFixBase::At(TInt)const

Gets a pointer to the untyped element located at the specified position within the array.

panic
E32User-CBase 21, if anIndex is negative or is greater than or equal to the number of objects currently within the array.
ParameterDescription
anIndexThe position of the element within the array. The position is relative to zero; i.e. zero implies the first element in the array.

Returns: A pointer to the untyped element located at position anIndex within the array.

At ( TInt )

TAny *At(TIntanIndex)[inline]

Gets a pointer to the untyped element located at the specified position within the array.

panic
E32User-CBase 21, if anIndex is negative or is greater than or equal to the number of objects currently within the array.
ParameterDescription
anIndexThe position of the element within the array. The position is relative to zero; i.e. zero implies the first element in the array.

Returns: A pointer to the untyped element located at position anIndex within the array.

Back ( TInt )

const TAny *Back(TIntanIndex)const [inline]

Gets a pointer to the beginning of a contiguous region.

For flat buffers, the function always returns a pointer to the beginning of the buffer.

For segmented buffers, the function returns a pointer to the beginning of the segment for all elements in that segment except the first. If the element at the specified position is the first in a segment, then the function returns a pointer the beginning of the previous segment.

For the first element in the array, the function returns a NULL pointer.

panic
E32User-CBase 21, if anIndex is negative or is greater than or equal to the number of objects currently within the array.
ParameterDescription
anIndexThe position of the element within the array. The position is relative to zero; i.e. zero implies the first element in the array.

Returns: A pointer to the beginning of the contiguous region.

Back ( TInt )

TAny *Back(TIntanIndex)[inline]

Gets a pointer to the beginning of a contiguous region.

For flat buffers, the function always returns a pointer to the beginning of the buffer.

For segmented buffers, the function returns a pointer to the beginning of the segment for all elements in that segment except the first. If the element at the specified position is the first in a segment, then the function returns a pointer the beginning of the previous segment.

For the first element in the array, the function returns a NULL pointer.

panic
E32User-CBase 21, if anIndex is negative or is greater than or equal to the number of objects currently within the array.
ParameterDescription
anIndexThe position of the element within the array. The position is relative to zero; i.e. zero implies the first element in the array.

Returns: A pointer to the beginning of the contiguous region.

End ( TInt )

const TAny *End(TIntanIndex)const [inline]

Gets a pointer to the first byte following the end of the contiguous region containing the element at the specfied position within the array.

For flat buffers, the pointer always points to the first byte following the end of the buffer.

For segmented buffers, the pointer always points to the first byte following the end of the segment which contains the element.

panic
E32USER-CBase 21, if anIndex is negative or greater than or equal to the number of objects currently within the array.
ParameterDescription
anIndexThe position of the element within the array. The position is relative to zero; i.e. zero implies the first element in the array.

Returns: A pointer to the byte following the end of the contiguous region.

End ( TInt )

TAny *End(TIntanIndex)[inline]

Gets a pointer to the first byte following the end of the contiguous region containing the element at the specfied position within the array.

For flat buffers, the pointer always points to the first byte following the end of the buffer.

For segmented buffers, the pointer always points to the first byte following the end of the segment which contains the element.

panic
E32USER-CBase 21, if anIndex is negative or greater than or equal to the number of objects currently within the array.
ParameterDescription
anIndexThe position of the element within the array. The position is relative to zero; i.e. zero implies the first element in the array.

Returns: A pointer to the byte following the end of the contiguous region.

ExtendL ( )

TAny *ExtendL()[inline]

Expands the array by the length of one element at the end of the array and returns a pointer to this new location.

As elements are untyped, no construction is possible and the content of the new location remains undefined.

leave
KErrNoMemory The function may attempt to expand the array buffer. If there is insufficient memory available, the function leaves, in which case the array is left in the state it was in before the call.

Returns: A pointer to the new element location at the end of the array.