Director typemap cleanup and return by value

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4989 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Mark Rose 2003-08-11 02:38:45 +00:00
commit ce452b8b8d
2 changed files with 13 additions and 9 deletions

View file

@ -1,5 +1,9 @@
Version 1.3.20 (In progress) Version 1.3.20 (In progress)
============================ ============================
08/10/2003: mrose (Mark Rose)
Added a director typemap (outv) for return by value and cleaned up up a few
of the commented director typemaps.
08/10/2003: mrose (Mark Rose) 08/10/2003: mrose (Mark Rose)
Fixed constructor generation for director classes to ignore private Fixed constructor generation for director classes to ignore private
constructors. Protected constructors are also ignored for now, pending constructors. Protected constructors are also ignored for now, pending

View file

@ -453,12 +453,11 @@
%typemap(inv, parse="O") PyObject* ""; %typemap(inv, parse="O") PyObject* "";
/*
%typemap(inv, parse="s") SWIGTYPE { /* // this is rather dangerous
%typemap(inv) SWIGTYPE {
{ {
$&1_ltype resultptr; $input = SWIG_NewPointerObj((void *) &$1_name, $&1_descriptor, $owner);
resultptr = new $1_ltype(($1_ltype &) $1);
$result = SWIG_NewPointerObj((void *) resultptr, $&1_descriptor, 1);
} }
} }
*/ */
@ -480,13 +479,11 @@
} }
*/ */
/* /* // not currently needed, see python.cxx
%typemap(inv, parse="s") void "0";
*/
/*
%typemap(inv) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] { %typemap(inv) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
$input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, $owner); $input = SWIG_NewPointerObj((void *) $1_name, $1_descriptor, $owner);
} }
%typemap(inv, parse="s") void "0";
*/ */
@ -518,6 +515,9 @@ OUTV_TYPEMAP(bool, PyInt_AsLong);
OUTV_TYPEMAP(PyObject *, ); OUTV_TYPEMAP(PyObject *, );
OUTV_TYPEMAP(char *, PyString_AsString); OUTV_TYPEMAP(char *, PyString_AsString);
/* Object returned by value. Convert from a pointer */
%typemap(outv) SWIGTYPE ($&ltype argp)
"if ((SWIG_ConvertPtr($input,(void **) &argp, $&descriptor,SWIG_POINTER_EXCEPTION | $disown )) == -1) throw SWIG_DIRECTOR_TYPE_MISMATCH(\"Pointer conversion failed.\"); $result = *argp;";
%typemap(outv) SWIGTYPE *, %typemap(outv) SWIGTYPE *,
SWIGTYPE &, SWIGTYPE &,