Director testcase cosmetic fixes
This commit is contained in:
parent
05badeb1a4
commit
98e67539dd
3 changed files with 34 additions and 5 deletions
|
|
@ -10,14 +10,14 @@
|
|||
|
||||
%inline %{
|
||||
struct C {
|
||||
C() : m(1) {};
|
||||
C(int n) : m(n) {};
|
||||
int get_m() { return m; };
|
||||
C() : m(1) {}
|
||||
C(int n) : m(n) {}
|
||||
int get_m() { return m; }
|
||||
int m;
|
||||
};
|
||||
|
||||
struct Base {
|
||||
Base() {};
|
||||
Base() {}
|
||||
virtual boost::shared_ptr<C> ret_c_shared_ptr() = 0;
|
||||
virtual C ret_c_by_value() = 0;
|
||||
virtual int take_c_by_value(C c) = 0;
|
||||
|
|
|
|||
|
|
@ -156,6 +156,10 @@
|
|||
CPTR_VISIBILITY static long getCPtr($javaclassname obj) {
|
||||
return (obj == null) ? 0 : obj.swigCPtr;
|
||||
}
|
||||
|
||||
CPTR_VISIBILITY void swigSetCMemOwn(boolean own) {
|
||||
swigCMemOwn = own;
|
||||
}
|
||||
%}
|
||||
|
||||
// Derived proxy classes
|
||||
|
|
@ -172,6 +176,11 @@
|
|||
CPTR_VISIBILITY static long getCPtr($javaclassname obj) {
|
||||
return (obj == null) ? 0 : obj.swigCPtr;
|
||||
}
|
||||
|
||||
CPTR_VISIBILITY void swigSetCMemOwn(boolean own) {
|
||||
swigCMemOwnDerived = own;
|
||||
super.swigSetCMemOwn(own);
|
||||
}
|
||||
%}
|
||||
|
||||
%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") TYPE {
|
||||
|
|
@ -195,6 +204,26 @@
|
|||
super.delete();
|
||||
}
|
||||
|
||||
%typemap(directordisconnect, methodname="swigDirectorDisconnect") TYPE %{
|
||||
protected void $methodname() {
|
||||
swigSetCMemOwn(false);
|
||||
$jnicall;
|
||||
}
|
||||
%}
|
||||
|
||||
%typemap(directorowner_release, methodname="swigReleaseOwnership") TYPE %{
|
||||
public void $methodname() {
|
||||
swigSetCMemOwn(false);
|
||||
$jnicall;
|
||||
}
|
||||
%}
|
||||
|
||||
%typemap(directorowner_take, methodname="swigTakeOwnership") TYPE %{
|
||||
public void $methodname() {
|
||||
swigSetCMemOwn(true);
|
||||
$jnicall;
|
||||
}
|
||||
%}
|
||||
|
||||
%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >;
|
||||
%enddef
|
||||
|
|
|
|||
|
|
@ -1260,7 +1260,7 @@ SWIG_JAVABODY_TYPEWRAPPER(protected, protected, protected, SWIGTYPE)
|
|||
*/
|
||||
|
||||
%define SWIG_PROXY_CONSTRUCTOR(OWNERSHIP, WEAKREF, TYPENAME...)
|
||||
%typemap(javaconstruct,directorconnect="\n $imclassname.$javaclazznamedirector_connect(this, swigCPtr, swigCMemOwn, WEAKREF);") TYPENAME {
|
||||
%typemap(javaconstruct,directorconnect="\n $imclassname.$javaclazznamedirector_connect(this, swigCPtr, OWNERSHIP, WEAKREF);") TYPENAME {
|
||||
this($imcall, OWNERSHIP);$directorconnect
|
||||
}
|
||||
%enddef
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue