Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: e32base.h
Link against: euser.lib

Class CSharableSession

CSharableSession

Support

Supported from 6.0

Description

Sharable session abstract base class.

The class is the base class for all sessions and also provides the support needed for a session to be sharable by all threads within a single process.

The class is a base class for the CSession class.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CSharableSessionSharable session abstract base class

Defined in CSharableSession:
CountResources(), CreateL(), Message(), ResourceCountMarkEnd(), ResourceCountMarkStart(), Server(), ServiceL(), ~CSharableSession()

Inherited from CBase:
operator new()

See also:


Construction and destruction


CreateL()

virtual void CreateL(const CServer& aServer);

Description

Completes construction of this server-side client session object.

The default implementation stores a pointer to the server active object that provides message handling for this session, i.e. the server active object that created this session object.

This function is called by the server active object when a client makes a connect request.

Parameters

const CServer& aServer

The server active object which is responsible for this session.


~CSharableSession()

~CSharableSession();

Description

Frees resources prior to destruction. Specifically, it removes this session object from the server active object’s list of sessions.

[Top]


Accessors


Server()

const CServer* Server() const;

Description

Returns the server active object which provides message handling for this session, i.e. the server active object which created this session object.

Return value

CServer*

The server active object.


Message()

const RMessage& Message() const;

Description

Returns the current message.

Return value

RMessage&

The current message.

[Top]


Request handling


ServiceL()

virtual void ServiceL(const RMessage& aMessage) = 0;

Description

Handles the servicing of client requests passed to the server.

This function must be implemented in a derived class. The details of the request are contained within the message.

Parameters

const RMessage& aMessage

The message containing the client request

[Top]


Resource checking


ResourceCountMarkStart()

void ResourceCountMarkStart();

Description

Initialises resource counting.

If resource counting has not been implemented in a derived class, the function panics the client thread associated with the most recent message, specifying the category name CSession and panic number 1.

See also:


ResourceCountMarkEnd()

void ResourceCountMarkEnd();

Description

Ends resource counting.

The function checks that the current number of resources in use is the same as that when resource counting started. If these values are not equal, the function panics the client thread associated with the most recent message, specifying the category name CSession and panic number 2.

See also:


CountResources()

virtual TInt CountResources();

Description

Returns the number of resources currently in use.

The default implementation returns KErrGeneral.

Derived classes which support resource counting must provide a suitable implementation.

Return value

TInt

The current number of resources in use