template <> |
class CArrayPak< TAny > : public CArrayPakBase |
A template specialisation base class for variable length, packed, arrays.
The array buffer organisation is defined at construction.
The class is useful for constructing an array of variable length buffers, where the length is decided at run time.
This class is also useful as a data member of a base class in a thin template class/base class pair where the type of the array element is not known until the owning thin template class is instantiated.
Public Member Functions | |
---|---|
CArrayPak(TBufRep, TInt) | |
void | AppendL(const TAny *, TInt) |
const TAny * | At(TInt) |
TAny * | At(TInt) |
TAny * | ExtendL(TInt) |
CArrayPak | ( | TBufRep | aRep, |
TInt | aGranularity | ||
) | [inline] |
Constructs a variable array with the specified granularity and buffer organisation.
Note that no memory is allocated to the array buffer by this constructor.
TBufRep aRep | A pointer to a function used to expand the array buffer. The organisation of the array buffer is implied by the choice of this function. For a flat array buffer, pass (TBufRep)CBufFlat::NewL. For a segmented array buffer, pass (TBufRep)CBufSeg::NewL. |
TInt aGranularity | The granularity of the array. |
void | AppendL | ( | const TAny * | aPtr, |
TInt | aLength | |||
) | [inline] |
Appends the untyped element of the specified length onto the end of the array.
const TAny * | At | ( | TInt | anIndex | ) | const [inline] |
Gets a pointer to the untyped element located at the specified position within the array.
The compiler uses this variant of the function if the returned reference is used in an expression where that reference cannot be modified.
TInt anIndex | The position of the element within the array, relative to zero; i.e. zero implies the first element. |
TAny * | At | ( | TInt | anIndex | ) | [inline] |
Gets a pointer to the untyped element located at the specified position within the array.
The compiler uses this variant of the function if the returned reference is used in an expression where that reference can be modified.
TInt anIndex | The position of the element within the array, relative to zero; i.e. zero implies the first element. |
TAny * | ExtendL | ( | TInt | aLength | ) | [inline] |
Expands the array by one element of the specified length 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.
TInt aLength | The length of the new element. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.