add support for multi-inheritance at the python side and performance tunings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7819 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
253d0dd65a
commit
42277fcfd7
9 changed files with 426 additions and 174 deletions
|
|
@ -38,8 +38,8 @@ b = director_basic.Bar(3)
|
|||
d = director_basic.MyClass()
|
||||
c = PyClass()
|
||||
|
||||
cc = PyClass.get_self(c)
|
||||
dd = PyClass.get_self(d)
|
||||
cc = director_basic.MyClass_get_self(c)
|
||||
dd = director_basic.MyClass_get_self(d)
|
||||
|
||||
bc = cc.cmethod(b)
|
||||
bd = dd.cmethod(b)
|
||||
|
|
@ -51,3 +51,40 @@ if bc.x != 34:
|
|||
if bd.x != 16:
|
||||
raise RuntimeError
|
||||
|
||||
|
||||
|
||||
class PyMulti(director_basic.Foo, director_basic.MyClass):
|
||||
def __init__(self):
|
||||
director_basic.Foo.__init__(self)
|
||||
director_basic.MyClass.__init__(self)
|
||||
pass
|
||||
|
||||
|
||||
def vmethod(self, b):
|
||||
b.x += 31
|
||||
return b
|
||||
|
||||
|
||||
def ping(self):
|
||||
return "PyFoo::ping()"
|
||||
|
||||
a = 0
|
||||
for i in range(0,100):
|
||||
pymult = PyMulti()
|
||||
pymult.pong()
|
||||
del pymult
|
||||
|
||||
|
||||
|
||||
pymult = PyMulti()
|
||||
|
||||
|
||||
|
||||
|
||||
p1 = director_basic.Foo_get_self(pymult)
|
||||
p2 = director_basic.MyClass_get_self(pymult)
|
||||
|
||||
p1.ping()
|
||||
p2.vmethod(bc)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue