Re: [pygccxml-development] special functions/operators
Brought to you by:
mbaas,
roman_yakovenko
From: Neal B. <ndb...@gm...> - 2006-08-29 15:59:33
|
On Monday 28 August 2006 9:22 am, Roman Yakovenko wrote: > On 8/28/06, Matthias Baas <ba...@ir...> wrote: > > Roman Yakovenko wrote: > > >> We can indeed use cdef for this, but it's rather low level. I wonder > > >> if we > > >> can make a better api for this, maybe something like: > > >> > > >> add_method (...) > > > > > > You and Matthias are solving different problems. > > > Matthias generates new function from the script and than adds it to the > > > class. > > > > Well, not only. In my Maya bindings I'm also doing the same thing as > > Neal, i.e. I have manually written C++ functions that I add as methods > > to some classes using cdef(). > > It does not different from what I say. You did not feed the > declarations to Py++. > > > > You already have function declaration, and the only thing you want to > > > do is to associate it > > > with the class. I think it will take only few hours to implement what > > > you are asking for. > > > > > > cls = mb.class_("X") > > > f = mb.free_function( "addAssign" ) > > > cls.add_method( f ) > > I don't understand all of what you guys said, but it sounds like this is what I had in mind. f = mb.free_function ("addAssign") what is "free_function"? Is this new or already existing? cls.add_method (f) sounds right. I guess need to be able to set some properties on it as well. Usual stuff. |