Re: [pygccxml-development] Help needed with embedding
Brought to you by:
mbaas,
roman_yakovenko
From: Berserker <ber...@ho...> - 2009-08-04 11:02:43
|
> Did you implement "allow_threads"? If yes, can you publish it and some > usage example? > If not, I guess you thought about it, right ? Do you mind to share > your thoughts? > > This is an interesting question, and may be you should take it to > Boost.Python mailing list. Whatever solution the list will come with, > it will be possible to integrate it with Py++. I don't understand why do you think that this question should be posted in the Boost.Python mailing list. "allow_threads" is just the code extracted from http://libtorrent.svn.sourceforge.net/viewvc/libtorrent/trunk/bindings/python/src/gil.hpp?revision=2460&view=markup , maybe a property like "adaptor" or "visitor" for each Py++ function would do the work, but I'm not so skilled with the Py++ API and probably there are other better solutions, btw something like: > tm = foo_class.mem_fun( 'test_method' ) > tm.adaptor = "my_adaptor" and then Py++ will create: > boost::python::class_< Foo >("Foo") > .def("test_method_1", my_adaptor(&Foo::test_method_1)) Another solution (probably more "clean") could be a list of Templates for each boost::python API (boost::python::class_::def, boost::python::class_::add_property ecc...) so that we can customize them, what about? > Yes: http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/pyplusplus/function_transformers/templates.py?revision=1467&view=markup > > The short version: if you applied a transformation, than everything > should be done in it. > > The long version: you can modify the templates so it will release the > GIL. You can do it without changing Py++ code. Thanks, that was useful! Btw I have to change the "whole template" and pay attention to keep it aligned in the next releases of Py++ (that's ok for the moment), what about adding $pre_call and $post_call params as in the "default" Template? > > Here it is the link http://osiris.kodeware.net/ if you are interested :) > > :-). Very cool project. Thanks :) _________________________________________________________________ Messenger è su Hotmail. Scopri le novità. http://www.messenger.it/accediWebMessengerHotmail.aspx |