Adding new data to registered types

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Adding new data to registered types

Willi Schinmeyer

I'm currently working on automatic documentation generation for the
functions and classes exported by luabind. I've written a function that
returns information on a given Lua value if it's a Luabind class or
function. (If you're interested, this is the function: 
) So far I can get all important information on functions (i.e.
signatures & name) and the name of classes.

Most logic happens in Lua (and it's a little messy...), I basically
recursively walk through everything starting at the globals to find
everything while build the correct names (the ones stored in luabind
don't include namespaces) and replace those names in the function
signatures. (Again, here's the code, if you're interested: 

I still need to read out information regarding class inheritance and all
the members and functions of classes, but I'm pretty sure I can figure
that out.

But I need help with this: I'd like to add a new property to the
binding, an (optional) description of a class/method/member/function. So
I suppose I'd create a new policy for that and I have no idea how they
work. Basically, I want to be able to write something like this:

luabind::def("f", &f, luabind::description_policy("A simple example

which would result in the function_object(_impl) of a function or the
class_rep of a class or their equivalent for properties getting a
description set which I can then query in my function.

I'd appreciate any advice on that.

So long,
Willi Schinmeyer

For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
luabind-user mailing list
[hidden email]