For implementing full move semantics when passing parameters by value. Based on SWIGTYPE && and std::unique_ptr typemaps which implement move semantics. Added for all languages, but untested for: Go, Ocaml, R, Scilab (and unlikely to be fully functional for same reasons as for std::unique_ptr support). Issue #999
16 lines
631 B
OpenEdge ABL
16 lines
631 B
OpenEdge ABL
/* -----------------------------------------------------------------------------
|
|
* 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)"
|