Re: [pygccxml-development] Basic Py++ questions
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2008-10-28 19:15:20
|
On Tue, Oct 28, 2008 at 3:27 PM, Paul Melis <pa...@sc...> wrote: > Hello Roman, > > Thanks for your help so far! You are welcome. > I have a few beginners questions w.r.t. Py++: > - When selecting a class with the class_() method how intelligent is the > matching? Well, it is able to do few things. >Does it do purely a string match on the argument you provide, > or does it actually parse the argument and go from there? Neither. Parsing is error prone approach. You can take a look on it: http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pygccxml_dev/pygccxml/declarations/matchers.py?revision=1428&view=markup search for declaration_matcher_t class > I.e. I can > write for example class_('::mynamespace::C'), class_('mynamespace::C') > or class_('C'). Will these match different classes? The first and the last examples could match the different classes. This depends on flags you pass to the method. If you use class_ method, you will get exception. I am not sure about the second example. I guess it will not match any class, but I could be wrong. I suggest you to take a look on the following document: http://language-binding.net/pygccxml/query_interface.html > - I get warnings (W1005) during code generation about methods/functions > using instances of non-public classes, with the message that the > generated code will not compile :) Is there a way to automatically > disable generation of method wrappers that use non-public classes? Yes. Py++ warnings are explained here: http://language-binding.net/pyplusplus/documentation/warnings.html Basically you can check why declarations is not exportable : <<untested>> from pyplusplus import messages f = <<<some function>>> if not f.exportable and f.why_not_exportable().identifier == messages.W1005: f.exclude() > - Finally, if I .exclude() a certain class it seems that this doesn't > propagate into excluding all methods/functions using that class (related > to the previous question)? You mean you have class A{}; and some function f( A& ) and excluding A, doesn't exclude f, right? If so, Py++ doesn't do it for performance\memory reasons. Now, when I think about it, it should be easy to add to the class_t new function - "exclude_me_and_references_to_me" ( better name is needed ) which will does exactly what you want. We can use "i_depend_on_them" functionality. HTH -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |