Re: [C++-sig] Py++ - problem withsplit_moduleandreturn_opaque_pointer-policy
-----Original Message----- From: Ganssauge, Gottfried Sent: Monday, September 25, 2006 12:39 PM To: 'Development of Python/C++ integration' Subject: RE: [C++-sig] Py++ - problem withsplit_moduleandreturn_opaque_pointer-policy ...
Also you don't have to add BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID macro To be exact: I _must_ not add ...
Py++ will generate one. Indeed. It works quite nice :-) One grain of salt though: Py++ will happily generate more than one if there are several functions returning the same opaque pointer type. This leads to a compilation error: redefinition of 'boost::python::type_info boost::python::type_id() [with T = <opaque pointee type>] In the following test the generated file test_opaque_free_functions.pypp.cpp will contain two instantiations of BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID( opaque_ ).
test.hpp ---8><---><8--- typedef struct opaque_ *opaque_pointer; opaque_pointer get_opaque(); opaque_pointer get2_opaque(); ---8><---><8--- test.py: ---8><---><8--- import os from pyplusplus import module_builder from pyplusplus.decl_wrappers import \ return_value_policy, \ return_opaque_pointer mb = module_builder.module_builder_t( ["test.hpp"] ) mb.free_function (name = "get_opaque").call_policies = \ return_value_policy (return_opaque_pointer) mb.free_function (name = "get2_opaque").call_policies = \ return_value_policy (return_opaque_pointer) mb.build_code_creator( module_name='test_opaque' ) mb.split_module( '.' ) ---8><---><8--- Cheers, Gottfried
-- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ _______________________________________________ C++-sig mailing list C++-sig@python.org http://mail.python.org/mailman/listinfo/c++-sig
On 9/26/06, Ganssauge, Gottfried <Gottfried.Ganssauge@haufe.de> wrote:
One grain of salt though:
I just commited the fix to the repository. Can you try it? ( You need to update multiple_files.py only ) -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/
-----Original Message----- From: c++-sig-bounces@python.org [mailto:c++-sig-bounces@python.org] On Behalf Of Roman Yakovenko Sent: Tuesday, September 26, 2006 10:52 AM To: Development of Python/C++ integration Subject: Re: [C++-sig] Py++ - problemwithsplit_moduleandreturn_opaque_pointer-policy
On 9/26/06, Ganssauge, Gottfried <Gottfried.Ganssauge@haufe.de> wrote:
One grain of salt though:
I just commited the fix to the repository. Can you try it? ( You need to update multiple_files.py only ) Brilliant! It works.
Thanks, Gottfried
-- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ _______________________________________________ C++-sig mailing list C++-sig@python.org http://mail.python.org/mailman/listinfo/c++-sig
participants (2)
-
Ganssauge, Gottfried -
Roman Yakovenko