
On Tue, Dec 6, 2011 at 2:40 AM, jinhua luo <ljh.home.king@gmail.com> wrote:
Hi,
Hi,
In brief, I'd designed and implemented somehow C++ class reflection based on boost libraries.
Did you have a look at the Mirror reflection utilities ?
It has some unique advantages: a) it doesn't require code generator
Good, but it is not so unique
b) platform independent and compiler independent (I tested it on Windows and Linux, with vs2008 and gcc respectively)
Nice,
c) it's non-intrusive for the class definition, instead, you just need to declare and describe your class via some straightforward macros anywhere (header file or source file, and may be within any namespace), which also means you can wrap an external third-party library (which you have no way to touch the source codes) and reflects it classes.
This is not unique either
d) Cross shared library boundary, you can dynamic load the shared library and reflect the classes within it, without need to export any symbol manunally in C wrapper function way
I believe (and I have some expertise in using and implementing reflection in C++ to base that belief upon) that the basic reflection should compile-time and any run-time reflection should be built on top of that.
e) the API looks like Java reflection API
I don't think that this is a good idea, and I've seen several (scientific) papers where people don't think it either. BR Matus