Location:
e32std.h
Link against: euser.lib
RArray<TInt>
Supported from 5.0
A simple and efficient specialized array of signed 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();
Constructs an array object for an array of signed integers with default granularity. The default granularity is 8.
RArray(TInt aGranularity);
Constructs an array object for an array of signed integers with a 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. The function 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 signed 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 signed 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;
Returns the number of signed integers in the array.
|
TInt Insert(TInt anEntry, TInt aPos);
Inserts a signed integer into the array at a specified position.
|
|
TInt InsertInOrder(TInt anEntry);
Inserts a signed integer into the array in signed integer order.
No duplicate entries are permitted.
The function assumes that existing entries within the array are in signed integer order.
|
|
TInt InsertInOrderAllowRepeats(TInt anEntry);
Inserts a signed integer into the array in signed integer order, allowing duplicates.
If anEntry
is a duplicate of an existing entry
in the array, then the new signed integer is inserted after the existing one.
If more than one duplicate entry already exists in the array, then any new
duplicate signed integer is inserted after the last one.
The function assumes that existing entries within the array are in signed integer order.
|
|
TInt Append(TInt anEntry);
Appends a signed integer onto the array.
|
|
void Remove(TInt anIndex);
Removes the signed integer at a specified position from the array.
|
TInt Find(TInt anEntry) const;
Finds the first signed integer in the array which matches a specified signed integer 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;
TInt FindInOrder(TInt anEntry, TInt& anIndex) const;
Use either of these functions to find the signed integer in the array which matches a specified signed integer using a binary search technique.
The functions assume that existing entries within the array are in signed integer order.
|
|
const TInt& operator[](TInt anIndex) const;
TInt& operator[](TInt anIndex);
Returns a reference to the signed integer located at a 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<TInt> Array() const;
Supported from 6.0
Constructs and returns a generic array.
|