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 &)
void Dequeue ()
void DoDiscoverL ( TUint &)
void DoShutdownL ()
void DoStartTaskL ( CTask *)
void EndAllTasks (const TInt )
void EndTask (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 ()
void SendL (const TCFMessage &)
void SetInitialising (const TBool )
const TCFSubModuleAddress & SubModuleNameRefL (const TCFSubModuleAddress &)
Protected Member Functions
void DoCancel ()
void RunL ()
Private Member Functions
CModule ( MBindManagerNotify *, TransactionId &, const TCFModuleNameF &)
void ConstructL (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 * aNotifier bindmanager object to report events to
TransactionId & aTransactionId Generator of unique transaction ids
const TCFModuleNameF & aModule the 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 &)

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

Parameters

const RCFChannel::TMsgQueues & aInputQueues queues on which messages should sent to the module
const RCFChannel::TMsgQueues & aOutputQueues queues on which messages will be received from the module

Dequeue()

void Dequeue ( )

Remove this from the linked list

DoCancel()

void DoCancel ( ) [protected, virtual]

Cancel CModule NotifyDataAvailable

DoDiscoverL(TUint &)

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

Parameters

TUint & aTaskId filled in with the id of the new task

DoShutdownL()

void DoShutdownL ( )

DoStartTaskL(CTask *)

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

Parameters

CTask * aTask the task to process

EndAllTasks(const TInt)

void EndAllTasks ( const TInt aStatus )

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

Parameters

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

EndTask(const TUint &, const TInt)

void EndTask ( const TUint & aTaskId,
const TInt aStatus
)

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

Parameters

const TUint & aTaskId id of the finished task
const TInt aStatus the 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 & aPosition The position in the array of submodulenames.
TCFSubModuleNameF & aSubModuleName The 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 TCFBindType aType,
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 & aInputQueues queues for comms between the modules being bound
const RCFChannel::TMsgQueues & aOutputQueues queues for comms between the modules being bound
const TCFSubModuleAddress & aSubModule1 first submodule being bound
const TCFSubModuleAddress & aSubModule2 second submodule being bound
const TCFBindType aType the type of binding
CTask *& aTask set 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 TBool aPeerIsDead,
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 & aSubModule1 first submodule being unbound
const TCFSubModuleAddress & aSubModule2 second submodule being unbound
const TBool aPeerIsDead indicates whether the second module is dead or not
CTask *& aTask the task

HasSubModule(const TCFSubModuleNameF &)

TBool HasSubModule ( const TCFSubModuleNameF & aSubModule ) const

Searches for a specified submodule name within this module

Parameters

const TCFSubModuleNameF & aSubModule the 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 * aNotifier bindmanager object to report events to
const TCFModuleNameF & aModule name of module
TransactionId & aTransactionId xx
const RCFChannel::TMsgQueues & aInputQueues queues on which messages should sent to the module
const RCFChannel::TMsgQueues & aOutputQueues queues 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()

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

SendL(const TCFMessage &)

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

Parameters

const TCFMessage & aMessage the message to be sent

SetInitialising(const TBool)

void SetInitialising ( const TBool aInitialising )

Set method for the module initialisation state

Parameters

const TBool aInitialising set 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 & aSubModule the 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]