feature:interface ported to Java
This commit is contained in:
parent
50685b512f
commit
766d55255b
7 changed files with 442 additions and 38 deletions
26
Lib/csharp/feature_interface.i
Normal file
26
Lib/csharp/feature_interface.i
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
%define DECLARE_INTERFACE_(CTYPE, INTERFACE, IMPL)
|
||||
%feature("interface", name = "INTERFACE", cptr = "GetCPtr") CTYPE;
|
||||
%typemap(cstype) CTYPE*, const CTYPE& "INTERFACE"
|
||||
%typemap(csdirectorout) CTYPE*, const CTYPE& "$cscall.GetCPtr()"
|
||||
%typemap(csdirectorin) CTYPE*, const CTYPE&
|
||||
%{
|
||||
(INTERFACE)new IMPL($iminput,false)
|
||||
%}
|
||||
%typemap(csin) CTYPE*, const CTYPE& "$csinput.GetCPtr()"
|
||||
%typemap(csout, excode=SWIGEXCODE) CTYPE*, const CTYPE&
|
||||
{
|
||||
IMPL ret = new IMPL($imcall,true);
|
||||
$excode
|
||||
return (INTERFACE)ret;
|
||||
}
|
||||
%enddef
|
||||
|
||||
%define DECLARE_INTERFACE_RENAME(CTYPE, INTERFACE, IMPL)
|
||||
%rename (IMPL) CTYPE;
|
||||
DECLARE_INTERFACE_(CTYPE, INTERFACE, IMPL)
|
||||
%enddef
|
||||
|
||||
%define DECLARE_INTERFACE(CTYPE, INTERFACE)
|
||||
DECLARE_INTERFACE_(CTYPE, INTERFACE, CTYPE)
|
||||
%enddef
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue