Re: [pygccxml-development] Tag for Methods to bind ?
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2008-07-07 18:22:54
|
On Mon, Jul 7, 2008 at 9:14 PM, Ben Schleimer <bsc...@lu...> wrote:
> I had this same idea. Instead of putting the annotations inside the
> comments,
> I made Qt style macros which I prepended to my function/enum/field
> declarations.
>
> Something like
> META_CLASS() class A {
> META_METHOD() APtr create();
>
> // No annotations before this one so it isn't exposed
> float * getInternals();
>
> ....
> }
>
> The macros turn into __attribute((gccxml("META_XXX")));
> when a preprocessor flag is defined and turns into nothing otherwise.
> The cool thing is that you can have additional annotations work by
> using macro inlining... I can't find the code anymore but it did work...
You are right, this is another valid option.
Every declarations contains "attributes" property wchih gives you
access to them (
http://language-binding.net/pyplusplus/documentation/apidocs/pygccxml.declarations.declaration.declaration_t-class.html#attributes
)
This approach has speed advantage and it is less error prone.
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|