Roman Yakovenko wrote:
> On Thu, Jun 24, 2010 at 1:49 PM, Benoit Leveau
> <ben...@mo...> wrote:
>> Benoit Leveau wrote:
>
> I am really sorry for late response - few issues in production :-(
no problem, and I don't consider a response within 24h as late ;)
>>> Here is an extract of my class (complete test case attached)
>>> --
>>> class Foo
>>> {
>>> ...
>>> protected:
>>> template< typename T > void method_( std::vector< T > &vec );
>>> };
>
>
> py++ contains work around for the issue you have.
>
> You will have to change the function name:
>
> mb = module_builder_t( ... )
> f = mb.mem_fun( ... )
> f.name = f.demangled_name
>
> mb.run_query_optimizer()
>
>
> Description. GCCXML, when reports found function declarations, reports
> name only. py++ (via pygccxml) uses "mangled" function name and tries
> to extract the relevant information. The approach is an error prone
> and I don't have enough use case, to make it to be the "default"
> behavior.
>
> After you change the function name, you will have to re-initialize the
> "query optimizer". Query optimizer allows py++ to find declaration
> very quickly. A declaration name is one of the important keys in its
> data structure.
ok thanks for the explanation!
As i said in my additional note, I don't really have to fix this problem as I'm supposed to exclude these methods in the first place, but
thanks for the explanation!
Also, I'm curious. If I call rename(new_name) at some point on some class declarations, do I need to call the run_query_optimizer too? Can it affect the generated code if I don't do it?
>> Additional note:
>> I'm excluding the protected/private functions from the binding so this bug shouldn't bother me,
>> but because of the other bug I reported (caused by the readme() call), these protected functions are not excluded as they should,
>> so the compilation error appears.
>
> :-(((
I've just implemented an easy workaround which creates one module_builder.module_builder_t, extracts all the readme strings into a dict, then deletes this module_builder_t
and creates a new one to do all the binding. When I want to access a readme string, I just use the dict instead.
> May I suggest you something? Can you create a single file, which
> includes all other files and pass it to py++?
> The proposed mode has few advantages, over the current one:
> * much faster
> * doesn't contain known bugs :-)
>
> Can you try to switch to it?
I'm already using this approach (don't exactly remember why but I had to at some point), ie. I dynamically creates a temporary file which #include all the header files I want to bind.
|