new fix for director protected members + overloading
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8790 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
358c35bf35
commit
caf47cde94
3 changed files with 20 additions and 3 deletions
|
|
@ -123,6 +123,7 @@ class FooBar : private Foo
|
|||
virtual ~AA() {};
|
||||
protected:
|
||||
virtual void draw() {};
|
||||
virtual void plot() {};
|
||||
};
|
||||
|
||||
class BB : public AA {
|
||||
|
|
@ -132,6 +133,9 @@ class FooBar : private Foo
|
|||
protected:
|
||||
void draw() {};
|
||||
void draw(int arg1) {};
|
||||
|
||||
void plot(int arg1) {};
|
||||
void plot() {};
|
||||
};
|
||||
%}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,3 +60,9 @@ try:
|
|||
except:
|
||||
error = 0
|
||||
if (error): raise RuntimeError
|
||||
|
||||
|
||||
try:
|
||||
f = director_abstract.A.f
|
||||
except:
|
||||
raise RuntimeError
|
||||
|
|
|
|||
|
|
@ -765,9 +765,17 @@ int Language::cDeclaration(Node *n) {
|
|||
if (!isfriend ) {
|
||||
/* we check what director needs. If the method is pure virtual,
|
||||
it is always needed. */
|
||||
if (!(directorsEnabled() && Getattr(n,"director")) ) {
|
||||
if (!(directorsEnabled() && is_member_director(CurrentClass,n) && need_nonpublic_member(n))) {
|
||||
return SWIG_NOWRAP;
|
||||
}
|
||||
/* prevent wrapping the method twice due to overload */
|
||||
String *wrapname = NewStringf("nonpublic_%s%s",Getattr(n,"sym:name"), Getattr(n,"sym:overname"));
|
||||
if (Getattr(CurrentClass,wrapname)) {
|
||||
Delete(wrapname);
|
||||
return SWIG_NOWRAP;
|
||||
}
|
||||
SetFlag(CurrentClass,wrapname);
|
||||
Delete(wrapname);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2305,8 +2313,7 @@ int Language::classHandler(Node *n) {
|
|||
if (Strcmp(type,"cdecl") !=0 ) continue;
|
||||
String* methodname = Getattr(method,"sym:name");
|
||||
String* wrapname = NewStringf("%s_%s", symname,methodname);
|
||||
if (!Getattr(symbols,wrapname)
|
||||
&& (!is_public(method))) {
|
||||
if (!Getattr(symbols,wrapname) && (!is_public(method))) {
|
||||
Node* m = Copy(method);
|
||||
Setattr(m, "director", "1");
|
||||
Setattr(m,"parentNode", n);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue