Re: [pygccxml-development] Parameter passing, ownership semantics
Brought to you by:
mbaas,
roman_yakovenko
From: Gustavo C. <gjc...@gm...> - 2007-02-18 22:20:49
|
On 2/18/07, Roman Yakovenko <rom...@gm...> wrote: > > On 2/18/07, Gustavo Carneiro <gjc...@gm...> wrote: > > On 2/18/07, Roman Yakovenko <rom...@gm...> wrote: > > > I committed new function transformation: transfer ownership. The > > documentation > > > will come later. For usage example take a look on unittests: > > > ( look for "transfer_ownership" ) > > > > > > http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/unittests/function_transformations_tester.py?view=markup > > > > > > http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/unittests/data/function_transformations_to_be_exported.hpp?view=markup > > > > Thanks! > > > > Unfortunately the generated code does not compile when I try to use > that > > feature: > > > > default/bindings/python/__call_policies.pypp.hpp:14:58: > > error: boost/python/suite/indexing/iterator_range.hpp: No > > such file or directory > > default/bindings/python/__call_policies.pypp.hpp:172: > > error: 'pyplusplus::call_policies::bpl::indexing' has not > > been declared > > default/bindings/python/__call_policies.pypp.hpp:172: > > error: ISO C++ forbids declaration of 'iterator_range' with no type > > default/bindings/python/__call_policies.pypp.hpp:172: > > error: typedef name may not be a nested-name-specifier > > default/bindings/python/__call_policies.pypp.hpp:172: > > error: expected ';' before '<' token > > [...etc...] > > > > From "boost/python/suite/indexing/iterator_range.hpp: No > > such file or directory", does this sound like I need to get a newer > > boost::python library or something? > > Something like that. Boost.Python, out of the box, comes with little > support > to STL containers. To make the long story short you have to install new > indexing > suite that comes with Py++: > ( > http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/indexing_suite_v2/ > ) > > Here you will find more information about new indexing suite > http://language-binding.net/pyplusplus/documentation/containers.html. Thanks. After much effort to rebuilt a patched boost library, it now compiles fine. However, the methods that are affected by the transformation (Schedule*) are receiving some kind of name mangling: >>> dir(ns3.Simulator) ['Now', 'Run', 'ScheduleDestroy_126390ccfc1f22f22289536ea47d3ecb', 'ScheduleNow_3692da707df52052648f9d5435d958c4', 'Schedule_fbf096d706be19b392c1e3fbcd3bf544', 'Stop', '__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__'] Bug? -- Gustavo J. A. M. Carneiro "The universe is always one step beyond logic." |