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