Fixes to support protected members with director, proper virtual member recognition and support of the nodirector feature
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5485 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
94fa335b14
commit
0f19564193
13 changed files with 380 additions and 37 deletions
46
Examples/test-suite/director_protected.i
Normal file
46
Examples/test-suite/director_protected.i
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
%module(directors="1") director_protected
|
||||
|
||||
%{
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
%}
|
||||
|
||||
%include "std_string.i"
|
||||
|
||||
%feature("director") Foo;
|
||||
%feature("director") Bar;
|
||||
|
||||
%newobject *::create();
|
||||
|
||||
%inline %{
|
||||
class Foo {
|
||||
public:
|
||||
virtual ~Foo() {}
|
||||
virtual std::string pong() {
|
||||
return "Foo::pong();" + ping();
|
||||
}
|
||||
protected:
|
||||
virtual std::string ping() = 0;
|
||||
};
|
||||
|
||||
class Bar : public Foo
|
||||
{
|
||||
public:
|
||||
Foo* create()
|
||||
{
|
||||
return new Bar();
|
||||
}
|
||||
|
||||
std::string pong() {
|
||||
return "Bar::pong();" + Foo::pong();
|
||||
}
|
||||
|
||||
protected:
|
||||
std::string ping() {
|
||||
return "Bar::ping();";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
%}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue