MCTTokenObject Class Reference

#include <ct/mcttokenobject.h>

Link against: ctframework.lib

class MCTTokenObject
Public Member Functions
pure virtual TCTTokenObjectHandle Handle()
pure virtual const TDesC &Label()
IMPORT_C voidRelease()
pure virtual MCTToken &Token()
pure virtual TUid Type()
Protected Member Functions
MCTTokenObject(MCTToken &)
pure virtual ~MCTTokenObject()
IMPORT_C voidAddTokenRef()
virtual IMPORT_C voidDoRelease()

Detailed Description

The base class for all token objects.

Any object representing something managed via a particular token interface should be derived from this class. It provides certain common attributes that all objects must have (e.g. Label, Type, Token, Handle) and code to interact with the token's reference counting code. Token objects themselves are not reference counted, but the token will not be closed while token objects from it remain in existence. (Token objects can implement their own reference counting framework if required.)

Since
v7.0

Constructor & Destructor Documentation

MCTTokenObject ( MCTToken & )

IMPORT_CMCTTokenObject(MCTToken &aToken)[protected]

Constructor. This needs a token in order to increment the token's reference count.

Parameters
aTokenThe associated token.

~MCTTokenObject ( )

~MCTTokenObject()[protected, inline, pure virtual]

This destructor is protected as clients should use Release() instead.

Destructor.

Frees all resources owned by the object, prior to its destruction.

Member Function Documentation

AddTokenRef ( )

IMPORT_C voidAddTokenRef()[protected]

Increments the token's reference count by one.

This is neccessary to allow derived classes to implement their own reference counting, as Release() automatically call Release() on the token.

DoRelease ( )

IMPORT_C voidDoRelease()[protected, virtual]

Releases the object once the base-class framework work has been done.

The default implementation simply does a 'delete this', but derived classes can substitute their own behaviour; for instance, to implement reference counting of the token objects themselves.

Handle ( )

TCTTokenObjectHandle Handle()const [pure virtual]

Gets a handle for the object.

The primary purpose of the handle is to allow token objects to be 'passed' between processes.

See also: TCTTokenObjectHandle for more details.

Return Value
The handle of the Token Object.

Label ( )

const TDesC &Label()const [pure virtual]

Gets the object's human-readable label.

Return Value
A human-readable label of the object.

Release ( )

IMPORT_C voidRelease()

Releases the MCTTokenObject object.

To be called when you have finished with the object.

Token ( )

MCTToken &Token()const [pure virtual]

Gets a reference to the associated token.

Return Value
The associated token.

Type ( )

TUid Type()const [pure virtual]

Gets the UID representing the type of the token object.

The meanings of possible UIDs should be documented in the documentation for the interface that returns them.

Return Value
The UID representing the type of the token object.