CObject Class Reference

class CObject : public CBase

Implements reference counting to track concurrent references to itself.

An object of this type arranges automatic destruction of itself when the final reference is removed.

A reference counting object is any object which has CObject as its base class. Constructing a CObject derived type or calling its Open() member function adds a reference to that object by adding one to the reference count; calling its Close() member function removes a reference by subtracting one from the reference count; when the last user of the object calls Close(), the reference count becomes zero and the object is automatically destroyed.

Inherits from

Constructor & Destructor Documentation

CObject()

IMPORT_CCObject()

~CObject()

IMPORT_C~CObject()

Member Functions Documentation

AccessCount()

TInt AccessCount()const [inline]

Gets the number of open references to this reference counting object.

The number of open references.

Close()

IMPORT_C voidClose()[virtual]

Dec()

voidDec()[protected, inline]

Subtracts one from the reference count.

This function is called by the default implementation of the Close() member function of this class.

CObject::Close

Extension_(TUint, TAny *&, TAny *)

IMPORT_C TIntExtension_(TUintaExtensionId,
TAny *&a0,
TAny *a1
)[protected, virtual]

Parameters

TUint aExtensionId
TAny *& a0
TAny * a1

FullName()

IMPORT_C TFullNameFullName()const [virtual]

Inc()

voidInc()[protected, inline]

Adds one to the reference count.

This function is called by the default implementation of the Open() member function of this class.

CObject::Open

Name()

IMPORT_C TNameName()const [virtual]

Open()

IMPORT_C TIntOpen()[virtual]

Owner()

CObject *Owner()const [inline]

Gets a pointer to the reference counting object which owns this reference counting object.

A pointer to the owning reference counting object. This is NULL, if there is no owner.

SetName(const TDesC *)

IMPORT_C TIntSetName(const TDesC *aName)

Parameters

const TDesC * aName

SetNameL(const TDesC *)

IMPORT_C voidSetNameL(const TDesC *aName)

Parameters

const TDesC * aName

SetOwner(CObject *)

voidSetOwner(CObject *anOwner)[inline]

Sets the owner of this reference counting object.

If this reference counting object already has an owner, then all knowledge of that owner is lost.

Parameters

CObject * anOwnerA pointer to the reference counting object which is to be the new owner of this reference counting object.

UniqueID()

TInt UniqueID()const [protected, inline]

Gets this reference counting object's unique ID.

The unique ID is an integer which is a property of the object container. It forms part of the identity of all reference counting objects and is the same value for all reference counting objects held within the same object container.

This reference counting object's unique ID.

CObjectCon

Member Data Documentation

__DECLARE_TEST

__DECLARE_TEST[private]

TInt iAccessCount

TInt iAccessCount[private]

CObjectCon * iContainer

CObjectCon *iContainer[private]

HBufC * iName

HBufC *iName[private]

CObject * iOwner

CObject *iOwner[private]

TAny * iSpare1

TAny *iSpare1[private]

TAny * iSpare2

TAny *iSpare2[private]