Re: [pygccxml-development] Feature request: Creating thread safe methods
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-08-02 10:48:13
|
On 8/2/06, Matthias Baas <ba...@ir...> wrote: > Roman Yakovenko wrote: > > Please take a look on decl_wrappers.constructor_t class. It has "body" > > property. > > I think, all you need to implement the feature is similar property on > > member_function_t > > class. Actually you will need 2 properties: > > 1. body > > 2. default_virtual_body ( better name is desired ). > > > > Or something like this. If those properties contain a text, pyplusplus > > will use it > > as function body, otherwise it will generate the body. > > Will the "body" attribute then replace the entire function body? (what > about the signature?) Will replace the body, but will leave the signature. > But then I wouldn't gain anything. I do this more > or less already since I ignore the original declaration and replace it > with my own one (circumventing pyplusplus). > The point is that a user then has to know the code that pyplusplus would > create so that he can add that code to his own version, too. But I would > prefer if a user could only concentrate on his new code that he wants to > insert and leave everything else alone (i.e. the code that pyplusplus > already generates). I understand your preferences. I will not implement this. If you will need one, it is a matter of few hours to add it. > >> Yes, I know. I suppose, eventually we have to find a better name (but I > >> think "call wrapper policy" also doesn't really capture it...) > > > > Function transform policies? > > Hm, I don't know, I don't regard the addition of code as a > transformation and the added code doesn't have to implement a policy. > How can we concisely describe "an object that is a building block for > wrapper functions" or "a specialized partial code creator for wrapper > functions" or....? Consider to take one step back. There is some C++ function, that could not be called from Python. You need to create another function, that could be called from Python, that will call the original function. If you don't call the original function, than you just create new function and register it under some C++ function name. So, in some sense you do transform one function to another. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |