PyBindGen trunk now has support for boost::shared_ptr. It's really simple to use, you just register a C++ class with a "memory policy" parameter of type pybindgen.cppclass.BoostSharedPtr. From then on, the C++ class is wrapped in a Python object structure containing a boost::shared_ptr object instead of a raw pointer, and type handlers for boost::shared_ptr are registered instead of MyClasss*. Enjoy. Here's an example:
http://bazaar.launchpad.net/~gjc/pybindgen/trunk/files/head:/examples/boost_shared_ptr/
P.S.: I am looking for an engineering job near London, I have great Python and C++ skills *hint* ;-)
http://bazaar.launchpad.net/~gjc/pybindgen/trunk/files/head:/examples/boost_shared_ptr/
P.S.: I am looking for an engineering job near London, I have great Python and C++ skills *hint* ;-)
No comments:
Post a Comment