|
Re: Next SWIG release: msg#00168programming.swig
Hi, another way to reduce code size (which, I think, is also documented in the manual) is to replace: %typemap(in) Foo { // read $input (a PyObject*) and use the info in // order to build $1 (a Foo). Typically, the code // spans quite a few lines which are reinserted in // the wrappers every time a Foo is passed. } with: %{ void convertFoo(PyObject* input, Foo& f) { // put the conversion code here so that // it is only written once } %} %typemap(in) Foo { convertFoo($input,&$1); // just one repeated line now } I don't think it would be easy to have SWIG produce the above automatically (right, Dave?) but it can be done manually. Bye, Luigi _______________________________________________ Swig maillist - Swig@xxxxxxxxxxxxxxx http://mailman.cs.uchicago.edu/mailman/listinfo/swig |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Next SWIG release: 00168, art yerkes |
|---|---|
| Next by Date: | RE: Next SWIG release: 00168, Jeremy Slade |
| Previous by Thread: | Re: Next SWIG releasei: 00168, art yerkes |
| Next by Thread: | Returning values from pointer args with SWIG + TCL: 00168, Eyal Raab |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |