|
[Newbie]:swig wrappers for bootstrapped classes: msg#00183programming.swig
Sharma K M writes: > In a swig interface file (sample.i), I need to have > the code similar to the following. To understand the > scenario, please go through the comments also: > =========sample.i============= > .... > .... > class x > { > .... > } > > %extend x > { > y __getitem__(...) /* since class y is defined later, I get the error*/ > { > return y(self, ...); > } > } > %inline > %{ > .... > class y [ snip ] If you are going to do something like this, I strongly recommend declaring "y" before you use it as a typename. For example: %{ class y; %} class x { }; %extend x { y __getitem__(...) { ... } }; This is almost certainly part of the problem (as "y" is used in the wrapper code before it is defined). -- Dave _______________________________________________ Swig maillist - Swig@xxxxxxxxxxxxxxx http://mailman.cs.uchicago.edu/mailman/listinfo/swig |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: typemaps for python lists (double,int) as function arguments: 00183, Luigi Ballabio |
|---|---|
| Next by Date: | AW: typemaps for python lists (double,int) as function arguments: 00183, Marcus Stojek |
| Previous by Thread: | [Newbie]:swig wrappers for bootstrapped classesi: 00183, Sharma K M |
| Next by Thread: | __swig__slots__ on shadowed Python classes?: 00183, Lars Immisch |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |