I pulled down your bazaar branch and merged it with my own changes (I
need to use the container methods, inplace numeric operators, and
numeric operators with built in python types, so I have to keep using
my changes for now), and now reference parameters are working just
fine. Great!
Since the code I'm binding has probably thousands of reference
parameters to expose, I've written little helper methods as shorthand
for the long parameter definition. This is probably a little
specialized for what you want, but it might be helpful to include
something like these (akin to the "param" method you already have in
utils):
def refparam(cppobj, argname):
return Parameter.new("%s&" % cppobj, argname,
direction=Parameter.DIRECTION_INOUT)
def constrefparam(cppobj, argname):
return Parameter.new(ref("const %s&" % cppobj), argname,
direction=Parameter.DIRECTION_INOUT)
So on those changes I have for the pybindgen code (allowing the stuff
I mention above), I'd be happy to modify them to fit in better with
how you want pybindgen to look if you'd like to give me an idea what
you're looking for.
On Jun 30, 2009, at 6:29 AM, Gustavo Carneiro wrote:
Ah, right. The thing is, the code tries to make a copy of the
object to give to the python wrapper in case it appears the python
code kept a reference to the wrapper.
I need to fix pybindgen to, if the class has no copy constructor
keep the wrapper->obj pointer NULL instead of giving it a copy.
The fix has been pushed to the bazaar branch. See https://
code.launchpad.net/~gjc/pybindgen/trunk
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig