Moving the director protected member support to the top level. Now it should works in all the languages. Test it.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5498 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2003-12-07 23:00:02 +00:00
commit 7bbbe3b274
8 changed files with 88 additions and 34 deletions

View file

@ -12,7 +12,6 @@
char cvsroot_python_cxx[] = "$Header$";
#include "swigmod.h"
#include "utils.h"
#ifndef MACSWIG
#include "swigconfig.h"
@ -67,11 +66,8 @@ Python Options (available with -python)\n\
-apply - Use apply() in proxy classes\n\
-new_repr - Use more informative version of __repr__ in proxy classes\n\
-noexcept - No automatic exception handling\n\
-nodirprot - Don't wrap director protected members\n\
-noproxy - Don't generate proxy classes \n\n";
extern void Wrapper_director_protected_mode_set(int);
class PYTHON : public Language {
public:
@ -83,8 +79,6 @@ public:
SWIG_library_directory("python");
Wrapper_director_protected_mode_set(1);
for (int i = 1; i < argc; i++) {
if (argv[i]) {
if(strcmp(argv[i],"-interface") == 0) {
@ -128,8 +122,6 @@ public:
classic = 0;
modern = 1;
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-nodirprot") == 0) {
Wrapper_director_protected_mode_set(0);
} else if (strcmp(argv[i],"-help") == 0) {
fputs(usage,stderr);
} else if (strcmp (argv[i], "-ldflags") == 0) {
@ -1313,13 +1305,7 @@ public:
Wrapper_add_local(w, "result", "PyObject *result");
/* direct call to superclass if _up is set */
if (is_protected(n)) {
Printf(w->code, "PyObject *obj = PyObject_GetAttrString(swig_get_self(), \"%s\");\n",
Getattr(n,"sym:name"));
Printf(w->code, "if (!obj) {\n");
} else {
Printf(w->code, "if (swig_get_up()) {\n");
}
Printf(w->code, "if (swig_get_up()) {\n");
if (pure_virtual) {
Printf(w->code, "throw Swig::DirectorPureVirtualException();\n");
} else {