aboutsummaryrefslogtreecommitdiff
path: root/Lib/java/swigmove.i
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/java/swigmove.i')
-rw-r--r--Lib/java/swigmove.i16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/java/swigmove.i b/Lib/java/swigmove.i
new file mode 100644
index 000000000..671b988af
--- /dev/null
+++ b/Lib/java/swigmove.i
@@ -0,0 +1,16 @@
+/* -----------------------------------------------------------------------------
+ * swigmove.i
+ *
+ * Input typemaps library for implementing full move semantics when passing
+ * parameters by value.
+ * ----------------------------------------------------------------------------- */
+
+%typemap(in) SWIGTYPE MOVE ($&1_type argp)
+%{ argp = *($&1_ltype*)&$input;
+ if (!argp) {
+ SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type");
+ return $null;
+ }
+ SwigValueWrapper< $1_ltype >::reset($1, argp); %}
+
+%typemap(javain) SWIGTYPE MOVE "$&javaclassname.swigRelease($javainput)"