Here is an example where the sip specification matches exactly the corresponding
header files:

-- start header file --
#ifndef V_H
#define V_H

class A
{
public:
    A();
    virtual ~A();
    virtual int getTypeId() = 0;
};

class B: public A // abstract by derivation
{
public:
    B();
    virtual ~B();
    virtual int bStuff();
};

class C: public B // abstract by derivation
{
public:
    C();
    virtual ~C();
    virtual int cStuff();
};

class D: public C
{
public:
    D();
    virtual ~D();
    virtual int getTypeId();
    virtual int dStuff();
};


#endif // V_H
-- end header file --

-- start sip file --
%Module v 0

class A
{
%TypeHeaderCode
#include <v.h>
%End

public:
    A();
    virtual ~A();
    virtual int getTypeId() = 0;
};

class B: A
{
%TypeHeaderCode
#include <v.h>
%End

public:
    B();
    virtual ~B();
    virtual int bStuff();
    // SIP must have the information so that I do not have to copy
    // virtual int getTypeId() = 0;
    // from a base class since that may be tedious in huge libraries
};

class C: B /Abstract/ // prevents subclassing
{
%TypeHeaderCode
#include <v.h>
%End

public:
    C();
    virtual ~C();
    virtual int cStuff();
};

class D: C
{
%TypeHeaderCode
#include <v.h>
%End

public: 
    D();
    virtual ~D();
    virtual int getTypeId();
    virtual int dStuff();
};
-- end sip file

For C++, classes A, and B and C by inheritance are abstract because of the
pure virtual getTypeId() declared in A.

SIP does not look for pure virtual functions in base classes of a class but it
should have all the information isn't it?

Small demo module attached.

Gerard

Attachment: Virtual-0.0.1.tar.gz
Description: Binary data

_______________________________________________
PyKDE mailing list    [email protected]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to