#include <e32base.h>
class CObjectIx : public CBase |
Public Member Enumerations | |
---|---|
enum | anonymous { ENoClose, ELocalHandle } |
Public Member Functions | |
---|---|
~CObjectIx() | |
TInt | ActiveCount() |
IMPORT_C TInt | AddL(CObject *) |
IMPORT_C CObject * | At(TInt, TInt) |
IMPORT_C CObject * | At(TInt) |
IMPORT_C TInt | At(const CObject *) |
IMPORT_C CObject * | AtL(TInt, TInt) |
IMPORT_C CObject * | AtL(TInt) |
IMPORT_C TInt | Count(CObject *) |
TInt | Count() |
IMPORT_C CObjectIx * | NewL() |
IMPORT_C void | Remove(TInt) |
IMPORT_C CObject * | operator[](TInt) |
Protected Member Functions | |
---|---|
CObjectIx() |
Generates handle numbers for reference counting objects.
This is referred to as an object index.
Adding a reference counting object to an object index is the way in which a unique handle number can be generated for that object. A handle number is the way in which an object, which is owned or managed by another thread or process can be identified.
See also: CObject
IMPORT_C | ~CObjectIx | ( | ) |
Destructor.
Frees all resources owned by the object index, prior to its destruction. In particular, it calls Close() on all reference counting objects in the index.
See also: CObject::Close
TInt | ActiveCount | ( | ) | const [inline] |
Gets the current number of reference counting objects held by this object index.
Returns: The current number.
Gets a pointer to the reference counting object with the specified handle number and matching unique ID.
Parameter | Description |
---|---|
aHandle | The handle number of the reference counting object. |
aUniqueID | The unique ID. |
Returns: A pointer to the reference counting object. If there is no matching object, then this is NULL.
Constructs and returns the handle number representing the specified reference counting object within this object index.
Parameter | Description |
---|---|
anObject | The reference counting object. |
Returns: The handle number representing the reference counting object; KErrNotFound, if the reference counting object could not be found within the object index.
Gets a pointer to the reference counting object with the specified handle number and matching unique ID.
Parameter | Description |
---|---|
aHandle | The handle number of the reference counting object. |
aUniqueID | The unique ID. |
Returns: A pointer to the reference counting object.
Gets a pointer to the reference counting object with the specified handle number.
Parameter | Description |
---|---|
aHandle | The handle number of the reference counting object. |
Returns: A pointer to the reference counting object.
Gets the number of occurrences of the specified reference counting object within this object index.
Note that the same reference counting object can be added to an object index more than once.
Parameter | Description |
---|---|
anObject | The reference counting object. |
Returns: The number of occurrences.
TInt | Count | ( | ) | const [inline] |
Gets the number greater then the last slot number used to hold valid CObject pointer. The input argument of CObject* CObjectIx::operator[]() must be less then the number returned by this method.
See also: CObjectIx::ActiveCount CObjectIx::operator[]
Returns: The number greater then the last used slot.
IMPORT_C CObjectIx * | NewL | ( | ) | [static] |
Creates a new object index.
Returns: A pointer to the newly created object index.
IMPORT_C void | Remove | ( | TInt | aHandle | ) |
Removes the reference counting object identified by handle number from this object index and closes it.
If the reference counting object cannot be closed, because CObjectIx::ENoClose is ORed into the handle number, then it is neither removed from the object index nor closed.
Parameter | Description |
---|---|
aHandle | The handle number of the reference counting object to be removed and closed. |
Gets a pointer to a reference counting object located at the specified offset within the object index.
Parameter | Description |
---|---|
anIndex | The offset of the reference counting object within the object index. Offset is relative to zero. |
Returns: A pointer to the reference counting object.