From: Eric C. <Eri...@au...> - 2012-09-26 20:21:54
|
I would like everything to be generated as usual except C# version of my class member function. e.g.: C++ class MyClass { public: void foo(); }; I want to keep this function generated by swig in _wrap.cxx: SWIGEXPORT void SWIGSTDCALL CSharp_MyClass_foo(void * jarg1 ) { MyClass *arg1 = (MyClass *)jarg1; try { arg1->foo(); } catch(const std::exception &err) { SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, err.what()); } } I want to keep this code generated by swig in _PINVOKE.cs: [DllImport("MyModule", EntryPoint = " CSharp_MyClass_foo ")] public static extern void MyClass_foo(HandleRef jarg1); But I dont want this function generated by swig in MyClass.cs: public partial class MyClass { ... public void foo() { MyModulePINVOKE.MyClass_foo(swigCPtr); if (MyModulePINVOKE.SWIGPendingException.Pending) throw MyModulePINVOKE.SWIGPendingException.Retrieve(); } } because I will write this one myself in a separate file. I cannot use -noproxy because it's only for this method that I want to ignore the C# part ÉC From: Nadig Nikil [mailto:ni...@qr...] Sent: Wednesday, September 26, 2012 1:51 AM To: Eric Cabot; swi...@li... Subject: RE: [Swig-user] how can I avoid the proxy function to be created Do you mean the low-level functional interface? Try the -noproxy switch swig -csharp -noproxy .... From: Eric Cabot [mailto:Eri...@au...] Sent: Wednesday, September 26, 2012 1:14 PM To: swi...@li...<mailto:swi...@li...> Subject: [Swig-user] how can I avoid the proxy function to be created Context: porting C++ to C# I have a class member function in C++ that I want to wrap but I don't want the C# version. That is, I want the wrapped function in C++ in the file _wrap.cxx and the PINVOKE stuff but I don't want the C# function to be created. Thanks |