Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
RArray< TInt > Class Reference

A simple and efficient specialized array of signed integers offering standard array behaviour. More...

#include <e32cmn.h>

Inheritance diagram for RArray< TInt >:
RPointerArrayBase

Public Member Functions

 RArray ()
 Constructs an array object for an array of signed integers with default granularity.
 
 RArray (TInt aGranularity)
 Constructs an array object for an array of signed integers with the specified granularity.
 
 RArray (TInt aMinGrowBy, TInt aFactor)
 C++ constructor with minimum growth step and exponential growth factor.
 
void Close ()
 Closes the array and frees all memory allocated to the array.
 
TInt Count () const
 Gets the number of signed integers in the array.
 
const TInt & operator[] (TInt anIndex) const
 Gets a reference to the signed integer located at a specified position within the array.
 
TInt & operator[] (TInt anIndex)
 Gets a reference to the signed integer located at a specified position within the array.
 
TInt Append (TInt anEntry)
 Appends a signed integer onto the array.
 
TInt Insert (TInt anEntry, TInt aPos)
 Inserts a signed integer into the array at the specified position.
 
void Remove (TInt anIndex)
 Removes the signed integer at the specified position from the array.
 
void Compress ()
 Compresses the array down to a minimum.
 
void Reset ()
 Empties the array.
 
TInt Find (TInt anEntry) const
 Finds the first signed integer in the array which matches the specified signed integer using a sequential search.
 
TInt FindReverse (TInt anEntry) const
 Finds the last signed integer in the array which matches the specified signed integer using a sequential search.
 
TInt FindInOrder (TInt anEntry) const
 Finds the signed integer in the array that matches the specified signed integer using a binary search technique.
 
TInt FindInOrder (TInt anEntry, TInt &anIndex) const
 Finds the signed integer in the array that matches the specified signed integer using a binary search technique.
 
TInt SpecificFindInOrder (TInt anEntry, TInt aMode) const
 Finds the signed integer in the array that matches the specified signed integer using a binary search technique.
 
TInt SpecificFindInOrder (TInt anEntry, TInt &anIndex, TInt aMode) const
 Finds the signed integer in the array that matches the specified signed integer using a binary search technique.
 
TInt InsertInOrder (TInt anEntry)
 Inserts a signed integer into the array in signed integer order.
 
TInt InsertInOrderAllowRepeats (TInt anEntry)
 Inserts a signed integer into the array in signed integer order, allowing duplicates.
 
void AppendL (TInt anEntry)
 Appends a signed integer onto the array.
 
void InsertL (TInt anEntry, TInt aPos)
 Inserts a signed integer into the array at the specified position.
 
TInt FindL (TInt anEntry) const
 Finds the first signed integer in the array which matches the specified signed integer using a sequential search.
 
TInt FindReverseL (TInt anEntry) const
 Finds the last signed integer in the array which matches the specified signed integer using a sequential search.
 
TInt FindInOrderL (TInt anEntry) const
 Finds the signed integer in the array that matches the specified signed integer using a binary search technique.
 
void FindInOrderL (TInt anEntry, TInt &anIndex) const
 Finds the signed integer in the array that matches the specified signed integer using a binary search technique.
 
TInt SpecificFindInOrderL (TInt anEntry, TInt aMode) const
 Finds the signed integer in the array that matches the specified signed integer using a binary search technique.
 
void SpecificFindInOrderL (TInt anEntry, TInt &anIndex, TInt aMode) const
 Finds the signed integer in the array that matches the specified signed integer using a binary search technique.
 
void InsertInOrderL (TInt anEntry)
 Inserts a signed integer into the array in signed integer order.
 
void InsertInOrderAllowRepeatsL (TInt anEntry)
 Inserts a signed integer into the array in signed integer order, allowing duplicates.
 
 RArray (TInt *aEntries, TInt aCount)
 C++ constructor with a pointer to the first array entry in a pre-existing array, and the number of entries in that array.
 
void GranularCompress ()
 Compresses the array down to a granular boundary.
 
TInt Reserve (TInt aCount)
 Reserves space for the specified number of elements.
 
void ReserveL (TInt aCount)
 Reserves space for the specified number of elements.
 
void Sort ()
 Sorts the array entries into signed integer order.
 
TArray< TInt > Array () const
 Constructs and returns a generic array.
 

Detailed Description

A simple and efficient specialized array of signed integers offering standard array behaviour.

Note that derivation from RPointerArrayBase is private.

API status
Published to all clients. Released API.

Definition at line 6073 of file e32cmn.h.

Constructor & Destructor Documentation

◆ RArray() [1/4]

RArray< TInt >::RArray ( )
inline

Constructs an array object for an array of signed integers with default granularity.

The default granularity is 8.

(generated from Symbian Developer Library)

◆ RArray() [2/4]

RArray< TInt >::RArray ( TInt  aGranularity)
inlineexplicit

Constructs an array object for an array of signed integers with the specified granularity.

Parameters
aGranularityThe granularity of the array.

Panic condition: USER 127, if aGranularity is not positive or is greater than or equal to 0x10000000.

(generated from Symbian Developer Library)

◆ RArray() [3/4]

RArray< TInt >::RArray ( TInt  aMinGrowBy,
TInt  aFactor 
)
inline

C++ constructor with minimum growth step and exponential growth factor.

This constructs an array object for an array of signed integers with the specified minimum growth step and exponential growth factor.

Parameters
aMinGrowByThe minimum growth step of the array. Must be between 1 and 65535 inclusive.
aFactorThe factor by which the array grows, multiplied by 256. For example 512 specifies a factor of 2. Must be between 257 and 32767 inclusive.

Panic condition: USER 192, if aMinGrowBy<=0 or aMinGrowBy>65535.

Panic condition: USER 193, if aFactor<=257 or aFactor>32767.

(generated from Symbian Developer Library)

◆ RArray() [4/4]

RArray< TInt >::RArray ( TInt *  aEntries,
TInt  aCount 
)
inline

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 TInt 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
aEntriesA pointer to the first entry of type class TInt in the set of entries belonging to the existing array.
aCountThe number of entries in the existing array.

(generated from Symbian Developer Library)

Member Function Documentation

◆ Append()

TInt RArray< TInt >::Append ( TInt  anEntry)
inline

Appends a signed integer onto the array.

Parameters
anEntryThe signed integer to be appended.

(generated from Symbian Developer Library)

◆ AppendL()

void RArray< TInt >::AppendL ( TInt  anEntry)
inline

Appends a signed 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
anEntryThe signed integer to be appended.

(generated from Symbian Developer Library)

◆ Array()

TArray< TInt > RArray< TInt >::Array ( ) const
inline

Constructs and returns a generic array.

TArray

(generated from Symbian Developer Library)

◆ Close()

void RArray< TInt >::Close ( )
inline

Closes the array and frees all memory allocated to the array.

The function must be called before this array object goes out of scope.

(generated from Symbian Developer Library)

◆ Compress()

void RArray< TInt >::Compress ( )
inline

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 signed integer to the array always results in a re-allocation of memory.

(generated from Symbian Developer Library)

◆ Count()

TInt RArray< TInt >::Count ( ) const
inline

Gets the number of signed integers in the array.

(generated from Symbian Developer Library)

◆ Find()

TInt RArray< TInt >::Find ( TInt  anEntry) const
inline

Finds the first signed integer in the array which matches the 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.

Parameters
anEntryThe signed integer to be found.

(generated from Symbian Developer Library)

◆ FindInOrder() [1/2]

TInt RArray< TInt >::FindInOrder ( TInt  anEntry) const
inline

Finds the signed integer in the array that matches the specified signed integer using a binary search technique.

The function assumes that the array is in signed integer order.

Parameters
anEntryThe signed integer to find.

(generated from Symbian Developer Library)

◆ FindInOrder() [2/2]

TInt RArray< TInt >::FindInOrder ( TInt  anEntry,
TInt &  anIndex 
) const
inline

Finds the signed integer in the array that matches the specified signed integer using a binary search technique.

The function assumes that the array is in signed integer order.

Parameters
anEntryThe signed integer to find.
anIndexA TInt suplied by the caller. On return contains an index value. If the function returns KErrNone, this is the index of the matching signed integer within the array. If the function returns KErrNotFound, this is the index of the first signed integer within the array that is bigger than the signed integer being searched for - if no signed integers within the array are bigger, then the index value is the same as the total number of signed integers within the array.

(generated from Symbian Developer Library)

◆ FindInOrderL() [1/2]

TInt RArray< TInt >::FindInOrderL ( TInt  anEntry) const
inline

Finds the signed integer in the array that matches the specified signed integer using a binary search technique.

The function assumes that the array is in signed integer order.

NOTE: This function is NOT AVAILABLE to code running on the kernel side.

Parameters
anEntryThe signed integer to be found.

Leave condition: KErrNotFound, if no match can be found.

(generated from Symbian Developer Library)

◆ FindInOrderL() [2/2]

void RArray< TInt >::FindInOrderL ( TInt  anEntry,
TInt &  anIndex 
) const
inline

Finds the signed integer in the array that matches the specified signed integer using a binary search technique.

The function assumes that the array is in signed integer order.

NOTE: This function is NOT AVAILABLE to code running on the kernel side.

Parameters
anEntryThe signed integer to be found.
anIndexA reference to a signed integer into which the function puts an index value: If the function returns , this is the index of the matching signed integer within the array. If the function leaves with KErrNotFound, this is the index of the first signed integer within the array that is bigger than the signed integer being searched for - if no signed integers within the array are bigger, then the index value is the same as the total number of signed integers within the array.

Leave condition: KErrNotFound if no match can be found.

(generated from Symbian Developer Library)

◆ FindL()

TInt RArray< TInt >::FindL ( TInt  anEntry) const
inline

Finds the first signed integer in the array which matches the 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.

NOTE: This function is NOT AVAILABLE to code running on the kernel side.

Parameters
anEntryThe signed integer to be found.

Leave condition: KErrNotFound, if no matching entry can be found.

(generated from Symbian Developer Library)

◆ FindReverse()

TInt RArray< TInt >::FindReverse ( TInt  anEntry) const
inline

Finds the last signed integer in the array which matches the specified signed integer 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
anEntryThe signed integer to be found.

(generated from Symbian Developer Library)

◆ FindReverseL()

TInt RArray< TInt >::FindReverseL ( TInt  anEntry) const
inline

Finds the last signed integer in the array which matches the specified signed integer 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
anEntryThe signed integer to be found.

Leave condition: KErrNotFound, if no matching entry can be found.

(generated from Symbian Developer Library)

◆ GranularCompress()

void RArray< TInt >::GranularCompress ( )
inline

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.

(generated from Symbian Developer Library)

◆ Insert()

TInt RArray< TInt >::Insert ( TInt  anEntry,
TInt  aPos 
)
inline

Inserts a signed integer into the array at the specified position.

Parameters
anEntryThe signed integer to be inserted.
aPosThe position within the array where the signed 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 condition: USER 131, if aPos is negative, or is greater than the number of entries currently in the array.

(generated from Symbian Developer Library)

◆ InsertInOrder()

TInt RArray< TInt >::InsertInOrder ( TInt  anEntry)
inline

Inserts a signed integer into the array in signed 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 signed integer order.

Parameters
anEntryThe signed integer to be inserted

(generated from Symbian Developer Library)

◆ InsertInOrderAllowRepeats()

TInt RArray< TInt >::InsertInOrderAllowRepeats ( TInt  anEntry)
inline

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.

Parameters
anEntryThe signed integer to be inserted.

(generated from Symbian Developer Library)

◆ InsertInOrderAllowRepeatsL()

void RArray< TInt >::InsertInOrderAllowRepeatsL ( TInt  anEntry)
inline

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.

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
anEntryThe signed integer to be inserted.

(generated from Symbian Developer Library)

◆ InsertInOrderL()

void RArray< TInt >::InsertInOrderL ( TInt  anEntry)
inline

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.

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
anEntryThe signed integer to be inserted.

(generated from Symbian Developer Library)

◆ InsertL()

void RArray< TInt >::InsertL ( TInt  anEntry,
TInt  aPos 
)
inline

Inserts a signed 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
anEntryThe signed integer to be inserted.
aPosThe position within the array where the signed 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 condition: USER 131, if aPos is negative, or is greater than the number of entries currently in the array.

(generated from Symbian Developer Library)

◆ operator[]() [1/2]

TInt & RArray< TInt >::operator[] ( TInt  anIndex)
inline

Gets a reference to the signed integer located at a specified position within the array.

The compiler chooses this function if the returned reference is used in an expression where the reference can be modified.

Parameters
anIndexThe position of the signed integer within the array. The position is relative to zero, i.e. zero implies the entry at the beginning of the array.

Panic condition: USER 130, if anIndex is negative, or is greater than the number of entries currently in the array.

(generated from Symbian Developer Library)

◆ operator[]() [2/2]

const TInt & RArray< TInt >::operator[] ( TInt  anIndex) const
inline

Gets a reference to the signed integer located at a specified position within the array.

The compiler chooses this function if the returned reference is used in an expression where the reference cannot be modified.

Parameters
anIndexThe position of the signed integer within the array. The position is relative to zero, i.e. zero implies the entry at the beginning of the array.

Panic condition: USER 130, if anIndex is negative, or is greater than the number of entries currently in the array.

(generated from Symbian Developer Library)

◆ Remove()

void RArray< TInt >::Remove ( TInt  anIndex)
inline

Removes the signed integer at the specified position from the array.

Parameters
anIndexThe position within the array from where the signed 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 condition: USER 130, if anIndex is negative or is greater than the number of entries currently in the array.

(generated from Symbian Developer Library)

◆ Reserve()

TInt RArray< TInt >::Reserve ( TInt  aCount)
inline

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
aCountThe number of integers for which space should be reserved

(generated from Symbian Developer Library)

◆ ReserveL()

void RArray< TInt >::ReserveL ( TInt  aCount)
inline

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
aCountThe number of integers for which space should be reserved

Leave condition: KErrNoMemory If the requested amount of memory could not be allocated

(generated from Symbian Developer Library)

◆ Reset()

void RArray< TInt >::Reset ( )
inline

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.

(generated from Symbian Developer Library)

◆ Sort()

void RArray< TInt >::Sort ( )
inline

Sorts the array entries into signed integer order.

(generated from Symbian Developer Library)

◆ SpecificFindInOrder() [1/2]

TInt RArray< TInt >::SpecificFindInOrder ( TInt  anEntry,
TInt &  anIndex,
TInt  aMode 
) const
inline

Finds the signed integer in the array that matches the specified signed 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 signed integer order.

TArrayFindMode

Parameters
anEntryThe signed integer to be found.
anIndexA 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.
aModeSpecifies whether to find the first match, the last match or any match, as defined by one of the TArrayFindMode enum values.

(generated from Symbian Developer Library)

◆ SpecificFindInOrder() [2/2]

TInt RArray< TInt >::SpecificFindInOrder ( TInt  anEntry,
TInt  aMode 
) const
inline

Finds the signed integer in the array that matches the specified signed 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 signed integer order.

TArrayFindMode

Parameters
anEntryThe signed integer to be found.
aModeSpecifies whether to find the first match, the last match or any match, as defined by one of the TArrayFindMode enum values.

(generated from Symbian Developer Library)

◆ SpecificFindInOrderL() [1/2]

void RArray< TInt >::SpecificFindInOrderL ( TInt  anEntry,
TInt &  anIndex,
TInt  aMode 
) const
inline

Finds the signed integer in the array that matches the specified signed 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 signed integer order.

NOTE: This function is NOT AVAILABLE to code running on the kernel side.

Parameters
anEntryThe signed integer to be found.
anIndexA 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.
aModeSpecifies whether to find the first match, the last match or any match, as defined by one of the TArrayFindMode enum values.

Leave condition: KErrNotFound if no matching entry exists.

(generated from Symbian Developer Library)

◆ SpecificFindInOrderL() [2/2]

TInt RArray< TInt >::SpecificFindInOrderL ( TInt  anEntry,
TInt  aMode 
) const
inline

Finds the signed integer in the array that matches the specified signed 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 signed integer order.

NOTE: This function is NOT AVAILABLE to code running on the kernel side.

Parameters
anEntryThe signed integer to be found.
aModeSpecifies whether to find the first match, the last match or any match, as defined by one of the TArrayFindMode enum values.

Leave condition: KErrNotFound if no matching entry exists.

(generated from Symbian Developer Library)


The documentation for this class was generated from the following files: