MCatalogsBase Class Reference

class MCatalogsBase

This interface provides functions for querying the interfaces that a class implements. Also, functions for reference counter are provided. The reference counter is used to keep track of the number of users of the implemented class.

Public Member Functions
TInt AddRef()
T *QueryInterfaceL()
const T *QueryInterfaceL()
T *QueryInterfaceLC()
const T *QueryInterfaceLC()
TInt Release()
Protected Member Functions
~MCatalogsBase()
const TAny *QueryInterfaceL(TInt)
Public Member Enumerations
enumanonymous { KInterfaceUid = ECatalogsBaseUid }

Constructor & Destructor Documentation

~MCatalogsBase()

~MCatalogsBase()[protected, inline, virtual]

The destructor of an interface is set virtual to make sure that the destructors of derived classes are called appropriately when the object is destroyed.

Destructors for MCatalogsBase and all derived interfaces are defined as protected to prevent direct use of delete on interface pointers (Release() must be called instead of delete).

Member Functions Documentation

AddRef()

TInt AddRef()const [pure virtual]

Increments the reference counter.

Note:

QueryInterfaceL() already increases the value by one if interface check was successfull. This function may be used if user knows that the interface is used in multiple places and Release() is called accordingly.

QueryInterfaceL()

T *QueryInterfaceL()[inline]

This function is used to test if this object contains an implementation of the interface of the given type.

If the object contains the interface, a pointer to it is returned, and the reference count is increased by one. Otherwise, NULL is returned.

Note:

This interface does not allow the user to delete object directly (destructor is protected). The destruction of this object should be done by calling Release-function.

A template shorthand version is provided here, making the usage easier. An example of using the template method: MWantedInterface* object = someObjectInheritedFromMCatalogBase->QueryInterfaceL< MWantedInterface >();

MCatalogsBase::QueryInterfaceLC

QueryInterfaceL()

const T *QueryInterfaceL()const [inline]

This is const version of QueryInterfaceL.

QueryInterfaceL(TInt)

const TAny *QueryInterfaceL(TIntaInterfaceType)const [protected, pure virtual]

QueryInterfaceL

This function is used to test if this object contains an implementation of the interface of the given type. If the object contains the interface, then the reference count is increased by one.

Parameters

TInt aInterfaceTypeTInt that specifies the interface that this object should implement.

QueryInterfaceLC()

T *QueryInterfaceLC()[inline]

Like QueryInterfaceL, tries to retrieve an interface of specified type from the object. If the interface pointer is returned, it is appended to the cleanup stack, so that a following CleanupStack::PopAndDestroy() will call Release() on the interface pointer appropriately.

MCatalogsBase::QueryInterfaceL

QueryInterfaceLC()

const T *QueryInterfaceLC()const [inline]

This is const version of QueryInterfaceLC.

Release()

TInt Release()const [pure virtual]

Releases a reference. Deletes the object if the reference count reaches 0. Notice that destructor is defined as protected. So, the object of this interface can be deleted using this function and only after reference count is zero.

Member Enumerations Documentation

Enum anonymous

KInterfaceUid defines the identifier for this interface. Child interfaces should define their own unique values for their KInterfaceUid.

Enumerators

KInterfaceUid = ECatalogsBaseUid