Re: [pygccxml-development] Tag for Methods to bind ?
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2008-07-07 18:18:21
|
On Mon, Jul 7, 2008 at 3:06 PM, Damien Fagnou <dam...@mo...> wrote: > Hi , > > we are thinking of using py++ to create binding to one of our libraries . > this is quite a large one 100+ class . py++ look like its doing what we > need and initial test are very promising . :-) > one of our idea was to be able to explicitly 'tag' the methods/class to > export . > I though we might use a tag in the doxygen comments . but I can't really > see if that is possible > there is the extract_doc scheme , would there be a way to filter class > and methods based on doxygen docs ? It is possible. Take a look on this file: http://python-ogre.svn.sourceforge.net/viewvc/python-ogre/trunk/python-ogre/code_generators/common_utils/extract_documentation.py?view=markup Python-Ogre project uses it to extract doxygen style documentation from the Ogre3d source code and embed it into Python objects. So they will have the documentation. After you updated the declarations with documentation you can use it ( untested ): mb = module_builder_t() mb.global_ns.decls().exclude() mb.global_ns.decls( lambda d: '/// BINDABLE' in d.documentation ).include() //class includes everything under it, so we need to run exclude mb.global_ns.decls( lambda d: '/// this class is not accessible from python' in d.documentation ).exclude() > one other way we though was to run doxygen using xml out , sparse the > result and extract a list of class and methods from there. but the 2 > step workflow is not as nice and doxygen doesn't use the same parser ( > I think .. ) > > example : > > /// base class for particle > /// BINDABLE > class A > { > /// creation methode > /// BINDABLE > APtr create() > > /// this class is not accessible from python > float * getInternals(); Take a look on return_range call policy, it provides solution for such API http://language-binding.net/pyplusplus/documentation/functions/call_policies.html#return-range > in any case thanks a lot for py++ it look like its gonna save us a lot > of time ! Thank you! P.S. In Russian we say "не говори гоп пока не перепрыгнешь", I guess the English variant is "Do not boast until you see the enemy dead". :-))) -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |