From: William S F. <ws...@fu...> - 2012-10-30 19:31:20
|
It is checked in on trunk in a very recent commit, just check the logs. William On 29/10/12 21:01, Eric Cabot wrote: > Oh that's great ! > > Just today I found a need for this named %typemap(directorout) ! > > Do you think I could have the code/patch so I can start using it ? > > Thanks a lot William ! > > ÉC > -----Original Message----- > From: William S Fulton [mailto:ws...@fu...] > Sent: Saturday, October 27, 2012 3:44 PM > To: eri...@vi... > Cc: swi...@li... > Subject: Re: [Swig-user] Re : Re: Re : Re: How can I specify different typemaps depending on the method being wrapped ? > > Post processing the wrappers isn't really the recommended strategy as it indicates something wrong in SWIG. In this case it is a bug and I have fixed it for swig-2.0.9 so that named 'directorout' typemaps are found during the typemap search. Hence they now behave the same as named 'out' > typemaps. > > William > > On 05/09/12 18:06, eri...@vi... wrote: >> The "copy, sed, patches" strategy is actually the strategy that I was >> about to deploy after all in my environment so I'm really happy to see >> it's in line with the recommended strategy. >> But being able to specify the method name in the %typemap would just >> have been much simpler to deploy in my situation so I wanted to see >> first if this was possible. >> But if it's not possible then I will go with the full solution. >> Thanks ! >> ----- Message d'origine ----- >> De: Marvin Greenberg <pub...@gm...> >> Date: Mercredi, 5 Septembre 2012, 12:38 pm >> Objet: Re: Re : Re: [Swig-user] How can I specify different typemaps >> depending on the method being wrapped ? >> À: eri...@vi... >> Cc: William S Fulton <ws...@fu...>, >> "swi...@li..." <swi...@li...> >> >> > On 12/Sep/5 11:52 AM, eri...@vi... wrote: >> > >Thank you guys for your feedback. >> > >You are right Marvin the %typemap(out) seems to support a > >> signature like "MyType MyClass::MyFunction" but effectively the > >> %typemap(directorout) seems not. >> > >But even if it did there are still other cases where I don't > >> know how to specify the method name. >> > >For instance consider the following two methods of the same class. >> > >int foo1( Type value ); >> > >int foo2( Type value ); >> > >Say I want to apply a different "%typemap(in) Type" to each > >> method how can I do this with the argument name being the same ? >> > >BTW in my case I cannot write an interface file so I'm stuck > >> with doing a %include of the original C++ .h file that has those > >> two methods. >> > > >> > Hmm. Although you say you are stuck including the original > .h >> file, obviously you are not. You could copy it, run it > through sed, >> apply patches, etc. >> > >> > If you look at the documentation section "5.7 An interface > >> building strategy", and especially "5.7.3 Why use separate > >> interface files" it recommends that you write separate interface > >> files. We're doing fairly complicated stuff with swig, > wrapping >> static and generated c++ APIs, and we use separate > interface files >> to give us control over exactly how parts of the > wrappers get >> generated. So you COULD rename, from your example, > > int foo1(Type >> special_arg); > int foo2(Type special_arg); > int foo3(Type >> plain_arg); > > And then "in" typemaps to apply differently would be >> possible. >> > Note my extension of the example -- by rewriting the argument > >> names, the interface itself now is self-documenting at when you > are >> using the different typemaps. >> > > > > ------------------------------------------------------------------------------ > WINDOWS 8 is here. > Millions of people. Your app in 30 days. > Visit The Windows 8 Center at Sourceforge for all your go to resources. > http://windows8center.sourceforge.net/ > join-generation-app-and-make-money-coding-fast/ > _______________________________________________ > Swig-user mailing list > Swi...@li... > https://lists.sourceforge.net/lists/listinfo/swig-user > |