CProtocolFamilyBase Class Reference

class CProtocolFamilyBase : public CBase

Defines the interface for protocol families.

Protocol families must:

be able to identify the protocols which they can create

be able to create instances of protocol objects for all the protocols they advertise

Inherits from

Constructor & Destructor Documentation

CProtocolFamilyBase()

IMPORT_CCProtocolFamilyBase()

~CProtocolFamilyBase()

IMPORT_C~CProtocolFamilyBase()[virtual]

Member Functions Documentation

Close()

IMPORT_C voidClose()[virtual]

Install()

TInt Install()[pure virtual]

Initialises a protocol family.

After the CProtocolFamilyBase-derived object has been created, the first function called by the socket server on that object is Install(). It is at this point that the CProtocolFamilyBase-derived object should perform any initialisation which it needs.

System-wide error code

NewProtocolL(TUint, TUint)

CProtocolBase *NewProtocolL(TUintaSockType,
TUintaProtocol
)[pure virtual]

Creates a new protocol object.

During socket creation, after the socket server has called Open() on a protocol family, it next calls this function to create an instance of a CProtocolBase-derived object - the protocol itself.

A protocol, or NULL if some error has prevented the protocol from being created.

Parameters

TUint aSockTypeA supported socket type for the protocol family as advertised in the protocol list.
TUint aProtocolA protocol number specifying a protocol returned by ProtocolList().

Open()

IMPORT_C voidOpen()[virtual]

ProtocolList(TServerProtocolDesc *&)

TUint ProtocolList(TServerProtocolDesc *&aProtocolList)[pure virtual]

Gets a list of supported protocols.

Called during initialisation, directly after Install(). ProtocolList() returns a list of all the protocols in the protocol family. The protocol family object should allocate memory to hold an array of TServerProtocolDesc structures. This function should then fill them in and return the pointer and a count of the number of protocols supported. The socket server caches this information, so that it does not need to keep the protocol module loaded.

The protocol family should not attempt to use static data (which it can't) or to free this memory later, as the socket server will automatically free this storage.

The number of protocols in this protocol family (and entries in the list of protocols)

Parameters

TServerProtocolDesc *& aProtocolListThis pointer is set to point to memory allocated by the protocol family and filled in as described above

QueryVersionSupported(const TVersion &)

IMPORT_C TBoolQueryVersionSupported(const TVersion &aVer)const [virtual]

Parameters

const TVersion & aVer

RefCount()

TInt RefCount()const [inline]

Remove()

IMPORT_C TIntRemove()[virtual]

SetLibraryL(RLibrary &)

voidSetLibraryL(RLibrary &aLib)

Parameters

RLibrary & aLib

Member Data Documentation

CLibUnloader * iLibUnloader

CLibUnloader *iLibUnloader[private]

CProtocolFamilyRef * iManagerRef

CProtocolFamilyRef *iManagerRef[private]

TInt iRefCount

TInt iRefCount[private]

TVersion iVersion

TVersion iVersion[protected]

Contains version information