From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2004-11-09 09:38:35
On Mon, 8 Nov 2004 19:18:13 -0500, Edward Diener
> The one area where C++ is weaker than other languages for design time UI,
> and component, development is in its lack of a general run-time reflection
> mechanism. That is the only area which I see that is holding it back.
I've been toying with using the properties library Reece Dunn recently
submitted (in the boost-sandbox CVS) for this purpose. I've got
something very sketchy, but it relies on a visitor pattern to "pass"
type information to client code in a manner similar to Boost.Variant.
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.
I'm stumped by how to store this information in any sort of container
though, since the properties are of different types. Any thoughts, or
is this madness?
-- Caleb Epstein caleb.epstein_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk