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

A simple and efficient array of pointers to objects. More...

#include <e32cmn.h>

Inheritance diagram for RPointerArray< T >:
RPointerArrayBase

Public Member Functions

 RPointerArray ()
 Default C++ constructor.
 
 RPointerArray (TInt aGranularity)
 C++ constructor with granularity.
 
 RPointerArray (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 it.
 
TInt Count () const
 Gets the number of object pointers in the array.
 
T *const & operator[] (TInt anIndex) const
 Gets a reference to the object pointer located at the specified position within the array.
 
T *& operator[] (TInt anIndex)
 Gets a reference to the object pointer located at the specified position within the array.
 
TInt Append (const T *anEntry)
 Appends an object pointer onto the array.
 
TInt Insert (const T *anEntry, TInt aPos)
 Inserts an object pointer into the array at the specified position.
 
void Remove (TInt anIndex)
 Removes the object pointer at the specified position from the array.
 
void Compress ()
 Compresses the array down to a minimum.
 
void Reset ()
 Empties the array.
 
void ResetAndDestroy ()
 Empties the array and deletes the referenced objects.
 
TInt Find (const T *anEntry) const
 Finds the first object pointer in the array which matches the specified object pointer, using a sequential search.
 
TInt Find (const T *anEntry, TIdentityRelation< T > anIdentity) const
 Finds the first object pointer in the array whose object matches the specified object, using a sequential search and a matching algorithm.
 
template<class K >
TInt Find (const K &aKey, TBool(*apfnCompare)(const K *k, const T &t)) const
 Finds the first object pointer in the array which matches aKey using the comparison algorithm provided by apfnCompare.
 
TInt FindReverse (const T *anEntry) const
 Finds the last object pointer in the array which matches the specified object pointer, using a sequential search.
 
TInt FindReverse (const T *anEntry, TIdentityRelation< T > anIdentity) const
 Finds the last object pointer in the array whose object matches the specified object, using a sequential search and a matching algorithm.
 
template<class K >
TInt FindReverse (const K &aKey, TInt(*apfnMatch)(const K *k, const T &t)) const
 Finds the first object pointer in the array which matches aKey using the comparison algorithm provided by apfnCompare.
 
TInt FindInAddressOrder (const T *anEntry) const
 Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.
 
TInt FindInOrder (const T *anEntry, TLinearOrder< T > anOrder) const
 Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.
 
TInt FindInAddressOrder (const T *anEntry, TInt &anIndex) const
 Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.
 
TInt FindInOrder (const T *anEntry, TInt &anIndex, TLinearOrder< T > anOrder) const
 Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.
 
template<class K >
TInt FindInOrder (const K &aKey, TInt(*apfnCompare)(const K *k, const T &t)) const
 Finds the object pointer in the array whose object matches the specified key, (Using the relationship defined within apfnCompare) using a binary search technique and an ordering algorithm.
 
TInt SpecificFindInAddressOrder (const T *anEntry, TInt aMode) const
 Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.
 
TInt SpecificFindInOrder (const T *anEntry, TLinearOrder< T > anOrder, TInt aMode) const
 Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.
 
TInt SpecificFindInAddressOrder (const T *anEntry, TInt &anIndex, TInt aMode) const
 Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.
 
TInt SpecificFindInOrder (const T *anEntry, TInt &anIndex, TLinearOrder< T > anOrder, TInt aMode) const
 Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.
 
TInt InsertInAddressOrder (const T *anEntry)
 Inserts an object pointer into the array in address order.
 
TInt InsertInOrder (const T *anEntry, TLinearOrder< T > anOrder)
 Inserts an object pointer into the array so that the object itself is in object order.
 
TInt InsertInAddressOrderAllowRepeats (const T *anEntry)
 Inserts an object pointer into the array in address order, allowing duplicates.
 
TInt InsertInOrderAllowRepeats (const T *anEntry, TLinearOrder< T > anOrder)
 Inserts an object pointer into the array so that the object itself is in object order, allowing duplicates.
 
void AppendL (const T *anEntry)
 Appends an object pointer onto the array.
 
void InsertL (const T *anEntry, TInt aPos)
 Inserts an object pointer into the array at the specified position.
 
TInt FindL (const T *anEntry) const
 Finds the first object pointer in the array which matches the specified object pointer, using a sequential search.
 
TInt FindL (const T *anEntry, TIdentityRelation< T > anIdentity) const
 Finds the first object pointer in the array whose object matches the specified object, using a sequential search and a matching algorithm.
 
TInt FindReverseL (const T *anEntry) const
 Finds the last object pointer in the array which matches the specified object pointer, using a sequential search.
 
TInt FindReverseL (const T *anEntry, TIdentityRelation< T > anIdentity) const
 Finds the last object pointer in the array whose object matches the specified object, using a sequential search and a matching algorithm.
 
TInt FindInAddressOrderL (const T *anEntry) const
 Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.
 
TInt FindInOrderL (const T *anEntry, TLinearOrder< T > anOrder) const
 Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.
 
void FindInAddressOrderL (const T *anEntry, TInt &anIndex) const
 Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.
 
void FindInOrderL (const T *anEntry, TInt &anIndex, TLinearOrder< T > anOrder) const
 Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.
 
TInt SpecificFindInAddressOrderL (const T *anEntry, TInt aMode) const
 Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.
 
TInt SpecificFindInOrderL (const T *anEntry, TLinearOrder< T > anOrder, TInt aMode) const
 Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.
 
void SpecificFindInAddressOrderL (const T *anEntry, TInt &anIndex, TInt aMode) const
 Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.
 
void SpecificFindInOrderL (const T *anEntry, TInt &anIndex, TLinearOrder< T > anOrder, TInt aMode) const
 Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.
 
void InsertInAddressOrderL (const T *anEntry)
 Inserts an object pointer into the array in address order.
 
void InsertInOrderL (const T *anEntry, TLinearOrder< T > anOrder)
 Inserts an object pointer into the array so that the object itself is in object order.
 
void InsertInAddressOrderAllowRepeatsL (const T *anEntry)
 Inserts an object pointer into the array in address order, allowing duplicates.
 
void InsertInOrderAllowRepeatsL (const T *anEntry, TLinearOrder< T > anOrder)
 Inserts an object pointer into the array so that the object itself is in object order, allowing duplicates.
 
 RPointerArray (T **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 SortIntoAddressOrder ()
 Sorts the object pointers within the array into address order.
 
void Sort (TLinearOrder< T > anOrder)
 Sorts the object pointers within the array.
 
TArray< T * > Array () const
 Constructs and returns a generic array.
 

Detailed Description

template<class T>
class RPointerArray< T >

A simple and efficient array of pointers to objects.

The elements of the array are pointers to instances of a class; this class is specified as the template parameter T.

The class offers standard array behaviour which includes insertion, appending and sorting of pointers.

Derivation from RPointerArrayBase is private.

API status
Published to all clients. Released API.

Definition at line 5638 of file e32cmn.h.

Constructor & Destructor Documentation

◆ RPointerArray() [1/4]

template<class T >
RPointerArray< T >::RPointerArray ( )
inline

Default C++ constructor.

This constructs an array object for an array of pointers with default granularity, which is 8.

(generated from Symbian Developer Library)

◆ RPointerArray() [2/4]

template<class T >
RPointerArray< T >::RPointerArray ( TInt  aGranularity)
inlineexplicit

C++ constructor with granularity.

This constructs an array object for an array of pointers with the specified granularity.

Parameters
aGranularityThe granularity of the array.

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

(generated from Symbian Developer Library)

◆ RPointerArray() [3/4]

template<class T >
RPointerArray< T >::RPointerArray ( TInt  aMinGrowBy,
TInt  aFactor 
)
inline

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

This constructs an array object for an array of pointers 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)

◆ RPointerArray() [4/4]

template<class T >
RPointerArray< T >::RPointerArray ( T **  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 pointer to class T, which is owned by another RPointerArray object. Ownership of the set of entries still resides with the original RPointerArray object.

Parameters
aEntriesA pointer to the first entry of type pointer to class T in the set of entries belonging to the existing array.
aCountThe number of entries in the existing array. The granularity of this array is set to this value.

Panic condition: USER 156, if aCount is not positive.

(generated from Symbian Developer Library)

Member Function Documentation

◆ Append()

template<class T >
TInt RPointerArray< T >::Append ( const T *  anEntry)
inline

Appends an object pointer onto the array.

Parameters
anEntryThe object pointer to be appended.

(generated from Symbian Developer Library)

◆ AppendL()

template<class T >
void RPointerArray< T >::AppendL ( const T *  anEntry)
inline

Appends an object pointer 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 object pointer to be appended.

(generated from Symbian Developer Library)

◆ Array()

template<class T >
TArray< T * > RPointerArray< T >::Array ( ) const
inline

Constructs and returns a generic array.

TArray

(generated from Symbian Developer Library)

◆ Close()

template<class T >
void RPointerArray< T >::Close ( )
inline

Closes the array and frees all memory allocated to it.

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

Note that the function does not delete the objects whose pointers are contained in the array.

(generated from Symbian Developer Library)

◆ Compress()

template<class T >
void RPointerArray< T >::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 contained object pointers. Subsequently adding a new object pointer to the array always results in a re-allocation of memory.

(generated from Symbian Developer Library)

◆ Count()

template<class T >
TInt RPointerArray< T >::Count ( ) const
inline

Gets the number of object pointers in the array.

(generated from Symbian Developer Library)

◆ Find() [1/3]

template<class T >
template<class K >
TInt RPointerArray< T >::Find ( const K &  aKey,
TBool(*)(const K *k, const T &t)  apfnCompare 
) const
inline

Finds the first object pointer in the array which matches aKey using the comparison algorithm provided by apfnCompare.

The find operation always starts at the low index end of the array. There is no assumption about the order of objects in the array.

Parameters
aKeyThe key of type K to be compared with the elements of the array using apfnCompare.
apfnCompareA function defining the identity relation between the object pointers in the array, and their keys of type K. The function returns true if k and t match based on this relationship.
Returns
The index of the first matching object pointer within the array. KErrNotFound, if no suitable object pointer can be found.

Definition at line 5657 of file e32cmn.h.

◆ Find() [2/3]

template<class T >
TInt RPointerArray< T >::Find ( const T *  anEntry) const
inline

Finds the first object pointer in the array which matches the specified object pointer, using a sequential search.

Matching is based on the comparison of pointers.

The find operation always starts at the low index end of the array. There is no assumption about the order of objects in the array.

Parameters
anEntryThe object pointer to be found.

(generated from Symbian Developer Library)

◆ Find() [3/3]

template<class T >
TInt RPointerArray< T >::Find ( const T *  anEntry,
TIdentityRelation< T >  anIdentity 
) const
inline

Finds the first object pointer in the array whose object matches the specified object, using a sequential search and a matching algorithm.

The algorithm for determining whether two class T objects match is provided by a function supplied by the caller.

The find operation always starts at the low index end of the array. There is no assumption about the order of objects in the array.

Parameters
anEntryThe object pointer to be found.
anIdentityA package encapsulating the function which determines whether two class T objects match.

(generated from Symbian Developer Library)

◆ FindInAddressOrder() [1/2]

template<class T >
TInt RPointerArray< T >::FindInAddressOrder ( const T *  anEntry) const
inline

Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.

The function assumes that object pointers in the array are in address order.

Parameters
anEntryThe object pointer to be found.

(generated from Symbian Developer Library)

◆ FindInAddressOrder() [2/2]

template<class T >
TInt RPointerArray< T >::FindInAddressOrder ( const T *  anEntry,
TInt &  anIndex 
) const
inline

Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.

The function assumes that object pointers in the array are in address order.

Parameters
anEntryThe object pointer to be found.
anIndexA TInt supplied by the caller. On return, contains an index value: If the function returns KErrNone, this is the index of the matching object pointer within the array. If the function returns KErrNotFound, this is the index of the first object pointer within the array which logically follows after anEntry.

(generated from Symbian Developer Library)

◆ FindInAddressOrderL() [1/2]

template<class T >
TInt RPointerArray< T >::FindInAddressOrderL ( const T *  anEntry) const
inline

Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.

The function assumes that object pointers in the array are in address order.

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

Parameters
anEntryThe object pointer to be found.

Leave condition: KErrNotFound, if no suitable object pointer can be found.

(generated from Symbian Developer Library)

◆ FindInAddressOrderL() [2/2]

template<class T >
void RPointerArray< T >::FindInAddressOrderL ( const T *  anEntry,
TInt &  anIndex 
) const
inline

Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.

The function assumes that object pointers in the array are in address order.

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

Parameters
anEntryThe object pointer to be found.
anIndexA reference to a TInt into which the function puts an index value: If the function does not leave, this is the index of the matching object pointer within the array. If the function leaves with KErrNotFound, this is the index of the first object pointer within the array which logically follows after anEntry.

Leave condition: KErrNotFound, if no suitable object pointer can be found.

(generated from Symbian Developer Library)

◆ FindInOrder() [1/3]

template<class T >
template<class K >
TInt RPointerArray< T >::FindInOrder ( const K &  aKey,
TInt(*)(const K *k, const T &t)  apfnCompare 
) const
inline

Finds the object pointer in the array whose object matches the specified key, (Using the relationship defined within apfnCompare) using a binary search technique and an ordering algorithm.

The function assumes that existing object pointers in the array are ordered so that the objects themselves are in object order as determined by an algorithm supplied by the caller and packaged as a TLinearOrder<T>.

Parameters
aKeyThe key of type K to be compared with the elements of the array using apfnCompare.
apfnCompareA function which defines the order that the array was sorted, where in it aKey (via the defined relationship) should fit, and if the key is present.
Returns
The index of the matching object pointer within the array. KErrNotFound, if no suitable object pointer can be found.

Definition at line 5700 of file e32cmn.h.

◆ FindInOrder() [2/3]

template<class T >
TInt RPointerArray< T >::FindInOrder ( const T *  anEntry,
TInt &  anIndex,
TLinearOrder< T >  anOrder 
) const
inline

Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.

The function assumes that existing object pointers in the array are ordered so that the objects themselves are in object order as determined by an algorithm supplied by the caller and packaged as a TLinearOrder<T>.

Parameters
anEntryThe object pointer to be found.
anIndexA TInt supplied by the caller. On return, contains an index value: If the function returns KErrNone, this is the index of the matching object pointer within the array. If the function returns KErrNotFound, this is the index of the first object pointer in the array whose object is larger than the entry being searched for - if no objects pointed to in the array are larger, then the index value is the same as the total number of object pointers in the array.
anOrderA package encapsulating the function which determines the order of two class T objects.

(generated from Symbian Developer Library)

◆ FindInOrder() [3/3]

template<class T >
TInt RPointerArray< T >::FindInOrder ( const T *  anEntry,
TLinearOrder< T >  anOrder 
) const
inline

Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.

The function assumes that existing object pointers in the array are ordered so that the objects themselves are in object order as determined by an algorithm supplied by the caller and packaged as a TLinearOrder<T>.

Parameters
anEntryThe object pointer to be found.
anOrderA package encapsulating the function which determines the order of two class T objects.

(generated from Symbian Developer Library)

◆ FindInOrderL() [1/2]

template<class T >
void RPointerArray< T >::FindInOrderL ( const T *  anEntry,
TInt &  anIndex,
TLinearOrder< T >  anOrder 
) const
inline

Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.

The function assumes that existing object pointers in the array are ordered so that the objects themselves are in object order as determined by an algorithm supplied by the caller and packaged as a TLinearOrder<T>.

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

Parameters
anEntryThe object pointer to be found.
anIndexA TInt supplied by the caller. On return, contains an index value: If the function does not leave, this is the index of the matching object pointer within the array. If the function leaves with KErrNotFound, this is the index of the first object pointer in the array whose object is bigger than the entry being searched for - if no objects pointed to in the array are bigger, then the index value is the same as the total number of object pointers in the array.
anOrderA package encapsulating the function which determines the order of two class T objects.

Leave condition: KErrNotFound, if no suitable object pointer can be found.

(generated from Symbian Developer Library)

◆ FindInOrderL() [2/2]

template<class T >
TInt RPointerArray< T >::FindInOrderL ( const T *  anEntry,
TLinearOrder< T >  anOrder 
) const
inline

Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.

The function assumes that existing object pointers in the array are ordered so that the objects themselves are in object order as determined by an algorithm supplied by the caller and packaged as a TLinearOrder<T>.

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

Parameters
anEntryThe object pointer to be found.
anOrderA package encapsulating the function which determines the order of two class T objects.

Leave condition: KErrNotFound, if no suitable object pointer can be found.

(generated from Symbian Developer Library)

◆ FindL() [1/2]

template<class T >
TInt RPointerArray< T >::FindL ( const T *  anEntry) const
inline

Finds the first object pointer in the array which matches the specified object pointer, using a sequential search.

Matching is based on the comparison of pointers.

The find operation always starts at the low index end of the array. There is no assumption about the order of objects in the array.

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

Parameters
anEntryThe object pointer to be found.

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

(generated from Symbian Developer Library)

◆ FindL() [2/2]

template<class T >
TInt RPointerArray< T >::FindL ( const T *  anEntry,
TIdentityRelation< T >  anIdentity 
) const
inline

Finds the first object pointer in the array whose object matches the specified object, using a sequential search and a matching algorithm.

The algorithm for determining whether two class T objects match is provided by a function supplied by the caller.

The find operation always starts at the low index end of the array. There is no assumption about the order of objects in the array.

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

Parameters
anEntryThe object pointer to be found.
anIdentityA package encapsulating the function which determines whether two class T objects match.

Leave condition: KErrNotFound, if no suitable object pointer can be found.

(generated from Symbian Developer Library)

◆ FindReverse() [1/3]

template<class T >
template<class K >
TInt RPointerArray< T >::FindReverse ( const K &  aKey,
TInt(*)(const K *k, const T &t)  apfnMatch 
) const
inline

Finds the first object pointer in the array which matches aKey using the comparison algorithm provided by apfnCompare.

The find operation always starts at the high index end of the array. There is no assumption about the order of objects in the array.

Parameters
aKeyThe key of type K to be compared with the elements of the array using apfnMatch.
apfnMatchA function defining the identity relation between the object pointers in the array, and their keys of type K. The function returns true if k and t match based on this relationship.
Returns
The index of the first matching object pointer within the array. KErrNotFound, if no suitable object pointer can be found.

Definition at line 5677 of file e32cmn.h.

◆ FindReverse() [2/3]

template<class T >
TInt RPointerArray< T >::FindReverse ( const T *  anEntry) const
inline

Finds the last object pointer in the array which matches the specified object pointer, using a sequential search.

Matching is based on the comparison of pointers.

The find operation always starts at the high index end of the array. There is no assumption about the order of objects in the array.

Parameters
anEntryThe object pointer to be found.

(generated from Symbian Developer Library)

◆ FindReverse() [3/3]

template<class T >
TInt RPointerArray< T >::FindReverse ( const T *  anEntry,
TIdentityRelation< T >  anIdentity 
) const
inline

Finds the last object pointer in the array whose object matches the specified object, using a sequential search and a matching algorithm.

The algorithm for determining whether two class T objects match is provided by a function supplied by the caller.

The find operation always starts at the high index end of the array. There is no assumption about the order of objects in the array.

Parameters
anEntryThe object pointer to be found.
anIdentityA package encapsulating the function which determines whether two class T objects match.

(generated from Symbian Developer Library)

◆ FindReverseL() [1/2]

template<class T >
TInt RPointerArray< T >::FindReverseL ( const T *  anEntry) const
inline

Finds the last object pointer in the array which matches the specified object pointer, using a sequential search.

Matching is based on the comparison of pointers.

The find operation always starts at the high index end of the array. There is no assumption about the order of objects in the array.

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

Parameters
anEntryThe object pointer to be found.

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

(generated from Symbian Developer Library)

◆ FindReverseL() [2/2]

template<class T >
TInt RPointerArray< T >::FindReverseL ( const T *  anEntry,
TIdentityRelation< T >  anIdentity 
) const
inline

Finds the last object pointer in the array whose object matches the specified object, using a sequential search and a matching algorithm.

The algorithm for determining whether two class T objects match is provided by a function supplied by the caller.

The find operation always starts at the high index end of the array. There is no assumption about the order of objects in the array.

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

Parameters
anEntryThe object pointer to be found.
anIdentityA package encapsulating the function which determines whether two class T objects match.

Leave condition: KErrNotFound, if no suitable object pointer can be found.

(generated from Symbian Developer Library)

◆ GranularCompress()

template<class T >
void RPointerArray< T >::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 object pointers. Adding new object pointers to the array does not result in a re-allocation of memory until the the total number of pointers reaches a multiple of the granularity.

(generated from Symbian Developer Library)

◆ Insert()

template<class T >
TInt RPointerArray< T >::Insert ( const T *  anEntry,
TInt  aPos 
)
inline

Inserts an object pointer into the array at the specified position.

Parameters
anEntryThe object pointer to be inserted.
aPosThe position within the array where the object pointer is to be inserted. The position is relative to zero, i.e. zero implies that a pointer is inserted at the beginning of the array.

Panic condition: USER 131, if aPos is negative, or is greater than the number of object pointers currently in the array.

(generated from Symbian Developer Library)

◆ InsertInAddressOrder()

template<class T >
TInt RPointerArray< T >::InsertInAddressOrder ( const T *  anEntry)
inline

Inserts an object pointer into the array in address order.

No duplicate entries are permitted. The array remains unchanged following an attempt to insert a duplicate entry.

The function assumes that existing object pointers within the array are in address order.

Parameters
anEntryThe object pointer to be inserted.

(generated from Symbian Developer Library)

◆ InsertInAddressOrderAllowRepeats()

template<class T >
TInt RPointerArray< T >::InsertInAddressOrderAllowRepeats ( const T *  anEntry)
inline

Inserts an object pointer into the array in address order, allowing duplicates.

If the new object pointer is a duplicate of an existing object pointer in the array, then the new pointer is inserted after the existing one. If more than one duplicate object pointer already exists in the array, then any new duplicate pointer is inserted after the last one.

The function assumes that existing object pointers within the array are in address order.

Parameters
anEntryThe object pointer to be inserted.

(generated from Symbian Developer Library)

◆ InsertInAddressOrderAllowRepeatsL()

template<class T >
void RPointerArray< T >::InsertInAddressOrderAllowRepeatsL ( const T *  anEntry)
inline

Inserts an object pointer into the array in address order, allowing duplicates.

If the new object pointer is a duplicate of an existing object pointer in the array, then the new pointer is inserted after the existing one. If more than one duplicate object pointer already exists in the array, then any new duplicate pointer is inserted after the last one.

The function assumes that existing object pointers within the array are in address 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 object pointer to be inserted.

(generated from Symbian Developer Library)

◆ InsertInAddressOrderL()

template<class T >
void RPointerArray< T >::InsertInAddressOrderL ( const T *  anEntry)
inline

Inserts an object pointer into the array in address order.

No duplicate entries are permitted. The function assumes that existing object pointers within the array are in address 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 object pointer to be inserted.

(generated from Symbian Developer Library)

◆ InsertInOrder()

template<class T >
TInt RPointerArray< T >::InsertInOrder ( const T *  anEntry,
TLinearOrder< T >  anOrder 
)
inline

Inserts an object pointer into the array so that the object itself is in object order.

The algorithm for determining the order of two class T objects is provided by a function supplied by the caller.

No duplicate entries are permitted. The array remains unchanged following an attempt to insert a duplicate entry.

The function assumes that the array is ordered so that the referenced objects are in object order.

Parameters
anEntryThe object pointer to be inserted.
anOrderA package encapsulating the function which determines the order of two class T objects.

(generated from Symbian Developer Library)

◆ InsertInOrderAllowRepeats()

template<class T >
TInt RPointerArray< T >::InsertInOrderAllowRepeats ( const T *  anEntry,
TLinearOrder< T >  anOrder 
)
inline

Inserts an object pointer into the array so that the object itself is in object order, allowing duplicates.

The algorithm for determining the order of two class T objects is provided by a function supplied by the caller.

If the specified object is a duplicate of an existing object, then the new pointer is inserted after the pointer to the existing object. If more than one duplicate object already exists, then the new pointer is inserted after the pointer to the last one.

Parameters
anEntryThe object pointer to be inserted.
anOrderA package encapsulating the function which determines the order of two class T objects.

(generated from Symbian Developer Library)

◆ InsertInOrderAllowRepeatsL()

template<class T >
void RPointerArray< T >::InsertInOrderAllowRepeatsL ( const T *  anEntry,
TLinearOrder< T >  anOrder 
)
inline

Inserts an object pointer into the array so that the object itself is in object order, allowing duplicates.

The algorithm for determining the order of two class T objects is provided by a function supplied by the caller.

If the specified object is a duplicate of an existing object, then the new pointer is inserted after the pointer to the existing object. If more than one duplicate object already exists, then the new pointer is inserted after the pointer to the last one.

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 object pointer to be inserted.
anOrderA package encapsulating the function which determines the order of two class T objects.

(generated from Symbian Developer Library)

◆ InsertInOrderL()

template<class T >
void RPointerArray< T >::InsertInOrderL ( const T *  anEntry,
TLinearOrder< T >  anOrder 
)
inline

Inserts an object pointer into the array so that the object itself is in object order.

The algorithm for determining the order of two class T objects is provided by a function supplied by the caller.

No duplicate entries are permitted.

The function assumes that the array is ordered so that the referenced objects are in object 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 object pointer to be inserted.
anOrderA package encapsulating the function which determines the order of two class T objects.

(generated from Symbian Developer Library)

◆ InsertL()

template<class T >
void RPointerArray< T >::InsertL ( const T *  anEntry,
TInt  aPos 
)
inline

Inserts an object pointer 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 object pointer to be inserted.
aPosThe position within the array where the object pointer is to be inserted. The position is relative to zero, i.e. zero implies that a pointer is inserted at the beginning of the array.

Panic condition: USER 131, if aPos is negative, or is greater than the number of object pointers currently in the array.

(generated from Symbian Developer Library)

◆ operator[]() [1/2]

template<class T >
T *& RPointerArray< T >::operator[] ( TInt  anIndex)
inline

Gets a reference to the object pointer located at the specified position within the array.

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

Parameters
anIndexThe position of the object pointer within the array. The position is relative to zero, i.e. zero implies the object pointer at the beginning of the array.

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

(generated from Symbian Developer Library)

◆ operator[]() [2/2]

template<class T >
T *const & RPointerArray< T >::operator[] ( TInt  anIndex) const
inline

Gets a reference to the object pointer located at the specified position within the array.

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

Parameters
anIndexThe position of the object pointer within the array. The position is relative to zero, i.e. zero implies the object pointer at the beginning of the array.

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

(generated from Symbian Developer Library)

◆ Remove()

template<class T >
void RPointerArray< T >::Remove ( TInt  anIndex)
inline

Removes the object pointer at the specified position from the array.

Note that the function does not delete the object whose pointer is removed.

Parameters
anIndexThe position within the array from where the object pointer is to be removed. The position is relative to zero, i.e. zero implies that a pointer 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 objects currently in the array.

(generated from Symbian Developer Library)

◆ Reserve()

template<class T >
TInt RPointerArray< T >::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 object pointers specified. Adding new object pointers to the array does not result in a re-allocation of memory until the the total number of pointers exceeds the specified count.

Parameters
aCountThe number of object pointers for which space should be reserved

(generated from Symbian Developer Library)

◆ ReserveL()

template<class T >
void RPointerArray< T >::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 object pointers specified. Adding new object pointers to the array does not result in a re-allocation of memory until the the total number of pointers exceeds the specified count.

Parameters
aCountThe number of object pointers 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()

template<class T >
void RPointerArray< T >::Reset ( )
inline

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.

Note that the function does not delete the objects whose pointers are contained in the array.

(generated from Symbian Developer Library)

◆ ResetAndDestroy()

template<class T >
void RPointerArray< T >::ResetAndDestroy ( )

Empties the array and deletes the referenced objects.

It frees all memory allocated to the array and resets the internal state so that it is ready to be reused. The function also deletes all of the objects whose pointers are contained by the array.

This array object can be allowed to go out of scope after a call to this function.

(generated from Symbian Developer Library)

◆ Sort()

template<class T >
void RPointerArray< T >::Sort ( TLinearOrder< T >  anOrder)
inline

Sorts the object pointers within the array.

The sort order of the pointers is based on the order of the referenced objects. The referenced object order is determined by an algorithm supplied by the caller and packaged as a TLinerOrder<T>.

Parameters
anOrderA package encapsulating the function which determines the order of two class T objects.

(generated from Symbian Developer Library)

◆ SortIntoAddressOrder()

template<class T >
void RPointerArray< T >::SortIntoAddressOrder ( )
inline

Sorts the object pointers within the array into address order.

(generated from Symbian Developer Library)

◆ SpecificFindInAddressOrder() [1/2]

template<class T >
TInt RPointerArray< T >::SpecificFindInAddressOrder ( const T *  anEntry,
TInt &  anIndex,
TInt  aMode 
) const
inline

Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.

Where there is more than one matching element, it finds the first, the last or any matching element as specified by the value of aMode.

The function assumes that object pointers in the array are in address order.

TArrayFindMode

Parameters
anEntryThe object pointer 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)

◆ SpecificFindInAddressOrder() [2/2]

template<class T >
TInt RPointerArray< T >::SpecificFindInAddressOrder ( const T *  anEntry,
TInt  aMode 
) const
inline

Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.

Where there is more than one matching element, it finds the first, the last or any matching element as specified by the value of aMode.

The function assumes that object pointers in the array are in address order.

TArrayFindMode

Parameters
anEntryThe object pointer 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)

◆ SpecificFindInAddressOrderL() [1/2]

template<class T >
void RPointerArray< T >::SpecificFindInAddressOrderL ( const T *  anEntry,
TInt &  anIndex,
TInt  aMode 
) const
inline

Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.

Where there is more than one matching element, it finds the first, the last or any matching element as specified by the value of aMode.

The function assumes that object pointers in the array are in address order.

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

Parameters
anEntryThe object pointer 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 suitable object pointer can be found.

(generated from Symbian Developer Library)

◆ SpecificFindInAddressOrderL() [2/2]

template<class T >
TInt RPointerArray< T >::SpecificFindInAddressOrderL ( const T *  anEntry,
TInt  aMode 
) const
inline

Finds the object pointer in the array that matches the specified object pointer, using a binary search technique.

Where there is more than one matching element, it finds the first, the last or any matching element as specified by the value of aMode.

The function assumes that object pointers in the array are in address order.

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

Parameters
anEntryThe object pointer 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)

◆ SpecificFindInOrder() [1/2]

template<class T >
TInt RPointerArray< T >::SpecificFindInOrder ( const T *  anEntry,
TInt &  anIndex,
TLinearOrder< T >  anOrder,
TInt  aMode 
) const
inline

Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.

Where there is more than one matching element, it finds the first, the last or any matching element as specified by the value of aMode.

The function assumes that existing object pointers in the array are ordered so that the objects themselves are in object order as determined by an algorithm supplied by the caller and packaged as a TLinearOrder<T> type.

TArrayFindMode

Parameters
anEntryThe object pointer 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.
anOrderA package encapsulating the function which determines the order of two class T objects.
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]

template<class T >
TInt RPointerArray< T >::SpecificFindInOrder ( const T *  anEntry,
TLinearOrder< T >  anOrder,
TInt  aMode 
) const
inline

Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.

Where there is more than one matching element, it finds the first, the last or any matching element as specified by the value of aMode.

The function assumes that existing object pointers in the array are ordered so that the objects themselves are in object order as determined by an algorithm supplied by the caller and packaged as a TLinearOrder<T> type.

TArrayFindMode

Parameters
anEntryThe object pointer to be found.
anOrderA package encapsulating the function which determines the order of two class T objects.
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]

template<class T >
void RPointerArray< T >::SpecificFindInOrderL ( const T *  anEntry,
TInt &  anIndex,
TLinearOrder< T >  anOrder,
TInt  aMode 
) const
inline

Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.

Where there is more than one matching element, it finds the first, the last or any matching element as specified by the value of aMode.

The function assumes that existing object pointers in the array are ordered so that the objects themselves are in object order as determined by an algorithm supplied by the caller and packaged as a TLinearOrder<T>.

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

Parameters
anEntryThe object pointer 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.
anOrderA package encapsulating the function which determines the order of two class T objects.
aModeSpecifies whether to find the first match, the last match or any match, as defined by one of the TArrayFindModeenum values.

Leave condition: KErrNotFound, if no suitable object pointer can be found.

(generated from Symbian Developer Library)

◆ SpecificFindInOrderL() [2/2]

template<class T >
TInt RPointerArray< T >::SpecificFindInOrderL ( const T *  anEntry,
TLinearOrder< T >  anOrder,
TInt  aMode 
) const
inline

Finds the object pointer in the array whose object matches the specified object, using a binary search technique and an ordering algorithm.

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 existing object pointers in the array are ordered so that the objects themselves are in object order as determined by an algorithm supplied by the caller and packaged as a TLinearOrder<T> type.

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

Parameters
anEntryThe object pointer to be found.
anOrderA package encapsulating the function which determines the order of two class T objects.
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: