MCTTokenObject Class Reference

class MCTTokenObject

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
Public Member Functions
TCTTokenObjectHandle Handle ()
const TDesC & Label ()
IMPORT_C void Release ()
MCTToken & Token ()
TUid Type ()
Protected Member Functions
MCTTokenObject ( MCTToken &)
~MCTTokenObject ()
IMPORT_C void AddTokenRef ()
IMPORT_C void DoRelease ()

Constructor & Destructor Documentation

MCTTokenObject(MCTToken &)

IMPORT_C MCTTokenObject ( MCTToken & aToken ) [protected]

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

Parameters

MCTToken & aToken The 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 Functions Documentation

AddTokenRef()

IMPORT_C void AddTokenRef ( ) [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 void DoRelease ( ) [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.

TCTTokenObjectHandle for more details.

Label()

const TDesC & Label ( ) const [pure virtual]

Gets the object's human-readable label.

Release()

IMPORT_C void Release ( )

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.

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.