add 'self' attribute for later use

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7981 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-12-14 07:26:37 +00:00
commit cbca8a3e88
2 changed files with 10 additions and 0 deletions

View file

@ -772,6 +772,7 @@ Swig_MethodToFunction(Node *n, String *classname, int flags) {
}
SwigType_add_pointer(type);
p = NewParm(type,"self");
Setattr(p,"self","1");
Setattr(p,"hidden","1");
/*
Disable the 'this' ownership in 'self' to manage inplace
@ -1111,6 +1112,7 @@ Swig_DestructorToFunction(Node *n, String *classname, int cplus, int flags)
type = NewString(classname);
SwigType_add_pointer(type);
p = NewParm(type,"self");
Setattr(p,"self","1");
Setattr(p,"wrap:disown","1");
Delete(type);
type = NewString("void");
@ -1190,6 +1192,7 @@ Swig_MembersetToFunction(Node *n, String *classname, int flags) {
t = NewString(classname);
SwigType_add_pointer(t);
parms = NewParm(t,"self");
Setattr(parms,"self","1");
Delete(t);
ty = Swig_wrapped_var_type(type);
@ -1273,6 +1276,7 @@ Swig_MembergetToFunction(Node *n, String *classname, int flags) {
t = NewString(classname);
SwigType_add_pointer(t);
parms = NewParm(t,"self");
Setattr(parms,"self","1");
Delete(t);
ty = Swig_wrapped_var_type(type);

View file

@ -68,6 +68,7 @@ Parm *CopyParm(Parm *p) {
String *alttype = Getattr(p,"alttype");
String *byname = Getattr(p, "arg:byname");
String *compactdefargs = Getattr(p, "compactdefargs");
String *self = Getattr(p, "self");
if (t) {
SwigType *nt = Copy(t);
@ -109,6 +110,11 @@ Parm *CopyParm(Parm *p) {
Setattr(np, "compactdefargs", str);
Delete(str);
}
if (self) {
String *str = Copy(self);
Setattr(np, "self", str);
Delete(str);
}
Setfile(np,Getfile(p));
Setline(np,Getline(p));