Cosmetic formatting and doc updates in std_unique_ptr.i files
This commit is contained in:
parent
50fc600e8c
commit
5dd5e80a84
5 changed files with 48 additions and 41 deletions
|
|
@ -1,10 +1,11 @@
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* std_unique_ptr.i
|
* std_unique_ptr.i
|
||||||
*
|
*
|
||||||
* The typemaps here allow handling functions returning std::unique_ptr<>,
|
* SWIG library file for handling std::unique_ptr.
|
||||||
* which is the most common use of this type. If you have functions taking it
|
* Memory ownership is passed from the std::unique_ptr C++ layer to the proxy
|
||||||
* as parameter, these typemaps can't be used for them and you need to do
|
* class when returning a std::unique_ptr from a function.
|
||||||
* something else (e.g. use shared_ptr<> which SWIG supports fully).
|
* Memory ownership is passed from the proxy class to the std::unique_ptr in the
|
||||||
|
* C++ layer when passed as a parameter to a wrapped function.
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
%define %unique_ptr(TYPE)
|
%define %unique_ptr(TYPE)
|
||||||
|
|
@ -18,16 +19,18 @@
|
||||||
%typemap(csin) std::unique_ptr< TYPE > "$typemap(cstype, TYPE).swigRelease($csinput)"
|
%typemap(csin) std::unique_ptr< TYPE > "$typemap(cstype, TYPE).swigRelease($csinput)"
|
||||||
|
|
||||||
%typemap (out) std::unique_ptr< TYPE > %{
|
%typemap (out) std::unique_ptr< TYPE > %{
|
||||||
$result = (void *)$1.release();
|
$result = (void *)$1.release();
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%typemap(csout, excode=SWIGEXCODE) std::unique_ptr< TYPE > {
|
%typemap(csout, excode=SWIGEXCODE) std::unique_ptr< TYPE > {
|
||||||
System.IntPtr cPtr = $imcall;
|
System.IntPtr cPtr = $imcall;
|
||||||
$typemap(cstype, TYPE) ret = (cPtr == System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
|
$typemap(cstype, TYPE) ret = (cPtr == System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
%template() std::unique_ptr< TYPE >;
|
%template() std::unique_ptr< TYPE >;
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
template <class T> class unique_ptr {};
|
template <class T> class unique_ptr {};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* std_unique_ptr.i
|
* std_unique_ptr.i
|
||||||
*
|
*
|
||||||
* The typemaps here allow handling functions returning std::unique_ptr<>,
|
* SWIG library file for handling std::unique_ptr.
|
||||||
* which is the most common use of this type. If you have functions taking it
|
* Memory ownership is passed from the std::unique_ptr C++ layer to the proxy
|
||||||
* as parameter, these typemaps can't be used for them and you need to do
|
* class when returning a std::unique_ptr from a function.
|
||||||
* something else (e.g. use shared_ptr<> which SWIG supports fully).
|
* Memory ownership is passed from the proxy class to the std::unique_ptr in the
|
||||||
|
* C++ layer when passed as a parameter to a wrapped function.
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
%define %unique_ptr(TYPE)
|
%define %unique_ptr(TYPE)
|
||||||
|
|
@ -20,19 +21,19 @@
|
||||||
%typemap(javain) std::unique_ptr< TYPE > "$typemap(jstype, TYPE).swigRelease($javainput)"
|
%typemap(javain) std::unique_ptr< TYPE > "$typemap(jstype, TYPE).swigRelease($javainput)"
|
||||||
|
|
||||||
%typemap (out) std::unique_ptr< TYPE > %{
|
%typemap (out) std::unique_ptr< TYPE > %{
|
||||||
jlong lpp = 0;
|
jlong lpp = 0;
|
||||||
*(TYPE **) &lpp = $1.release();
|
*(TYPE **) &lpp = $1.release();
|
||||||
$result = lpp;
|
$result = lpp;
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%typemap(javaout) std::unique_ptr< TYPE > {
|
%typemap(javaout) std::unique_ptr< TYPE > {
|
||||||
long cPtr = $jnicall;
|
long cPtr = $jnicall;
|
||||||
return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true);
|
return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
%template() std::unique_ptr< TYPE >;
|
%template() std::unique_ptr< TYPE >;
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
template <class T> class unique_ptr {};
|
template <class T> class unique_ptr {};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* std_unique_ptr.i
|
* std_unique_ptr.i
|
||||||
*
|
*
|
||||||
* The typemaps here allow handling functions returning std::unique_ptr<>,
|
* SWIG library file for handling std::unique_ptr.
|
||||||
* which is the most common use of this type. If you have functions taking it
|
* Memory ownership is passed from the std::unique_ptr C++ layer to the proxy
|
||||||
* as parameter, these typemaps can't be used for them and you need to do
|
* class when returning a std::unique_ptr from a function.
|
||||||
* something else (e.g. use shared_ptr<> which SWIG supports fully).
|
* Memory ownership is passed from the proxy class to the std::unique_ptr in the
|
||||||
|
* C++ layer when passed as a parameter to a wrapped function.
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
%define %unique_ptr(TYPE)
|
%define %unique_ptr(TYPE)
|
||||||
|
|
@ -21,12 +22,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap (out) std::unique_ptr< TYPE > %{
|
%typemap (out) std::unique_ptr< TYPE > %{
|
||||||
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
|
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%template() std::unique_ptr< TYPE >;
|
%template() std::unique_ptr< TYPE >;
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
template <class T> class unique_ptr {};
|
template <class T> class unique_ptr {};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* std_unique_ptr.i
|
* std_unique_ptr.i
|
||||||
*
|
*
|
||||||
* The typemaps here allow handling functions returning std::unique_ptr<>,
|
* SWIG library file for handling std::unique_ptr.
|
||||||
* which is the most common use of this type. If you have functions taking it
|
* Memory ownership is passed from the std::unique_ptr C++ layer to the proxy
|
||||||
* as parameter, these typemaps can't be used for them and you need to do
|
* class when returning a std::unique_ptr from a function.
|
||||||
* something else (e.g. use shared_ptr<> which SWIG supports fully).
|
* Memory ownership is passed from the proxy class to the std::unique_ptr in the
|
||||||
|
* C++ layer when passed as a parameter to a wrapped function.
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
%define %unique_ptr(TYPE)
|
%define %unique_ptr(TYPE)
|
||||||
|
|
@ -21,12 +22,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap (out) std::unique_ptr< TYPE > %{
|
%typemap (out) std::unique_ptr< TYPE > %{
|
||||||
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
|
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%template() std::unique_ptr< TYPE >;
|
%template() std::unique_ptr< TYPE >;
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
template <class T> class unique_ptr {};
|
template <class T> class unique_ptr {};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* std_unique_ptr.i
|
* std_unique_ptr.i
|
||||||
*
|
*
|
||||||
* The typemaps here allow handling functions returning std::unique_ptr<>,
|
* SWIG library file for handling std::unique_ptr.
|
||||||
* which is the most common use of this type. If you have functions taking it
|
* Memory ownership is passed from the std::unique_ptr C++ layer to the proxy
|
||||||
* as parameter, these typemaps can't be used for them and you need to do
|
* class when returning a std::unique_ptr from a function.
|
||||||
* something else (e.g. use shared_ptr<> which SWIG supports fully).
|
* Memory ownership is passed from the proxy class to the std::unique_ptr in the
|
||||||
|
* C++ layer when passed as a parameter to a wrapped function.
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
%define %unique_ptr(TYPE)
|
%define %unique_ptr(TYPE)
|
||||||
|
|
@ -21,12 +22,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap (out) std::unique_ptr< TYPE > %{
|
%typemap (out) std::unique_ptr< TYPE > %{
|
||||||
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
|
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%template() std::unique_ptr< TYPE >;
|
%template() std::unique_ptr< TYPE >;
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
template <class T> class unique_ptr {};
|
template <class T> class unique_ptr {};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue