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

Generates handle numbers for reference counting objects. More...

#include <e32base.h>

Inheritance diagram for CObjectIx:
CBase

Public Types

enum  { ENoClose =KHandleNoClose , ELocalHandle =KHandleFlagLocal }
 

Public Member Functions

IMPORT_C ~CObjectIx ()
 Destructor.
 
IMPORT_C TInt AddL (CObject *anObj)
 Adds the specified reference counting object into this object index and returns the handle number that represents it.
 
IMPORT_C void Remove (TInt aHandle)
 Removes the reference counting object identified by handle number from this object index and closes it.
 
IMPORT_C CObject * At (TInt aHandle, TInt aUniqueID)
 Gets a pointer to the reference counting object with the specified handle number and matching unique ID.
 
IMPORT_C CObject * At (TInt aHandle)
 Gets a pointer to the reference counting object with the specified handle number.
 
IMPORT_C CObject * AtL (TInt aHandle, TInt aUniqueID)
 Gets a pointer to the reference counting object with the specified handle number and matching unique ID.
 
IMPORT_C CObject * AtL (TInt aHandle)
 Gets a pointer to the reference counting object with the specified handle number.
 
IMPORT_C TInt At (const CObject *anObject) const
 Constructs and returns the handle number representing the specified reference counting object within this object index.
 
IMPORT_C TInt Count (CObject *anObject) const
 Gets the number of occurrences of the specified reference counting object within this object index.
 
IMPORT_C CObject * operator[] (TInt anIndex)
 Gets a pointer to a reference counting object located at the specified offset within the object index.
 
TInt Count () const
 Gets the number greater then the last slot number used to hold valid CObject pointer.
 
TInt ActiveCount () const
 Gets the current number of reference counting objects held by this object index.
 
- Public Member Functions inherited from CBase
 CBase ()
 Default constructor.
 
virtual IMPORT_C ~CBase ()
 Virtual destructor.
 
TAny * operator new (TUint aSize, TAny *aBase) __NO_THROW
 Initialises the object to binary zeroes.
 
TAny * operator new (TUint aSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TUint aExtraSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave, TUint aExtraSize)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 

Static Public Member Functions

static IMPORT_C CObjectIx * NewL ()
 Creates a new object index.
 
- Static Public Member Functions inherited from CBase
static IMPORT_C void Delete (CBase *aPtr)
 Deletes the specified object.
 

Protected Member Functions

IMPORT_C CObjectIx ()
 Default constructor.
 
- Protected Member Functions inherited from CBase
virtual IMPORT_C TInt Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1)
 Extension function.
 

Detailed Description

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
API status
Published to all clients. Released API.

Definition at line 1165 of file e32base.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ENoClose 

When ORd into the handle number, indicates that the reference counting object cannot be closed.

ELocalHandle 

When ORed into the handle number, indicates that the handle is a local handle.

Definition at line 1185 of file e32base.h.

Constructor & Destructor Documentation

◆ ~CObjectIx()

IMPORT_C CObjectIx::~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.

CObject::Close

(generated from Symbian Developer Library)

◆ CObjectIx()

IMPORT_C CObjectIx::CObjectIx ( )
protected

Default constructor.

(generated from Symbian Developer Library)

Member Function Documentation

◆ ActiveCount()

TInt CObjectIx::ActiveCount ( ) const
inline

Gets the current number of reference counting objects held by this object index.

(generated from Symbian Developer Library)

◆ AddL()

IMPORT_C TInt CObjectIx::AddL ( CObject *  anObj)

Adds the specified reference counting object into this object index and returns the handle number that represents it.

Parameters
anObjThe reference counting object to be added to this object index.

(generated from Symbian Developer Library)

◆ At() [1/3]

IMPORT_C TInt CObjectIx::At ( const CObject *  anObject) const

Constructs and returns the handle number representing the specified reference counting object within this object index.

Parameters
anObjectThe reference counting object.

(generated from Symbian Developer Library)

◆ At() [2/3]

IMPORT_C CObject * CObjectIx::At ( TInt  aHandle)

Gets a pointer to the reference counting object with the specified handle number.

Parameters
aHandleThe handle number of the reference counting object.

(generated from Symbian Developer Library)

◆ At() [3/3]

IMPORT_C CObject * CObjectIx::At ( TInt  aHandle,
TInt  aUniqueID 
)

Gets a pointer to the reference counting object with the specified handle number and matching unique ID.

Parameters
aHandleThe handle number of the reference counting object.
aUniqueIDThe unique ID.

(generated from Symbian Developer Library)

◆ AtL() [1/2]

IMPORT_C CObject * CObjectIx::AtL ( TInt  aHandle)

Gets a pointer to the reference counting object with the specified handle number.

Parameters
aHandleThe handle number of the reference counting object.

Leave condition: KErrBadHandle if there is no matching object.

(generated from Symbian Developer Library)

◆ AtL() [2/2]

IMPORT_C CObject * CObjectIx::AtL ( TInt  aHandle,
TInt  aUniqueID 
)

Gets a pointer to the reference counting object with the specified handle number and matching unique ID.

Parameters
aHandleThe handle number of the reference counting object.
aUniqueIDThe unique ID.

Leave condition: KErrBadHandle if there is no matching object.

(generated from Symbian Developer Library)

◆ Count() [1/2]

TInt CObjectIx::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.

CObjectIx::ActiveCount CObjectIx::operator[]

(generated from Symbian Developer Library)

◆ Count() [2/2]

IMPORT_C TInt CObjectIx::Count ( CObject *  anObject) const

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.

Parameters
anObjectThe reference counting object.

(generated from Symbian Developer Library)

◆ NewL()

static IMPORT_C CObjectIx * CObjectIx::NewL ( )
static

Creates a new object index.

(generated from Symbian Developer Library)

◆ operator[]()

IMPORT_C CObject * CObjectIx::operator[] ( TInt  anIndex)

Gets a pointer to a reference counting object located at the specified offset within the object index.

Parameters
anIndexThe offset of the reference counting object within the object index. Offset is relative to zero.

Panic condition: E32USER-CBase 21 if the value of anIndex is negative or is greater than or equal to the total number of objects held by the index.

(generated from Symbian Developer Library)

◆ Remove()

IMPORT_C void CObjectIx::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.

Parameters
aHandleThe handle number of the reference counting object to be removed and closed.

Panic condition: E32USER-CBase 37 if aHandle does not represent an object known to this object index.

(generated from Symbian Developer Library)


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