Roman Yakovenko schrieb am Dienstag 20 Januar 2009 um 06:59:
> Maik, for some reason your message was bounced.
Yikes! I don't use SF mailing lists a lot, but I guess it was to long.
> Boost.Python don't like such structs - it cannot track the memory
> usage reliably.
> You also force your users to be aware of the memory management issue (
> keep LookupTable alive, until LookupTables class instance is alive )
The generated bindings are for testing purposes only. Having python gives me
numpy, matplotlib and vtk/tvtk.
The data I'm passing around reaches the limits of 32Bit memory machines, so I
decided to sacrifice the ease use to some extend.
> > There are three problems:
> > 1.
> > The wrapper ctors are trouble. It's default construct breaks compilation,
> > because there is no way it can proper initialize the members of the
> > Refer. Refer lacks the ctor to do this (by intention, see above).
> > Wrapping isn't an option AFAICT.
>
> Obviously this is a bug. I will check it against current SVN ( both
> gccxml and Py++ ).
Thanks for taking care
> > 2. The call policies for the __init__(self) are not altered
>
> You have a bug in the relevant code:
> > defctor = foo.operator(arg_types=[None])
>
> defctor = foo.find_trivial_constructor()
> if defctor:
> ....
I'll check it
> > === regarding 3. ===
> > So far I didn't get how class_t.add_fake_constructors works. This
> > function takes a calldef_t as argument. If I inject code via
> > mb.add_declaration_code mb.free_function('make_refer') doesn't work
> > because gccxml newer saw the code. Any hints how to construct a calldef_t
> > after gccxml ran?
>
> You don't. Tweaking declarations tree is not a good idea.
Roger
> > As a workaround I added the code to the parsed header file and did
> > mb.class_('Refer').add_fake_constructors(mb.free_function('make_refer'))
> > which results in
> > {{{
> > File
> > "/usr/lib/python2.6/site-packages/pyplusplus/decl_wrappers/class_wrapper.
> >py", line 210, in add_fake_constructors self._fake_constructors.add( f )
> > AttributeError: 'list' object has no attribute 'add
> > }}}
>
> This is a bug, which I fixed right now. Thanks for reporting.
> It seems that I always used\tested the other path :-).
Well, there are downsides of dynamic languages as well ;) I don't wanna miss
the static nature of C++, if its appropriate.
> > I know doing mb.class_('Refer').exclude() and creating the wrapper code
> > from the information in mb.class_('Refer') works (I did this for template
> > class template member member functions), but I wonder what are the other
> > means to teach py++ what I want.
>
> I am going to play with your example, stay turned :-)
Thank you Roman!
-- Maik
> P.S. Please format a little the code, so it could be easier to read. Thanks
The Mail in my output folder is all formatted. The bouncer must have removed
the leading whitespace. I can send you the mail again off list, if you like
to.
Next time this happens, please refuse to read the mail and ask for the proper
version(i.e. off-list). This is what I would have done. You are awesome :)
|