Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Interface definition overview

It was stated earlier that an interface definition serves two purposes:

So, an interface definition class is a normal abstract class plus some implemented functions that use ECom to create object instances. The class can have any base class: for example,

The class must always declare a private UID member. This is set on object instantiation and is used by ECom to identify the instance when object destruction occurs.

Example

The following shows an example segment of a interface definition class that derives from CActive (i.e. it is an active object).

class CExampleInterfaceDefinition : public CActive
    {
public:
    // Wraps ECom object instantitation
    static CExampleInterfaceDefinition* NewL();
    // Wraps ECom object destruction 
    virtual ~CExampleInterfaceDefinition();
    // Interface service 
    virtual void DoMethodL() = 0;
...
private:
    // Instance identifier key
    TUid iDtor_ID_Key;
    };

Notes

The class: