![Symbian OS Library](../../../../a_stock/mainheading.gif)
![]() |
![]() |
|
Location:
e32cmn.h
class TArray;
Generic array.
This class defines a generic array which can be constructed by any of the following templated concrete arrays:
1. CArrayFixFlat<class T>
2. CArrayFixSeg<class T>
3. CArrayVarFlat<class T>
4. CArrayVarSeg<class T>
5. CArrayPakFlat<class T>
6. RArray<class T>
7. RPointerArray<class T>
and also by the following template specialisation classes:
1. RArray<TInt>
2. RArray<TUint>
It allows a degree of polymorphism amongst the array classes. It permits the operator[] and the Count()
member functions of an array to be invoked without knowing which array class has been used to construct that array.
TArray allows access to elements of an array but does not permit changes to those elements.
Use the Array() member function of an array to construct and return a TArray<class T> object for that array.
A TArray<class T> type object is not intended to be constructed explicitly by user code.
Defined in TArray
:
Count()
, TArray()
, operator[]()
inline TArray(TInt(*aCount)(const CBase *aPtr), const TAny *(*anAt)(const CBase *aPtr, TInt anIndex), const CBase *aPtr);
Constructor.
A TArray object is not intended to be instantiated explicitly. An object of this type is instantiated as a result of a call to to the Array() member function of a concrete array class
|
inline TInt Count() const;
Gets the number of elements currently held in the array for which this generic array has been constructed.
|
inline const T &operator[](TInt anIndex) const;
Gets a reference to the element located at the specified position.
The returned reference is const and cannot be used to change the element. Any member function of the referenced template class T must be declared as const if that function is to be accessed through this operator.
|
|
|