CModule Class Reference

class CModule : public CActive

Manages the state of a CPM or comms-server and handles the asynchronous message queueuing.

Inherits from

Public Member Functions
~CModule()
TBool CheckDiscoveryMsgFinishedL(const TCFMessage &)
voidDequeue()
voidDoDiscoverL(TUint &)
voidDoShutdownL()
voidDoStartTaskL(CTask *)
voidEndAllTasks(const TInt)
voidEndTask(const TUint &, const TInt)
TInt EnumerateSubModules(const TInt &, TCFSubModuleNameF &)
TBool GetBindTaskL(const RCFChannel::TMsgQueues &, const RCFChannel::TMsgQueues &, const TCFSubModuleAddress &, const TCFSubModuleAddress &, const TCFBindType, CTask *&)
TBool GetUnbindTaskL(const TCFSubModuleAddress &, const TCFSubModuleAddress &, const TBool, CTask *&)
TBool HasSubModule(const TCFSubModuleNameF &)
const TBool &Initialising()
const TCFModuleNameF &Name()
CModule *NewL(MBindManagerNotify *, const TCFModuleNameF &, TransactionId &, const RCFChannel::TMsgQueues &, const RCFChannel::TMsgQueues &)
TInt NumSubModules()
TInt ReserveSpaceInSendQueue()
voidSendL(const TCFMessage &)
voidSetInitialising(const TBool)
const TCFSubModuleAddress &SubModuleNameRefL(const TCFSubModuleAddress &)
Protected Member Functions
voidDoCancel()
voidRunL()
Private Member Functions
CModule(MBindManagerNotify *, TransactionId &, const TCFModuleNameF &)
voidConstructL(const RCFChannel::TMsgQueues &, const RCFChannel::TMsgQueues &)
TUint GetNextTransactionId()
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
Private Attributes
TCFSubModuleNameF *iDiscoveryArray
TBool iInitialising
TCFModuleNameF iName
MBindManagerNotify *iNotifier
RCFChannel iRecvChannel
RCFChannel iSendChannel
CCommsChannelSendQueue *iSendQueue
RArray< TCFSubModuleAddress >iSubModuleAddrs
RArray< TCFSubModuleNameF >iSubModuleNames
TDblQue< CTask >iTaskList
TransactionId &iTransactionId
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CModule(MBindManagerNotify *, TransactionId &, const TCFModuleNameF &)

CModule(MBindManagerNotify *aNotifier,
TransactionId &aTransactionId,
const TCFModuleNameF &aModule
)[private]

Constructor for CModule

Parameters

MBindManagerNotify * aNotifierbindmanager object to report events to
TransactionId & aTransactionIdGenerator of unique transaction ids
const TCFModuleNameF & aModulethe name of the module

~CModule()

~CModule()

Destructor for CModule

Member Functions Documentation

CheckDiscoveryMsgFinishedL(const TCFMessage &)

TBool CheckDiscoveryMsgFinishedL(const TCFMessage &aMessage)

Parameters

const TCFMessage & aMessage

ConstructL(const RCFChannel::TMsgQueues &, const RCFChannel::TMsgQueues &)

voidConstructL(const RCFChannel::TMsgQueues &aInputQueues,
const RCFChannel::TMsgQueues &aOutputQueues
)[private]
Second phase constructor for CModule
leave
KErrNoMemory

Parameters

const RCFChannel::TMsgQueues & aInputQueuesqueues on which messages should sent to the module
const RCFChannel::TMsgQueues & aOutputQueuesqueues on which messages will be received from the module

Dequeue()

voidDequeue()

Remove this from the linked list

DoCancel()

voidDoCancel()[protected, virtual]

Cancel CModule NotifyDataAvailable

DoDiscoverL(TUint &)

voidDoDiscoverL(TUint &aTaskId)
Creates a task to send a discovery request to the module and sends the message itself
leave
KErrNoMemory

Parameters

TUint & aTaskIdfilled in with the id of the new task

DoShutdownL()

voidDoShutdownL()

DoStartTaskL(CTask *)

voidDoStartTaskL(CTask *aTask)
Sends the task's message and adds it the the task in progress list
leave
KErrNoMemory

Parameters

CTask * aTaskthe task to process

EndAllTasks(const TInt)

voidEndAllTasks(const TIntaStatus)

Called by bindmanager to end all tasks for this module. Called on receipt of a moduleEnded request

Parameters

const TInt aStatusthe status code with which the tasks will be ended

EndTask(const TUint &, const TInt)

voidEndTask(const TUint &aTaskId,
const TIntaStatus
)

Called by bindmanager to indicate that the task with the specified id has completed

Parameters

const TUint & aTaskIdid of the finished task
const TInt aStatusthe status code with which the task has ended

EnumerateSubModules(const TInt &, TCFSubModuleNameF &)

TInt EnumerateSubModules(const TInt &aPosition,
TCFSubModuleNameF &aSubModuleName
)

Enumerate all known submodules.

Parameters

const TInt & aPositionThe position in the array of submodulenames.
TCFSubModuleNameF & aSubModuleNameThe name to be returned

GetBindTaskL(const RCFChannel::TMsgQueues &, const RCFChannel::TMsgQueues &, const TCFSubModuleAddress &, const TCFSubModuleAddress &, const TCFBindType, CTask *&)

TBool GetBindTaskL(const RCFChannel::TMsgQueues &aInputQueues,
const RCFChannel::TMsgQueues &aOutputQueues,
const TCFSubModuleAddress &aSubModule1,
const TCFSubModuleAddress &aSubModule2,
const TCFBindTypeaType,
CTask *&aTask
)
Either creates a task to send a bind request or returns an existing task if a matching one already exists
leave
KErrNoMemory

Parameters

const RCFChannel::TMsgQueues & aInputQueuesqueues for comms between the modules being bound
const RCFChannel::TMsgQueues & aOutputQueuesqueues for comms between the modules being bound
const TCFSubModuleAddress & aSubModule1first submodule being bound
const TCFSubModuleAddress & aSubModule2second submodule being bound
const TCFBindType aTypethe type of binding
CTask *& aTaskset to point to the task

GetNextTransactionId()

TUint GetNextTransactionId()[private]

Generate a transaction id 'unique' to this module. Uses a straightforward 32 bit count so will wrap eventually.

GetUnbindTaskL(const TCFSubModuleAddress &, const TCFSubModuleAddress &, const TBool, CTask *&)

TBool GetUnbindTaskL(const TCFSubModuleAddress &aSubModule1,
const TCFSubModuleAddress &aSubModule2,
const TBoolaPeerIsDead,
CTask *&aTask
)
Either creates a task to send an unbind request or returns an existing task if a matching one already exists
leave
KErrNoMemory

Parameters

const TCFSubModuleAddress & aSubModule1first submodule being unbound
const TCFSubModuleAddress & aSubModule2second submodule being unbound
const TBool aPeerIsDeadindicates whether the second module is dead or not
CTask *& aTaskthe task

HasSubModule(const TCFSubModuleNameF &)

TBool HasSubModule(const TCFSubModuleNameF &aSubModule)const

Searches for a specified submodule name within this module

Parameters

const TCFSubModuleNameF & aSubModulethe name of the submodule to search for

Initialising()

const TBool &Initialising()const

Accessor method for the module initialisation state

Name()

const TCFModuleNameF &Name()const

Accessor method for the module name

NewL(MBindManagerNotify *, const TCFModuleNameF &, TransactionId &, const RCFChannel::TMsgQueues &, const RCFChannel::TMsgQueues &)

CModule *NewL(MBindManagerNotify *aNotifier,
const TCFModuleNameF &aModule,
TransactionId &aTransactionId,
const RCFChannel::TMsgQueues &aInputQueues,
const RCFChannel::TMsgQueues &aOutputQueues
)[static]
Generates a new CModule object
leave
KErrNoMemory

Parameters

MBindManagerNotify * aNotifierbindmanager object to report events to
const TCFModuleNameF & aModulename of module
TransactionId & aTransactionIdxx
const RCFChannel::TMsgQueues & aInputQueuesqueues on which messages should sent to the module
const RCFChannel::TMsgQueues & aOutputQueuesqueues on which messages will be received from the module

NumSubModules()

TInt NumSubModules()const

Returns the number of submodules within this module

ReserveSpaceInSendQueue()

TInt ReserveSpaceInSendQueue()

RunL()

voidRunL()[protected, virtual]
Active object RunL method, called when data becomes available on the receive queue
leave

SendL(const TCFMessage &)

voidSendL(const TCFMessage &aMessage)
Public method to send a message to a comms server or CPM
leave
KErrNoMemory

Parameters

const TCFMessage & aMessagethe message to be sent

SetInitialising(const TBool)

voidSetInitialising(const TBoolaInitialising)

Set method for the module initialisation state

Parameters

const TBool aInitialisingset true if module is initialising

SubModuleNameRefL(const TCFSubModuleAddress &)

const TCFSubModuleAddress &SubModuleNameRefL(const TCFSubModuleAddress &aSubModule)
Provides a reference to a local copy of the submodule name passed as a parameter which is guaranteed to last the lifetime of the cmodule
leave
KErrNoMemory

Parameters

const TCFSubModuleAddress & aSubModulethe name of the submodule

Member Data Documentation

TCFSubModuleNameF * iDiscoveryArray

TCFSubModuleNameF *iDiscoveryArray[private]

TBool iInitialising

TBool iInitialising[private]

TDblQueLink iLink

TDblQueLink iLink

TCFModuleNameF iName

TCFModuleNameF iName[private]

MBindManagerNotify * iNotifier

MBindManagerNotify *iNotifier[private]

RCFChannel iRecvChannel

RCFChannel iRecvChannel[private]

RCFChannel iSendChannel

RCFChannel iSendChannel[private]

CCommsChannelSendQueue * iSendQueue

CCommsChannelSendQueue *iSendQueue[private]

RArray< TCFSubModuleAddress > iSubModuleAddrs

RArray< TCFSubModuleAddress >iSubModuleAddrs[private]

RArray< TCFSubModuleNameF > iSubModuleNames

RArray< TCFSubModuleNameF >iSubModuleNames[private]

TDblQue< CTask > iTaskList

TDblQue< CTask >iTaskList[private]

TransactionId & iTransactionId

TransactionId &iTransactionId[private]