Location:
e32std.h
Link against: euser.lib
RArray<TUint>
Supported from 5.0
Array of unsigned integers.
The array is a simple and efficient specialized array of unsigned integers offering standard array behaviour.
Note that derivation from
RPointerArrayBase
is
private.
|
Defined in RArray
:
Append()
, Array()
, Close()
, Compress()
, Count()
, Find()
, FindInOrder()
, GranularCompress()
, Insert()
, InsertInOrder()
, InsertInOrderAllowRepeats()
, RArray()
, Remove()
, Reset()
, Sort()
, operator[]()
RArray();
Default C++ constructor. This constructs an array object for an array of unsigned integers with default granularity.
The default granularity of the array is 8.
RArray(TInt aGranularity);
C++ constructor with granularity.
This constructs an array object for an array of unsigned integers with the specified granularity.
|
void Close();
Closes the array and frees all memory allocated to the array.
The function must be called before this array object goes out of scope.
void Reset();
Empties the array. It frees all memory allocated to the array and resets the internal state so that it is ready to be reused.
This array object can be allowed to go out of scope after a call to this function.
void Compress();
Compresses the array down to a minimum.
After a call to this function, the memory allocated to the array is just sufficient for its entries. Adding a new unsigned integer to the array always results in a re-allocation of memory.
void GranularCompress();
Compresses the array down to a granular boundary.
After a call to this function, the memory allocated to the array is sufficient for its contained entries. Adding new unsigned integers to the array does not result in a re-allocation of memory until the total number of entries reaches a multiple of the granularity.
TInt Count() const;
Gets the number of unsigned integers in the array.
|
TInt Insert(TInt anEntry, TInt aPos);
Inserts an unsigned integer into the array at the specified position.
|
|
TInt InsertInOrder(TInt anEntry);
Inserts an unsigned integer into the array in unsigned integer order.
No duplicate entries are permitted.
Note:
The function assumes that existing entries within the array are in unsigned integer order.
|
|
TInt InsertInOrderAllowRepeats(TInt anEntry);
Inserts an unsigned integer into the array in unsigned integer order, allowing duplicates.
If the new integer is a duplicate of an existing entry in the array, then the new unsigned integer is inserted after the existing one. If more than one duplicate entry already exists in the array, then any new duplicate unsigned integer is inserted after the last one.
Note:
The function assumes that existing entries within the array are in unsigned integer order.
|
|
TInt Append(TInt anEntry);
Appends an unsigned integer onto the array.
|
|
void Remove(TInt anIndex);
Removes the unsigned integer at the specified position from the array.
|
TInt Find(TInt anEntry) const;
Finds the first unsigned integer in the array which matches the specified value, using a sequential search.
The find operation always starts at the low index end of the array. There is no assumption about the order of entries in the array.
|
|
TInt FindInOrder(TInt anEntry) const;
Finds the unsigned integer in the array which matches the specified value, using a binary search technique.
The functions assume that existing entries within the array are in unsigned integer order.
|
|
TInt FindInOrder(TInt anEntry, TInt& anIndex) const;
Finds the unsigned integer in the array which matches the
specified value, using a binary search technique. If the index cannot be found,
the function returns the index of the last unsigned integer within the array
which logically precedes anEntry
.
The functions assume that existing entries within the array are in unsigned integer order.
|
|
const TInt& operator[](TInt anIndex) const;
TInt& operator[](TInt anIndex);
Gets a reference to the unsigned integer located at the specified position within the array.
Two versions of the operator are supplied. The compiler chooses the appropriate version based on the use made of the returned reference. If the returned reference is used in an expression where the reference can be modified, then the non-const version is chosen.
|
|
TArray<TUint> Array() const;
Supported from 6.0
Constructs and returns a generic array.
|