Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2004-11-09 15:29:06


> I'd prefer a way of storing the type information for each reflectable
> class statically, and in a generic way, e.g. something like
> std::map<std::string, property>. This would enable the reflection
> code could be decoupled from the reflected classes entirely and just
> operate on this property meta-data. It would also allow client code
> to lookup individual properties (e.g. by name) instead of having to
> visit all of them.
>

Not sure if I understood you correctly, but if I did, why not do this:

// define globals in a source file

// etc.
reflected_property r1(&window::get_enabled, &window::set_enabled,
"enabled");
reflected_property r2(&window::get_visible, &window::set_visible,
"visible");

Best,
John

-- 
John Torjo,    Contributing editor, C/C++ Users Journal
-- "Win32 GUI Generics" -- generics & GUI do mix, after all
-- http://www.torjo.com/win32gui/
-- v1.5 - tooltips at your fingertips (work for menus too!)
    + bitmap buttons (work for MessageBox too!)
    + tab dialogs, hyper links, lite html

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk