![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Section Contents
Not applicable
e32std.h
A wrapper class for C++ arrays which allows automatic checking of index values to ensure that all accesses are legal.
TFixedArray();
The default C++ constructor is used to construct an uninitialised C++ array.
TFixedArray(const T* aList,TInt aLength);
The C++ constructor is used to construct a C++ array initialized with aLength type T objects located at aList.
const T* aList |
A pointer to a set of contiguous type T objects. |
TInt aLength |
The number of type T objects at the location aList. In a debug build, this value must be strictly less than the template value <TInt S>, the size of the C++ array, otherwise the constructor raises a USER 133 panic. |
void Copy(const T* aList,TInt aLength);
Use this function to copy aLength type T objects located at aList into the C++ array. The copy operation starts at the beginning of the array, replacing any existing data.
const T* aList |
A pointer to a set of contiguous type T objects. |
TInt aLength |
The number of type T objects at the location aList. In a debug build, this value must be strictly less than the template value <TInt S>, the size of the C++ array, otherwise the constructor raises a USER 133 panic. |
void Reset();
Use this function to zero fill the array; i.e. to fill every element of the array with binary zeroes.
void DeleteAll();
Use this function to invoke the delete operator for every member of the array. This function can only be used for arrays of pointers to CBase derived objects.
If the array is to be used after a call to this function, then Reset() should be called to set the array elements to NULL.
TInt Count();
Use this function to return the size of the array; i.e. the number of elements in the array.
The size of the C++ array is always fixed and is the same value as the template parameter <TInt S>.
TInt |
The size of the C++ array |
TInt Length();
Use this function to return the length of an array element, in bytes.
TInt |
The length of an array element, in bytes. |
T& At(TInt aIndex);
const T& At(TInt aIndex) const;
Use these functions to return a reference to the element at index aIndex within the C++ array.
An index is relative to zero so that the first element has index zero, the second element has index one etc. The specified value is checked to ensure that it is within the valid range in both release and debug builds.
The compiler chooses the appropriate function variant depending on the context of the call.
TInt aIndex |
The index of the element within the array. This value must be greater than or equal to zero and less than the size of the array (i.e. the number of elements as defined by the <TInt S> template parameter), otherwise the function raises a USER 133 panic. |
T& |
A reference to an element of the array. |
const T& |
A reference to a const element of the array; the element cannot be changed through this reference. |
T& operator[](TInt aIndex);
const T& operator[](TInt aIndex) const;
Use these operators to return a reference to the element at index aIndex within the C++ array.
An index is relative to zero so that the first element has index zero, the second element has index one etc. The specified value is only checked to ensure that it is within the valid range in debug builds.
The compiler chooses the appropriate operator variant depending on the context of the call.
TInt aIndex |
The index of the element within the array. In a debug build, this value must be greater than or equal to zero and less than the size of the array (i.e. the number of elements as defined by the <TInt S> template parameter), otherwise the function raises a USER 133 panic. In a release build, this value is not checked. |
T& |
A reference to an element of the array. |
const T& |
A reference to a const element of the array; the element cannot be changed through this reference. |
T* Begin();
const T* Begin() const;
Use these functions to return a pointer to the beginning of the array; i.e. the first element of the array.
The compiler chooses the appropriate function variant depending on the context of the call.
T* |
A pointer to the first element of the array. |
const T* |
A pointer to the first element of the array; the element cannot be changed through this pointer. |
T* End();
const T* End() const;
Use these functions to return a pointer to the first byte following the end of the array.
The compiler chooses the appropriate function variant depending on the context of the call.
T* |
A pointer to the first byte following the end of the array. |
const T* |
A pointer to the first byte following the end of the array; the data cannot be changed through this pointer. |
TArray<T> Array() const;
Use this function to construct and return a TArray<T> object. This is a templated class taking the value of the template parameter <class T>.
The subject of generic arrays is discussed in the section on Dynamic Arrays in the EPOC C++ Standard Edition.
TArray<T> |
A TArray<T> generic array for this array. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |