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
Public Member Functions | |
---|---|
CProtocolFamilyBase () | |
~CProtocolFamilyBase () | |
IMPORT_C void | Close () |
TInt | Install () |
CProtocolBase * | NewProtocolL ( TUint , TUint ) |
IMPORT_C void | Open () |
TUint | ProtocolList ( TServerProtocolDesc *&) |
IMPORT_C TBool | QueryVersionSupported (const TVersion &) |
TInt | RefCount () |
IMPORT_C TInt | Remove () |
void | SetLibraryL ( RLibrary &) |
Protected Attributes | |
---|---|
TVersion | iVersion |
Private Attributes | |
---|---|
CLibUnloader * | iLibUnloader |
CProtocolFamilyRef * | iManagerRef |
TInt | iRefCount |
IMPORT_C | ~CProtocolFamilyBase | ( | ) | [virtual] |
Destructor for the protocol family Calling this means that all protocols have been unloaded and we can close the library after our death.
IMPORT_C void | Close | ( | ) | [virtual] |
replacment close gives any derived class chance to delete anything it wants or to signal an error.
Closes this reference counting object
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.
CProtocolBase * | NewProtocolL | ( | TUint | aSockType, |
TUint | aProtocol | |||
) | [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.
IMPORT_C void | Open | ( | ) | [virtual] |
Opens a protocol family.
When a socket is created, the socket server first calls this function on the protocol family. It is not compulsory for the protocol family to implement this function - the default behaviour of the socket server, which is to increment an access count for the protocol family, may be sufficient.
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.
TServerProtocolDesc *& aProtocolList | This pointer is set to point to memory allocated by the protocol family and filled in as described above |
IMPORT_C TBool | QueryVersionSupported | ( | const TVersion & | aVer | ) | const [virtual] |
Queries whether the version is supported by the protocol
const TVersion & aVer |
IMPORT_C TInt | Remove | ( | ) | [virtual] |
Prepares the protocol family to be removed in a derived class.
The socket server calls Remove() before unloading the library for a given protocol family.
This implementation returns KErrNone.
void | SetLibraryL | ( | RLibrary & | aLib | ) |
Sets the Protocol Family's resource library to dynamically loadable DLL.
RLibrary & aLib |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.