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 void CleanupDeadWorker ( CommsFW::TWorkerId )
IMPORT_C CCommonSessionProxy * CurrentSessionProxyL ()
void DoProcessMessageL (const RSafeMessage &, CWorkerSubSession *)
IMPORT_C void DontCompleteCurrentRequest ()
CCommonSessionProxy * FindOrCreateSessionProxyL ( CWorkerSession *)
CCommonSessionProxy * FindSessionProxy ( CWorkerSession *)
TBool IsPlayerShutdownComplete ()
IMPORT_C void MaybeSetPlayerShutdownComplete ( TBool )
CCommonWorkerThread * OwnerThread ()
void PanicClient ( CWorkerSubSession &, TInt )
void PanicClient ( CWorkerSubSession &, const TDesC &, TInt )
IMPORT_C void PanicClient ( TInt )
IMPORT_C void PanicClient (const TDesC &, TInt )
CCommonPitBoss & PitBoss ()
TPlayerRole PlayerRole ()
TInt PostMortemCleanup ()
IMPORT_C void ProcessMessageL (const RSafeMessage &, CWorkerSubSession *)
void ProcessShutdownRequest ( CommsFW::TCFShutdownType )
const RSafeMessage & SafeMessage ()
CWorkerSession * Session ()
void SetPlayerRole (const TPlayerRole &)
IMPORT_C void SetReturn ( TInt )
void SetSession ( CWorkerSession *)
IMPORT_C TBool ShouldCompleteCurrentRequest ()
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 *)
void Reset ()
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_C CCommonPlayer ( CCommonWorkerThread * aOwnerThread,
TPlayerRole aPlayerRole
) [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::TWorkerId aWorker )

Parameters

CommsFW::TWorkerId aWorker

CleanupDeadWorker(CommsFW::TWorkerId)

IMPORT_C void CleanupDeadWorker ( CommsFW::TWorkerId aPeerId )

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 *)

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

Parameters

const RSafeMessage & aMsg
CWorkerSubSession * aSubSession

DontCompleteCurrentRequest()

IMPORT_C void DontCompleteCurrentRequest ( )

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 void MaybeSetPlayerShutdownComplete ( TBool aForceShutdownNow )

Parameters

TBool aForceShutdownNow

OwnerThread()

CCommonWorkerThread * OwnerThread ( ) [inline]

PanicClient(CWorkerSubSession &, TInt)

void PanicClient ( CWorkerSubSession & aSubSession,
TInt aPanic
)

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)

void PanicClient ( CWorkerSubSession & aSubSession,
const TDesC & aCategory,
TInt aPanic
)

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 void PanicClient ( TInt aPanic )

Parameters

TInt aPanic

PanicClient(const TDesC &, TInt)

IMPORT_C void PanicClient ( const TDesC & aCategory,
TInt aPanic
)

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 void ProcessMessageL ( const RSafeMessage & aMsg,
CWorkerSubSession * aSubSession
)

Parameters

const RSafeMessage & aMsg
CWorkerSubSession * aSubSession

ProcessShutdownRequest(CommsFW::TCFShutdownType)

void ProcessShutdownRequest ( CommsFW::TCFShutdownType aType )

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()

void Reset ( ) [protected, inline]

Return()

TInt Return ( ) [protected, inline]

SafeMessage()

const RSafeMessage & SafeMessage ( ) const [inline]

Session()

CWorkerSession * Session ( ) const [inline]

SetPlayerRole(const TPlayerRole &)

void SetPlayerRole ( const TPlayerRole & aType )

Parameters

const TPlayerRole & aType

SetReturn(TInt)

IMPORT_C void SetReturn ( TInt aReturn )

Parameters

TInt aReturn

SetSession(CWorkerSession *)

void SetSession ( CWorkerSession * aWorkerSession ) [inline]

Parameters

CWorkerSession * aWorkerSession

ShouldCompleteCurrentRequest()

IMPORT_C TBool ShouldCompleteCurrentRequest ( ) 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]