CCommsProviderModule Class Reference

class CCommsProviderModule : public CActive

This is the main module orchestrating thread creation, loading and unloading, The class is asynchronously activated from three active objects: its own derivative, the iModuleTimer * member and the iUndertaker member. The type of action taken on a particular input is decided by its internal state, defined by iState.

Inherits from

Public Member Functions
~CCommsProviderModule ()
TInt CancelLoad ()
TInt CancelUnload ( RootServer::TRSUnLoadType )
void CreateThreadL ()
const TFileName & GetDll ()
RHeap * GetHeapPtr ()
const CommsFW::TCFModuleNameF & GetName ()
const CommsFW::RCFChannel & GetRecvChannel ()
const CommsFW::RCFChannel & GetSendChannel ()
RootServer::TRSModuleState GetState ()
RThread GetThread ()
void Inhume ()
TBool IsServer ()
TBool IsSticky ()
TInt Load ( TRequestStatus &)
void RegisterSuddenDeathNotifierL ( MNotifySuddenDeath *)
IMPORT_C void SuddenDeath ( TInt )
TInt Unload ()
void UnregisterSuddenDeathNotifier ( MNotifySuddenDeath *)
Protected Member Functions
CCommsProviderModule ( RThread &)
IMPORT_C void ConstructL ( CRootServer *, const RootServer::TRSStartModuleParams &, HBufC8 *)
Private Member Functions
TInt CreateModuleThread (const TDesC &, TThreadFunction , TInt , RHeap *, TAny *)
void DoCancel ()
void NotifyOfDeath ( TInt )
IMPORT_C void RunL ()
TBool UidMatch (const TUid &)
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::RunError(TInt)
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
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()
Inherited Enumerations
CActive:TPriority
Public Attributes
TDblQueLink iLink
Protected Attributes
TUint32 iControlFlags
TFileName iDll
TInt iExitReason
RHeap * iHeapPtr
RootServer::TRSHeapType iHeapType
HBufC8 * iIniData
TBool iIsServer
TBool iIsSticky
RLibrary iLibrary
TInt iMaxHeapSize
TInt iMinHeapSize
CommsFW::TCFModuleNameF iName
TDblQue < CNotifySuddenDeathContainer > iNotifiers
TThreadPriority iPriority
CommsFW::RCFChannel iRecv
TRequestStatus * iReqStatus
CRootServer * iRootServer
CommsFW::RCFChannel iSend
CommsFW::TCFModuleNameF iShareHeapWith
TInt iStackSize
RThread & iThread
TInt iThreadFunctionOrdinal
CRSTransientModuleInfo * iThreadStartupInfo
CModuleUndertaker * iUndertaker
Private Attributes
RootServer::TRSModuleState iState
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CCommsProviderModule(RThread &)

IMPORT_C CCommsProviderModule ( RThread & aThread ) [protected]

Parameters

RThread & aThread

~CCommsProviderModule()

IMPORT_C ~CCommsProviderModule ( )

Member Functions Documentation

CancelLoad()

TInt CancelLoad ( )

Cancel Load. Marks whether an attempt to cancel load has happened

CancelUnload(RootServer::TRSUnLoadType)

TInt CancelUnload ( RootServer::TRSUnLoadType aType )

Parameters

RootServer::TRSUnLoadType aType

ConstructL(CRootServer *, const RootServer::TRSStartModuleParams &, HBufC8 *)

IMPORT_C void ConstructL ( CRootServer * aRootServer,
const RootServer::TRSStartModuleParams & aParams,
HBufC8 * aIniData
) [protected]

Parameters

CRootServer * aRootServer
const RootServer::TRSStartModuleParams & aParams
HBufC8 * aIniData

CreateModuleThread(const TDesC &, TThreadFunction, TInt, RHeap *, TAny *)

TInt CreateModuleThread ( const TDesC & aName,
TThreadFunction aOtherThreadFunction,
TInt aStackSize,
RHeap * aHeap,
TAny * aModuleArgs
) [private, pure virtual]

Parameters

const TDesC & aName
TThreadFunction aOtherThreadFunction
TInt aStackSize
RHeap * aHeap
TAny * aModuleArgs

CreateThreadL()

void CreateThreadL ( )

Creates and sets up thread ready for initialisation

DoCancel()

void DoCancel ( ) [private, inline, virtual]

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel() .

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel() .

CActive::Cancel

GetDll()

const TFileName & GetDll ( ) const [inline]

Returns Dll filename for a CPM

GetHeapPtr()

RHeap * GetHeapPtr ( ) const [inline]

Returns heap pointer for a CPM

GetName()

const CommsFW::TCFModuleNameF & GetName ( ) const [inline]

Returns name for a CPM

GetRecvChannel()

const CommsFW::RCFChannel & GetRecvChannel ( ) const [inline]

GetSendChannel()

const CommsFW::RCFChannel & GetSendChannel ( ) const [inline]

GetState()

RootServer::TRSModuleState GetState ( ) const [inline]

Returns state for a CPM

GetThread()

RThread GetThread ( ) const

Return pointer to thread for a CPM

Inhume()

void Inhume ( )

IsServer()

TBool IsServer ( ) const [inline]

IsSticky()

TBool IsSticky ( ) const [inline]

Load(TRequestStatus &)

TInt Load ( TRequestStatus & aStatus )

Initiates the loading of a module. Sets states and resumes thread

Parameters

TRequestStatus & aStatus The status of the active object which will be completed on load

NotifyOfDeath(TInt)

void NotifyOfDeath ( TInt aReason ) [private]

Controls notifications on death of a module

Parameters

TInt aReason The reason associated with the death event

RegisterSuddenDeathNotifierL(MNotifySuddenDeath *)

void RegisterSuddenDeathNotifierL ( MNotifySuddenDeath * aNotifier )

Register a sudden death notifier. Instantiates a container with the pointer to the notifier and puts it in the TblQue list.

Parameters

MNotifySuddenDeath * aNotifier The notifier to be registered.

RunL()

IMPORT_C void RunL ( ) [private, virtual]

Handles each active object completion event differently depending on the state of the module

SuddenDeath(TInt)

IMPORT_C void SuddenDeath ( TInt aReason ) [virtual]

Controls events on death of a module Notifies Bind Manager of death event, so that it can clean up aReason The reason associated with the death event

Parameters

TInt aReason xxx

UidMatch(const TUid &)

TBool UidMatch ( const TUid & aUid ) const [private]

Matches the Uid for a CPM

Parameters

const TUid & aUid The Uid to be checked

Unload()

TInt Unload ( )

Initiates the unloading of a module. Simply sets internal state

UnregisterSuddenDeathNotifier(MNotifySuddenDeath *)

void UnregisterSuddenDeathNotifier ( MNotifySuddenDeath * aNotifier )

Unregister a sudden death notifier. Searches for container with a pointer to notifier being unregistered, and if found deletes unlinks the container and deletes it. Failure to find such a notifier is not an error as this is typically a clean-up behaviour.

Parameters

MNotifySuddenDeath * aNotifier The notifier to be unregistered.

Member Data Documentation

TUint32 iControlFlags

TUint32 iControlFlags [protected]

Additional module control flags TRSStartModuleParamContainer::TControlFlags

TFileName iDll

TFileName iDll [protected]

Filename of DLL containing this module.

TInt iExitReason

TInt iExitReason [protected]

Exitreason when module has exited.

RHeap * iHeapPtr

RHeap * iHeapPtr [protected]

RootServer::TRSHeapType iHeapType

RootServer::TRSHeapType iHeapType [protected]

EDefaultHeap, EShareHeap(with another loaded module), ENewHeap.

HBufC8 * iIniData

HBufC8 * iIniData [protected]

TBool iIsServer

TBool iIsServer [protected]

Whether module is being loaded as a server.

TBool iIsSticky

TBool iIsSticky [protected]

Whether RootServer should deny client shutdown requests.

RLibrary iLibrary

RLibrary iLibrary [protected]

Handle on the DLL, kept open as long as the module is active.

TDblQueLink iLink

TDblQueLink iLink

TInt iMaxHeapSize

TInt iMaxHeapSize [protected]

Max heap size of thread.

TInt iMinHeapSize

TInt iMinHeapSize [protected]

Min heap size of thread.

CommsFW::TCFModuleNameF iName

CommsFW::TCFModuleNameF iName [protected]

Name of module, defined by privileged app.

TDblQue< CNotifySuddenDeathContainer > iNotifiers

TDblQue < CNotifySuddenDeathContainer > iNotifiers [protected]

Registered sudden death notifiers.

TThreadPriority iPriority

TThreadPriority iPriority [protected]

Priority of thread.

CommsFW::RCFChannel iRecv

CommsFW::RCFChannel iRecv [protected]

Receiving comms channel.

TRequestStatus * iReqStatus

TRequestStatus * iReqStatus [protected]

Saved for asynchronous stuff.

CRootServer * iRootServer

CRootServer * iRootServer [protected]

Access to the root server public functions.

CommsFW::RCFChannel iSend

CommsFW::RCFChannel iSend [protected]

Sending comms channel.

CommsFW::TCFModuleNameF iShareHeapWith

CommsFW::TCFModuleNameF iShareHeapWith [protected]

If sharing a heap, then this is the module to share with.

TInt iStackSize

TInt iStackSize [protected]

Stack size of thread.

RootServer::TRSModuleState iState

RootServer::TRSModuleState iState [private]

RThread & iThread

RThread & iThread [protected]

Thread handle of running module context.

TInt iThreadFunctionOrdinal

TInt iThreadFunctionOrdinal [protected]

Ordinal for main threadfunction in dll.

CRSTransientModuleInfo * iThreadStartupInfo

CRSTransientModuleInfo * iThreadStartupInfo [protected]

CModuleUndertaker * iUndertaker

CModuleUndertaker * iUndertaker [protected]

Active object listening for sudden death.