Den::CCommonPlayer Class Reference

class Den::CCommonPlayer : public CBase

class CCommonPlayer The main responsibility is adding/removing sub-sessions from the provider container in the related session object as well as keeping a list of all sub-sessions handled by the Player instance (iSubSessions).

Inherits from

Public Member Functions
~CCommonPlayer()
TBool CanUnbindFromWorker(CommsFW::TWorkerId)
IMPORT_C voidCleanupDeadWorker(CommsFW::TWorkerId)
IMPORT_C CCommonSessionProxy *CurrentSessionProxyL()
voidDoProcessMessageL(const RSafeMessage &, CWorkerSubSession *)
IMPORT_C voidDontCompleteCurrentRequest()
CCommonSessionProxy *FindOrCreateSessionProxyL(CWorkerSession *)
CCommonSessionProxy *FindSessionProxy(CWorkerSession *)
TBool IsPlayerShutdownComplete()
IMPORT_C voidMaybeSetPlayerShutdownComplete(TBool)
CCommonWorkerThread *OwnerThread()
voidPanicClient(CWorkerSubSession &, TInt)
voidPanicClient(CWorkerSubSession &, const TDesC &, TInt)
IMPORT_C voidPanicClient(TInt)
IMPORT_C voidPanicClient(const TDesC &, TInt)
CCommonPitBoss &PitBoss()
TPlayerRole PlayerRole()
TInt PostMortemCleanup()
IMPORT_C voidProcessMessageL(const RSafeMessage &, CWorkerSubSession *)
voidProcessShutdownRequest(CommsFW::TCFShutdownType)
const RSafeMessage &SafeMessage()
CWorkerSession *Session()
voidSetPlayerRole(const TPlayerRole &)
IMPORT_C voidSetReturn(TInt)
voidSetSession(CWorkerSession *)
IMPORT_C TBoolShouldCompleteCurrentRequest()
IMPORT_C CWorkerSubSession *SubSession(const TSubSessionUniqueId &)
TSubSessionContainer &SubSessions()
CommsFW::CCommsTransport &Transport()
CommsFW::TWorkerId WorkerId()
CCommonWorkerThread &WorkerThread()
Protected Member Functions
CCommonPlayer(CCommonWorkerThread *, TPlayerRole)
CCommonSessionProxy *DoCreateSessionProxyL(CWorkerSession *)
voidReset()
TInt Return()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Type Definitions
typedef RPointerArray< CWorkerSubSession > TSubSessionContainer
Protected Attributes
TBool iComplete
TInt iReturn
Private Attributes
const RSafeMessage *iCurrentMessage
CCommonSessionProxy *iCurrentSessionProxy
CCommonWorkerThread *iOwnerThread
TPlayerRole iPlayerRole
CWorkerSession *iSession
TDblQue< CCommonSessionProxy >iSessionProxies
TSubSessionContainer iSubSessions

Constructor & Destructor Documentation

CCommonPlayer(CCommonWorkerThread *, TPlayerRole)

IMPORT_CCCommonPlayer(CCommonWorkerThread *aOwnerThread,
TPlayerRoleaPlayerRole
)[protected]

Parameters

CCommonWorkerThread * aOwnerThread
TPlayerRole aPlayerRole

~CCommonPlayer()

IMPORT_C~CCommonPlayer()

The Player destructor doesn't have much to do as a lot of the cleanup is done during the normal shutdown routines. Here the Player merely deletes all sub-sessions it owns.

Member Functions Documentation

CanUnbindFromWorker(CommsFW::TWorkerId)

TBool CanUnbindFromWorker(CommsFW::TWorkerIdaWorker)

Parameters

CommsFW::TWorkerId aWorker

CleanupDeadWorker(CommsFW::TWorkerId)

IMPORT_C voidCleanupDeadWorker(CommsFW::TWorkerIdaPeerId)

Parameters

CommsFW::TWorkerId aPeerId

CurrentSessionProxyL()

IMPORT_C CCommonSessionProxy *CurrentSessionProxyL()

MultiTool function to return the current session proxy for a session, but also to create it if it doesn't exist. This avoids having the same pattern in multiple places where we first check to see if it exists then creates it if not.

DoCreateSessionProxyL(CWorkerSession *)

CCommonSessionProxy *DoCreateSessionProxyL(CWorkerSession *aSession)[protected, pure virtual]

Parameters

CWorkerSession * aSession

DoProcessMessageL(const RSafeMessage &, CWorkerSubSession *)

voidDoProcessMessageL(const RSafeMessage &aMsg,
CWorkerSubSession *aSubSession
)[pure virtual]

Parameters

const RSafeMessage & aMsg
CWorkerSubSession * aSubSession

DontCompleteCurrentRequest()

IMPORT_C voidDontCompleteCurrentRequest()

FindOrCreateSessionProxyL(CWorkerSession *)

CCommonSessionProxy *FindOrCreateSessionProxyL(CWorkerSession *aSession)

Parameters

CWorkerSession * aSession

FindSessionProxy(CWorkerSession *)

CCommonSessionProxy *FindSessionProxy(CWorkerSession *aSession)

Parameters

CWorkerSession * aSession

IsPlayerShutdownComplete()

TBool IsPlayerShutdownComplete()[pure virtual]

MaybeSetPlayerShutdownComplete(TBool)

IMPORT_C voidMaybeSetPlayerShutdownComplete(TBoolaForceShutdownNow)

Parameters

TBool aForceShutdownNow

OwnerThread()

CCommonWorkerThread *OwnerThread()[inline]

PanicClient(CWorkerSubSession &, TInt)

voidPanicClient(CWorkerSubSession &aSubSession,
TIntaPanic
)

Panic the client in response to an operation on an existing subsession, after which the request mustn't be completed

Parameters

CWorkerSubSession & aSubSession
TInt aPanic

PanicClient(CWorkerSubSession &, const TDesC &, TInt)

voidPanicClient(CWorkerSubSession &aSubSession,
const TDesC &aCategory,
TIntaPanic
)

Panic the client in response to an operation on an existing subsession, after which the request mustn't be completed

This version allows panic categories to be passed in to support expected legacy behaviour.

Parameters

CWorkerSubSession & aSubSession
const TDesC & aCategory
TInt aPanic

PanicClient(TInt)

IMPORT_C voidPanicClient(TIntaPanic)

Parameters

TInt aPanic

PanicClient(const TDesC &, TInt)

IMPORT_C voidPanicClient(const TDesC &aCategory,
TIntaPanic
)

Parameters

const TDesC & aCategory
TInt aPanic

PitBoss()

CCommonPitBoss &PitBoss()const [inline]

PlayerRole()

TPlayerRole PlayerRole()const [inline]

PostMortemCleanup()

TInt PostMortemCleanup()

Walk through all of the subsessions, telling each to complete all blocked requests with KErrServerAbort. We don't attempt to free them - although with a shared heap this could reduce the amount of leakage it seems likely that the more we do with these data structures, the greater the risk that the contagion spreads to other users of the heap. Clients that attempt almost any further operation after KErrAbort will get panicked by the Dealer in the usual bad handle way - this is harsh but fair, and better than simply leaving them hung.

ProcessMessageL(const RSafeMessage &, CWorkerSubSession *)

IMPORT_C voidProcessMessageL(const RSafeMessage &aMsg,
CWorkerSubSession *aSubSession
)

Parameters

const RSafeMessage & aMsg
CWorkerSubSession * aSubSession

ProcessShutdownRequest(CommsFW::TCFShutdownType)

voidProcessShutdownRequest(CommsFW::TCFShutdownTypeaType)

If an incoming shutdown request is of type EImmediate, informs the Worker Thread that Player shutdown is complete, otherwise do nothing here.

Parameters

CommsFW::TCFShutdownType aType

Reset()

voidReset()[protected, inline]

Return()

TInt Return()[protected, inline]

SafeMessage()

const RSafeMessage &SafeMessage()const [inline]

Session()

CWorkerSession *Session()const [inline]

SetPlayerRole(const TPlayerRole &)

voidSetPlayerRole(const TPlayerRole &aType)

Parameters

const TPlayerRole & aType

SetReturn(TInt)

IMPORT_C voidSetReturn(TIntaReturn)

Parameters

TInt aReturn

SetSession(CWorkerSession *)

voidSetSession(CWorkerSession *aWorkerSession)[inline]

Parameters

CWorkerSession * aWorkerSession

ShouldCompleteCurrentRequest()

IMPORT_C TBoolShouldCompleteCurrentRequest()const

SubSession(const TSubSessionUniqueId &)

IMPORT_C CWorkerSubSession *SubSession(const TSubSessionUniqueId &aSubSessionUniqueId)const

Parameters

const TSubSessionUniqueId & aSubSessionUniqueId

SubSessions()

TSubSessionContainer &SubSessions()[inline]

Transport()

CommsFW::CCommsTransport &Transport()const [inline]

WorkerId()

CommsFW::TWorkerId WorkerId()const [inline]

WorkerThread()

CCommonWorkerThread &WorkerThread()const [inline]

Member Type Definitions Documentation

Typedef TSubSessionContainer

typedef RPointerArray< CWorkerSubSession >TSubSessionContainer

Member Data Documentation

TBool iComplete

TBool iComplete[protected]

const RSafeMessage * iCurrentMessage

const RSafeMessage *iCurrentMessage[private]

CCommonSessionProxy * iCurrentSessionProxy

CCommonSessionProxy *iCurrentSessionProxy[private]

CCommonWorkerThread * iOwnerThread

CCommonWorkerThread *iOwnerThread[private]

TPlayerRole iPlayerRole

TPlayerRole iPlayerRole[private]

TInt iReturn

TInt iReturn[protected]

CWorkerSession * iSession

CWorkerSession *iSession[private]

TDblQue< CCommonSessionProxy > iSessionProxies

TDblQue< CCommonSessionProxy >iSessionProxies[private]

TSubSessionContainer iSubSessions

TSubSessionContainer iSubSessions[private]