diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2013-01-24 19:44:27 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2013-01-24 20:27:28 +0000 |
commit | 0734fa050de474ee4c90908c58be387c4b59e544 (patch) | |
tree | cd085b3669e139650348605cf0313741f2750e54 /Lib/modula3 | |
parent | e87a51ed92891e4f518fc3dcb32288cfe869a43a (diff) | |
download | swig-0734fa050de474ee4c90908c58be387c4b59e544.tar.gz |
Add rvalue reference typemaps
Diffstat (limited to 'Lib/modula3')
-rw-r--r-- | Lib/modula3/modula3.swg | 51 |
1 files changed, 41 insertions, 10 deletions
diff --git a/Lib/modula3/modula3.swg b/Lib/modula3/modula3.swg index 3affdd0de..262f8ead4 100644 --- a/Lib/modula3/modula3.swg +++ b/Lib/modula3/modula3.swg @@ -344,6 +344,23 @@ %typemap(m3wrapouttype) SWIGTYPE & "$1_basetype" %typemap(m3wraprettype) SWIGTYPE & "UNTRACED REF $1_basetype" +%typemap(ctype) SWIGTYPE && "$1_type" +%typemap(m3rawtype) const SWIGTYPE && "UNTRACED REF $1_basetype" +%typemap(m3rawtype) SWIGTYPE && "UNTRACED REF $1_basetype" +%typemap(m3rawintype) const SWIGTYPE && "$1_basetype" +%typemap(m3rawinmode) const SWIGTYPE && "READONLY" +%typemap(m3rawintype) SWIGTYPE && "$1_basetype" +%typemap(m3rawinmode) SWIGTYPE && "VAR" +%typemap(m3rawrettype) const SWIGTYPE && "UNTRACED REF $1_basetype" +%typemap(m3rawrettype) SWIGTYPE && "UNTRACED REF $1_basetype" +%typemap(m3wraptype) SWIGTYPE && "$1_basetype" +%typemap(m3wrapintype) const SWIGTYPE && "$1_basetype" +%typemap(m3wrapinmode) const SWIGTYPE && "READONLY" +%typemap(m3wrapintype) SWIGTYPE && "$1_basetype" +%typemap(m3wrapinmode) SWIGTYPE && "VAR" +%typemap(m3wrapouttype) SWIGTYPE && "$1_basetype" +%typemap(m3wraprettype) SWIGTYPE && "UNTRACED REF $1_basetype" + %typemap(ctype) enum SWIGTYPE "$1_type" %typemap(m3rawtype) enum SWIGTYPE "C.int" %typemap(m3rawintype) enum SWIGTYPE "C.int (* $1_type *)" @@ -468,7 +485,12 @@ $1 = &temp; %} //SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); RETURN $null; } %} -%typemap(out) SWIGTYPE *, SWIGTYPE &, SWIGTYPE (CLASS::*) %{ *($&1_ltype)&$result = $1; %} +%typemap(in) SWIGTYPE && %{ $1 = *($&1_ltype)&$input; + if(!$1) { + //SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); + RETURN $null; + } %} +%typemap(out) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE (CLASS::*) %{ *($&1_ltype)&$result = $1; %} /* Default array handling */ @@ -552,6 +574,7 @@ $1 = &temp; %} SWIGTYPE, SWIGTYPE *, SWIGTYPE &, + SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" @@ -605,7 +628,7 @@ $1 = &temp; %} enum SWIGTYPE "$input" %typemap(m3in) SWIGTYPE "$&*1_type.getCPtr($input)" -%typemap(m3in) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "$1_basetype.getCPtr($input)" +%typemap(m3in) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "$1_basetype.getCPtr($input)" /* The m3out typemap is used for converting function return types from the return type * used in the PInvoke class to the type returned by the proxy, module or type wrapper class. */ @@ -636,13 +659,16 @@ $1 = &temp; %} %typemap(m3out) SWIGTYPE & %{ RETURN NEW($1_basetype, $imcall, $owner); %} +%typemap(m3out) SWIGTYPE && %{ + RETURN NEW($1_basetype, $imcall, $owner); +%} %typemap(m3out) SWIGTYPE *, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ cPtr := $imcall; RETURN (cPtr = IntPtr.Zero) ? null : NEW($1_basetype, cPtr, $owner); %} /* Properties */ -%typemap(m3varin) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ +%typemap(m3varin) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ PROCEDURE Set$var (value: $vartype) = BEGIN $imcall; @@ -684,6 +710,10 @@ PROCEDURE Get$var (): $vartype = get { RETURN new $1_basetype($imcall, $owner); } %} +%typemap(m3varout) SWIGTYPE && %{ + get { + RETURN new $1_basetype($imcall, $owner); + } %} %typemap(m3varout) SWIGTYPE *, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ get { IntPtr cPtr = $imcall; @@ -691,13 +721,13 @@ PROCEDURE Get$var (): $vartype = } %} /* Typemaps used for the generation of proxy and type wrapper class code */ -%typemap(m3base) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(m3classmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "public" -%typemap(m3code) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(m3imports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "using System;" +%typemap(m3base) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" +%typemap(m3classmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "public" +%typemap(m3code) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" +%typemap(m3imports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "using System;" %typemap(m3interfaces) SWIGTYPE "IDisposable" -%typemap(m3interfaces_derived) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" -%typemap(m3ptrconstructormodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "internal" +%typemap(m3interfaces_derived) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" +%typemap(m3ptrconstructormodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) "internal" %typemap(m3finalize) SWIGTYPE %{ ~$1_basetype() { @@ -724,7 +754,7 @@ PROCEDURE Get$var (): $vartype = base.Dispose(); } -%typemap(m3getcptr) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ +%typemap(m3getcptr) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ internal static IntPtr getCPtr($1_basetype obj) { RETURN (obj == null) ? IntPtr.Zero : obj.swigCPtr; } @@ -748,6 +778,7 @@ FROM BlaBla IMPORT Bla; /* Array reference typemaps */ %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } +%apply SWIGTYPE && { SWIGTYPE ((&&)[ANY]) } /* const pointers */ %apply SWIGTYPE * { SWIGTYPE *const } |