- explicitcall feature removed.
- Instead of using the swig_up flag in each director method (Python, Ruby, Ocaml) to indicate whether the explicit C++ call to the appropriate base class method or a normal polymorphic C++ call should be made, the new approach makes one of these calls directly from the wrapper method. - Java/C# recursive director method calls fixed (no need for explicitcall feature to solve this now) git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9275 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a19cc4444e
commit
f0d1d772fa
12 changed files with 355 additions and 303 deletions
|
|
@ -394,26 +394,15 @@ void emit_action(Node *n, Wrapper *f) {
|
|||
action = Getattr(n,"wrap:action");
|
||||
assert(action != 0);
|
||||
|
||||
if (!(is_public(n)) && is_member_director(n)) {
|
||||
/* We need to add an extra dynamic_cast to
|
||||
access the director class, where the virtual
|
||||
methods are all public */
|
||||
if (!is_public(n) && (is_member_director(n) || GetFlag(n, "explicitcall"))) {
|
||||
/* In order to call protected virtual director methods from the target language, we need
|
||||
* to add an extra dynamic_cast to call the public C++ wrapper in the director class. */
|
||||
Node* parent = Getattr(n,"parentNode");
|
||||
String* symname = Getattr(parent, "sym:name");
|
||||
String* dirname = NewStringf("SwigDirector_%s", symname);
|
||||
String* dirdecl = NewStringf("%s *darg = 0", dirname);
|
||||
Wrapper_add_local(f, "darg", dirdecl);
|
||||
Printf(f->code, "darg = dynamic_cast<%s *>(arg1);\n",dirname);
|
||||
Replace(action, "arg1", "darg", DOH_REPLACE_FIRST);
|
||||
if (Getattr(n,"qualifier")) {
|
||||
/* fix constant casting introduced by a const method decl */
|
||||
String* classtype = Getattr(parent, "classtype");
|
||||
/*
|
||||
String *ccast = NewStringf("((%s const *)darg)",classtype);
|
||||
if (Strstr(action,ccast) != 0)
|
||||
*/
|
||||
Replace(action, classtype, dirname, DOH_REPLACE_FIRST);
|
||||
}
|
||||
Delete(dirname);
|
||||
Delete(dirdecl);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue