class RArray< TUint > : private RPointerArrayBase;
Description
Array of unsigned integers.
The array is a simple and efficient specialized array of unsigned integers offering standard array behaviour.
The derivation from RPointerArrayBase
is private.
Derivation
RPointerArrayBase
- No description.
RArray< TUint >
-
Array of unsigned integers.
Members
Defined in RArray< TUint >
:
Append(TUint)
Appends an unsigned integer onto the array.
AppendL(TUint)
Appends an unsigned integer onto the array.
Array()const
Constructs and returns a generic array.
Close()
Closes the array and frees all memory allocated to the array.
Compress()
Compresses the array down to a minimum.
Count()const
Gets the number of unsigned integers in the array.
Find(TUint)const
Finds the first unsigned integer in the array which matches the specified value,...
FindInOrder(TUint)const
Finds the unsigned integer in the array which matches the specified value, using...
FindInOrder(TUint,TInt &)const
Finds the unsigned integer in the array which matches the specified value, using...
FindInOrderL(TUint)const
Finds the unsigned integer in the array which matches the specified value, using...
FindInOrderL(TUint,TInt &)const
Finds the unsigned integer in the array which matches the specified value, using...
FindL(TUint)const
Finds the first unsigned integer in the array which matches the specified value,...
FindReverse(TUint)const
Finds the last unsigned integer in the array which matches the specified value, ...
FindReverseL(TUint)const
Finds the last unsigned integer in the array which matches the specified value, ...
GranularCompress()
Compresses the array down to a granular boundary.
Insert(TUint,TInt)
Inserts an unsigned integer into the array at the specified position.
InsertInOrder(TUint)
Inserts an unsigned integer into the array in unsigned integer order.
InsertInOrderAllowRepeats(TUint)
Inserts an unsigned integer into the array in unsigned integer order, allowing d...
InsertInOrderAllowRepeatsL(TUint)
Inserts an unsigned integer into the array in unsigned integer order, allowing d...
InsertInOrderL(TUint)
Inserts an unsigned integer into the array in unsigned integer order.
InsertL(TUint,TInt)
Inserts an unsigned integer into the array at the specified position.
RArray()
Default C++ constructor.
RArray(TInt)
Constructs an array object for an array of unsigned integers with the specified ...
RArray(TInt,TInt)
C++ constructor with minimum growth step and exponential growth factor.
RArray(TUint *,TInt)
C++ constructor with a pointer to the first array entry in a pre-existing array,...
Remove(TInt)
Removes the unsigned integer at the specified position from the array.
Reserve(TInt)
Reserves space for the specified number of elements.
ReserveL(TInt)
Reserves space for the specified number of elements.
Reset()
Empties the array.
Sort()
Sorts the array entries into unsigned integer order.
SpecificFindInOrder(TUint,TInt &,TInt)const
Finds the unsigned integer in the array that matches the specified unsigned inte...
SpecificFindInOrder(TUint,TInt)const
Finds the unsigned integer in the array that matches the specified unsigned inte...
SpecificFindInOrderL(TUint,TInt &,TInt)const
Finds the unsigned integer in the array that matches the specified unsigned inte...
SpecificFindInOrderL(TUint,TInt)const
Finds the unsigned integer in the array that matches the specified unsigned inte...
operator[](TInt)
Gets a reference to the unsigned integer located at the specified position withi...
operator[](TInt)const
Gets a reference to the unsigned integer located at the specified position withi...
Member functions
inline RArray();
Description
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.
Return value
inline RArray(TInt aGranularity);
Description
Constructs an array object for an array of unsigned integers with the specified granularity.
Parameters
TInt aGranularity |
The granularity of the array.
|
|
Return value
Panic codes
USER |
127, if aGranularity is not positive or is greater than or equal to 0x10000000.
|
|
inline RArray(TInt aMinGrowBy, TInt aFactor);
Description
C++ constructor with minimum growth step and exponential growth factor.
This constructs an array object for an array of unsigned integers with the specified minimum growth step and exponential growth
factor.
Parameters
TInt aMinGrowBy |
The minimum growth step of the array. Must be between 1 and 65535 inclusive.
|
TInt aFactor |
The factor by which the array grows, multiplied by 256. For example 512 specifies a factor of 2. Must be between 257 and 32767
inclusive.
|
|
Return value
Panic codes
USER |
192, if aMinGrowBy<=0 or aMinGrowBy>65535.
|
USER |
193, if aFactor<=257 or aFactor>32767.
|
|
inline void Close();
Description
Closes the array and frees all memory allocated to the array.
The function must be called before this array object goes out of scope.
inline TInt Count() const;
Description
Gets the number of unsigned integers in the array.
Return value
TInt
|
The number of unsigned integers in the array.
|
|
inline const TUint& operator[](TInt anIndex) const;
Description
Gets a reference to the unsigned integer located at the specified position within the array.
The compiler uses this variant if the returned reference is used in an expression where the reference cannot be modified.
Parameters
TInt anIndex |
The position of the unsigned integer within the array, relative to zero, i.e. zero implies the entry at the beginning of the
array.
|
|
Return value
const TUint & |
A reference to the const unsigned integer at position anIndex within the array.
|
|
Panic codes
USER |
130, if anIndex is negative, or is greater than the number of entries currently in the array.
|
|
inline TUint& operator[](TInt anIndex);
Description
Gets a reference to the unsigned integer located at the specified position within the array.
The compiler uses this variant if the returned reference is used in an expression where the reference can be modified.
Parameters
TInt anIndex |
The position of the unsigned integer within the array, relative to zero, i.e. zero implies the entry at the beginning of the
array.
|
|
Return value
TUint & |
A reference to the non-const unsigned integer at position anIndex within the array.
|
|
Panic codes
USER |
130, if anIndex is negative, or is greater than the number of entries currently in the array.
|
|
inline TInt Append(TUint anEntry);
Description
Appends an unsigned integer onto the array.
Parameters
TUint anEntry |
The unsigned integer to be appended.
|
|
Return value
TInt
|
KErrNone, if the insertion is successful, otherwise one of the system wide error codes.
|
|
inline TInt Insert(TUint anEntry, TInt aPos);
Description
Inserts an unsigned integer into the array at the specified position.
Parameters
TUint anEntry |
The unsigned integer to be inserted.
|
TInt aPos |
The position within the array where the unsigned integer is to be inserted. The position is relative to zero, i.e. zero implies
that an entry is inserted at the beginning of the array.
|
|
Return value
TInt
|
KErrNone, if the insertion is successful, otherwise one of the system wide error codes.
|
|
Panic codes
USER |
131, if aPos is negative, or is greater than the number of entries currently in the array.
|
|
inline void Remove(TInt anIndex);
Description
Removes the unsigned integer at the specified position from the array.
Parameters
TInt anIndex |
The position within the array from where the unsigned integer is to be removed. The position is relative to zero, i.e. zero
implies that an entry at the beginning of the array is to be removed.
|
|
Panic codes
USER |
130, if anIndex is negative, or is greater than the number of entries currently in the array.
|
|
inline void Compress();
Description
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. Subsequently adding a
new unsigned integer to the array always results in a re-allocation of memory.
inline void Reset();
Description
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.
inline TInt Find(TUint anEntry) const;
Description
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.
Parameters
TUint anEntry |
The unsigned integer to be found.
|
|
Return value
TInt
|
The index of the first matching unsigned integer within the array. KErrNotFound, if no matching entry can be found.
|
|
inline TInt FindReverse(TUint anEntry) const;
Description
Finds the last unsigned integer in the array which matches the specified value, using a sequential search.
The find operation always starts at the high index end of the array. There is no assumption about the order of entries in
the array.
Parameters
TUint anEntry |
The unsigned integer to be found.
|
|
Return value
TInt
|
The index of the last matching unsigned integer within the array. KErrNotFound, if no matching entry can be found.
|
|
inline TInt FindInOrder(TUint anEntry) const;
Description
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.
Parameters
TUint anEntry |
The unsigned integer to be found.
|
|
Return value
TInt
|
This is either: the index of the matching unsigned integer within the array; KErrNotFound, if no suitable entry can be found.
|
|
FindInOrder(TUint,TInt &)const
inline TInt FindInOrder(TUint anEntry, TInt &anIndex) const;
Description
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.
Parameters
TUint anEntry |
The unsigned integer to be found.
|
TInt &anIndex |
A TInt supplied by the caller. On return, contains an index value. If the function returns KErrNone, this is the index of
the matching unsigned integer within the array. If the function returns KErrNotFound, this is the index of the first unsigned
integer within the array that is bigger than the unsigned integer being searched for - if no unsigned integers within the
array are bigger, then the index value is the same as the total number of unsigned integers within the array.
|
|
Return value
TInt
|
KErrNone, if a matching unsigned integer is found. KErrNotFound, if no suitable entry can be found.
|
|
SpecificFindInOrder(TUint,TInt)const
inline TInt SpecificFindInOrder(TUint anEntry, TInt aMode) const;
Description
Finds the unsigned integer in the array that matches the specified unsigned integer using a binary search technique.
In the case that there is more than one matching element, finds the first, last or any match as specified by the value of
aMode.
The function assumes that the array is in unsigned integer order.
Parameters
TUint anEntry |
The unsigned integer to be found..
|
TInt aMode |
Specifies whether to find the first match, the last match or any match, as defined by one of the TArrayFindMode enum values.
|
|
Return value
TInt
|
KErrNotFound, if there is no matching element, otherwise the array index of a matching element - what the index refers to
depends on the value of aMode: if this is EArrayFindMode_First, then the index refers to the first matching element; if this
is EArrayFindMode_Any, then the index can refer to any of the matching elements; if this is EArrayFindMode_Last, then the
index refers to first element that follows the last matching element - if the last matching element is also the last element
of the array, then the index value is the same as the total number of elements in the array.
|
|
SpecificFindInOrder(TUint,TInt &,TInt)const
inline TInt SpecificFindInOrder(TUint anEntry, TInt &anIndex, TInt aMode) const;
Description
Finds the unsigned integer in the array that matches the specified unsigned integer using a binary search technique.
In the case that there is more than one matching element, finds the first, last or any match as specified.
The function assumes that the array is in unsigned integer order.
Parameters
TUint anEntry |
The unsigned integer to be found.
|
TInt &anIndex |
A TInt type supplied by the caller. On return, it contains an index value depending on whether a match is found and on the
value of aMode. If there is no matching element in the array, then this is the index of the first element in the array that
is bigger than the element being searched for - if no elements in the array are bigger, then the index value is the same as
the total number of elements in the array. If there is a matching element, then what the index refers to depends on the value
of aMode: if this is EArrayFindMode_First, then the index refers to the first matching element; if this is EArrayFindMode_Any,
then the index can refer to any of the matching elements; if this is EArrayFindMode_Last, then the index refers to first element
that follows the last matching element - if the last matching element is also the last element of the array, then the index
value is the same as the total number of elements in the array.
|
TInt aMode |
Specifies whether to find the first match, the last match or any match, as defined by one of the TArrayFindMode enum values.
|
|
Return value
TInt
|
KErrNone, if a matching entry is found; KErrNotFound, if no matching entry exists.
|
|
inline TInt InsertInOrder(TUint anEntry);
Description
Inserts an unsigned integer into the array in unsigned integer order.
No duplicate entries are permitted. The array remains unchanged following an attempt to insert a duplicate entry.
The function assumes that existing entries within the array are in unsigned integer order.
Parameters
TUint anEntry |
The unsigned integer to be inserted.
|
|
Return value
TInt
|
KErrNone, if the insertion is successful; KErrAlreadyExists, if an attempt is being made to insert a duplicate entry; otherwise
one of the other system wide error codes.
|
|
InsertInOrderAllowRepeats(TUint)
inline TInt InsertInOrderAllowRepeats(TUint anEntry);
Description
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.
The function assumes that existing entries within the array are in unsigned integer order.
Parameters
TUint anEntry |
The unsigned integer to be inserted.
|
|
Return value
TInt
|
KErrNone, if the insertion is successful, otherwise one of the system wide error codes.
|
|
inline void AppendL(TUint anEntry);
Description
Appends an unsigned integer onto the array.
The function leaves with one of the system wide error codes, if the operation fails.
NOTE: This function is NOT AVAILABLE to code running on the kernel side.
Parameters
TUint anEntry |
The unsigned integer to be appended.
|
|
inline void InsertL(TUint anEntry, TInt aPos);
Description
Inserts an unsigned integer into the array at the specified position.
The function leaves with one of the system wide error codes, if the operation fails.
NOTE: This function is NOT AVAILABLE to code running on the kernel side.
Parameters
TUint anEntry |
The unsigned integer to be inserted.
|
TInt aPos |
The position within the array where the unsigned integer is to be inserted. The position is relative to zero, i.e. zero implies
that an entry is inserted at the beginning of the array.
|
|
Panic codes
USER |
131, if aPos is negative, or is greater than the number of entries currently in the array.
|
|
inline TInt FindL(TUint anEntry) const;
Description
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.
NOTE: This function is NOT AVAILABLE to code running on the kernel side.
Parameters
TUint anEntry |
The unsigned integer to be found.
|
|
Return value
TInt
|
The index of the first matching unsigned integer within the array.
|
|
Leave codes
KErrNotFound, |
if no matching entry can be found.
|
|
inline TInt FindReverseL(TUint anEntry) const;
Description
Finds the last unsigned integer in the array which matches the specified value, using a sequential search.
The find operation always starts at the high index end of the array. There is no assumption about the order of entries in
the array.
NOTE: This function is NOT AVAILABLE to code running on the kernel side.
Parameters
TUint anEntry |
The unsigned integer to be found.
|
|
Return value
TInt
|
The index of the last matching unsigned integer within the array.
|
|
Leave codes
KErrNotFound, |
if no matching entry can be found.
|
|
inline TInt FindInOrderL(TUint anEntry) const;
Description
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.
NOTE: This function is NOT AVAILABLE to code running on the kernel side.
Parameters
TUint anEntry |
The unsigned integer to be found.
|
|
Return value
TInt
|
The index of the matching unsigned integer within the array;
|
|
Leave codes
KErrNotFound, |
if no matching entry can be found.
|
|
FindInOrderL(TUint,TInt &)const
inline void FindInOrderL(TUint anEntry, TInt &anIndex) const;
Description
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.
NOTE: This function is NOT AVAILABLE to code running on the kernel side.
Parameters
TUint anEntry |
The unsigned integer to be found.
|
TInt &anIndex |
A TInt supplied by the caller. On return, contains an index value of the matching unsigned integer within the array. If the
function leaves with KErrNotFound, this is the index of the first unsigned integer within the array that is bigger than the
unsigned integer being searched for - if no unsigned integers within the array are bigger, then the index value is the same
as the total number of unsigned integers within the array.
|
|
Leave codes
KErrNotFound, |
if no matching entry can be found.
|
|
SpecificFindInOrderL(TUint,TInt)const
inline TInt SpecificFindInOrderL(TUint anEntry, TInt aMode) const;
Description
Finds the unsigned integer in the array that matches the specified unsigned integer using a binary search technique.
In the case that there is more than one matching element, finds the first, last or any match as specified.
The function assumes that the array is in unsigned integer order.
NOTE: This function is NOT AVAILABLE to code running on the kernel side.
Parameters
TUint anEntry |
The unsigned integer to be found.
|
TInt aMode |
Specifies whether to find the first match, the last match or any match, as defined by one of the TArrayFindMode enum values.
|
|
Return value
TInt
|
The array index of a matching element - what the index refers to depends on the value of aMode: if this is EArrayFindMode_First,
then the index refers to the first matching element; if this is EArrayFindMode_Any, then the index can refer to any of the
matching elements; if this is EArrayFindMode_Last, then the index refers to first element that follows the last matching element
- if the last matching element is also the last element of the array, then the index value is the same as the total number
of elements in the array.
|
|
Leave codes
KErrNotFound |
if no matching entry exists.
|
|
SpecificFindInOrderL(TUint,TInt &,TInt)const
inline void SpecificFindInOrderL(TUint anEntry, TInt &anIndex, TInt aMode) const;
Description
Finds the unsigned integer in the array that matches the specified unsigned integer using a binary search technique.
Where there is more than one matching element, it finds the first, last or any matching element as specified by the value
of aMode.
The function assumes that the array is in unsigned integer order.
NOTE: This function is NOT AVAILABLE to code running on the kernel side.
Parameters
TUint anEntry |
The unsigned integer to be found.
|
TInt &anIndex |
A TInt type supplied by the caller. On return, it contains an index value depending on whether a match is found and on the
value of aMode. If there is no matching element in the array, then this is the index of the first element in the array that
is bigger than the element being searched for - if no elements in the array are bigger, then the index value is the same as
the total number of elements in the array. If there is a matching element, then what the index refers to depends on the value
of aMode: if this is EArrayFindMode_First, then the index refers to the first matching element; if this is EArrayFindMode_Any,
then the index can refer to any of the matching elements; if this is EArrayFindMode_Last, then the index refers to first element
that follows the last matching element - if the last matching element is also the last element of the array, then the index
value is the same as the total number of elements in the array.
|
TInt aMode |
Specifies whether to find the first match, the last match or any match, as defined by one of the TArrayFindMode enum values.
|
|
Leave codes
KErrNotFound |
if no matching entry exists.
|
|
inline void InsertInOrderL(TUint anEntry);
Description
Inserts an unsigned integer into the array in unsigned integer order.
No duplicate entries are permitted.
The function assumes that existing entries within the array are in unsigned integer order.
The function leaves with one of the system wide error codes, if the operation fails.
Note that the array remains unchanged following an attempt to insert a duplicate entry.
NOTE: This function is NOT AVAILABLE to code running on the kernel side.
Parameters
TUint anEntry |
The unsigned integer to be inserted.
|
|
InsertInOrderAllowRepeatsL(TUint)
inline void InsertInOrderAllowRepeatsL(TUint anEntry);
Description
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.
The function assumes that existing entries within the array are in unsigned integer order.
The function leaves with one of the system wide error codes, if the operation fails.
NOTE: This function is NOT AVAILABLE to code running on the kernel side.
Parameters
TUint anEntry |
The unsigned integer to be inserted.
|
|
inline RArray(TUint *aEntries, TInt aCount);
Description
C++ constructor with a pointer to the first array entry in a pre-existing array, and the number of entries in that array.
This constructor takes a pointer to a pre-existing set of entries of type TUint objects. Ownership of the set of entries does
not transfer to this RArray
object.
The purpose of constructing an array in this way is to allow sorting and finding operations to be done without further allocation
of memory.
Parameters
TUint *aEntries |
A pointer to the first entry of type class TUint in the set of entries belonging to the existing array.
|
TInt aCount |
The number of entries in the existing array.
|
|
Return value
inline void GranularCompress();
Description
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.
inline TInt Reserve(TInt aCount);
Description
Reserves space for the specified number of elements.
After a call to this function, the memory allocated to the array is sufficient to hold the number of integers specified. Adding
new integers to the array does not result in a re-allocation of memory until the the total number of integers exceeds the
specified count.
Parameters
TInt aCount |
The number of integers for which space should be reserved
|
|
Return value
TInt
|
KErrNone If the operation completed successfully KErrNoMemory If the requested amount of memory could not be allocated
|
|
inline void ReserveL(TInt aCount);
Description
Reserves space for the specified number of elements.
After a call to this function, the memory allocated to the array is sufficient to hold the number of integers specified. Adding
new integers to the array does not result in a re-allocation of memory until the the total number of integers exceeds the
specified count.
Parameters
TInt aCount |
The number of integers for which space should be reserved
|
|
Leave codes
KErrNoMemory |
If the requested amount of memory could not be allocated
|
|
inline void Sort();
Description
Sorts the array entries into unsigned integer order.
inline TArray< TUint > Array() const;
Description
Constructs and returns a generic array.
Return value
TArray < TUint > |
A generic array representing this array.
|
|