stefano ruberto
2008-05-08 14:33:04 UTC
Hi there...
The problem "... Multiple inheritance is not supported in C#."
In order to translate multiple inheritance into c# I think would be
usefull to use the c# interface.
SWIG only take the first base class in my c++ code but anyway insert the
inherited method from all
the base class in the cs proxy class...
So I tought to add a c# interface for each abstract c++ base class.
//c++ side
class abstarctCppBase1{ void mth1Base1()=0 ; void mth2Base1(){} ... }
class abstarctCppBase2{ void mth1Base2()=0 ; void mth2Base1() {}...}
class CppInherited : abstarctCppBase1 , abstarctCppBase2
{ }
//c# side
interface Ibase2 { mth1Base2(); mth2Base1(); }
class csBase1{ ... }
class csInherited : csBase1, Ibase2 { void mth1Base1(){} void
mth2Base1(){} void mth1Base2(){} void mth2Base1() {} }
Is this the correct way ... ??
I'm so new to swig so that any help will be appreciated!
Thank you for your help
By
Rubio
The problem "... Multiple inheritance is not supported in C#."
In order to translate multiple inheritance into c# I think would be
usefull to use the c# interface.
SWIG only take the first base class in my c++ code but anyway insert the
inherited method from all
the base class in the cs proxy class...
So I tought to add a c# interface for each abstract c++ base class.
//c++ side
class abstarctCppBase1{ void mth1Base1()=0 ; void mth2Base1(){} ... }
class abstarctCppBase2{ void mth1Base2()=0 ; void mth2Base1() {}...}
class CppInherited : abstarctCppBase1 , abstarctCppBase2
{ }
//c# side
interface Ibase2 { mth1Base2(); mth2Base1(); }
class csBase1{ ... }
class csInherited : csBase1, Ibase2 { void mth1Base1(){} void
mth2Base1(){} void mth1Base2(){} void mth2Base1() {} }
Is this the correct way ... ??
I'm so new to swig so that any help will be appreciated!
Thank you for your help
By
Rubio