Re: [pygccxml-development] Printing declarations...
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2006-03-20 10:24:10
|
On 3/20/06, Matthias Baas <ba...@ir...> wrote:
> Roman Yakovenko wrote:
> >> typedef double (::MVector::*bracket_op)(unsigned int i) const;
> >>
> >> and then rewrite the above as
> >>
> >> MVector_exposer.def( "__call__"
> >> , (bracket_op)(&MVector::operator())
> >> , ( bp::arg("i") )
> >> , bp::default_call_policies() );
> >>
> >> then it compiles fine. Could this scheme be incorporated in pyplusplus=
?
> >
> > Yes. I need it also for template functions too. Do you think we need to
> > implement this before release or after?
>
> Whenever you have some time you can spend on it. In the above case, the
> call operator is not that important, so I can wait.
I took a look and it seems, that I need 3 - 4 hours to fix the
problem, may be less.
So, I will wait with this a little.
> > Also, untill I add this code to pyplusplus and you don't have an other
> > operator ()
> > on MVector you can set create_with_signature to false.
>
> I didn't notice a difference in the generated code....?
I think this is because you have an other overload, right?
> >> Almost, the signature is there but the actual method name is missing.
> >
> > Okay, I give up :-). I understand what you want, but I don't
> > understand the format.
>
> The more it resembles the original source code the better. I'm dumping
> the declarations into a log file that the user can inspect. For example,
> he could just grep for a particular function name to find out what
> decorations have been applied to that function.
> > Also, why do you need this from framework. You have all tools to
> > create almost any format by your own?
>
> Well, yes, but it seems that recreating the source code doesn't look
> that easy to me (and I don't know how much of the original source code
> (which could be reused here) has survived in the output from gccxml).
> When I have some time left I can have a look at it. Would you like the
> idea to add __str__() methods to the declaration_t classes? (then a user
> could just print a declaration and see exactly what it is)
Before you do it, please ask your self next questions:
1. What is the difference between output of decl_printer_t?
2. Why we need 2 implementation of __str__ methods
3. is decl_printer_t should be implemented in terms of __str__ method, or m=
ay be
__str__ method should be implemented in terms of decl_printer_t
4. How you configure the a amount of printed information.
I would like to see the answers to those question, after this, I think
we will have
better understanding of what you are actually want. I think we do add
__str__ method
to declarations, but I need to know the rule.
Thanks
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|