Xrtti is a tool and accompanying C++ library which extends the
standard runtime type system of C++ to provide a much richer set of
reflection information about classes and methods to manipulate these
classes and their members.
It is intended to provide a much more complete set of reflection
capabilities to C++ than the standard C++ rtti feature.
I have released the first public version of this tool, version 0.1,
under the GNU GPLv2, and would welcome feedback on it.
Xrtti is at: http://www.ischo.com/xrtti
Thank you, and best wishes,
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] , On May 1, 5:50 pm, Mathias Gaunard wrote:
> Wouldn't compile-time reflection be more than enough
> Is there really a need for that kind of reflection at runtime
I am sure that some creative people can think of useful things to do
with this kind of enhanced runtime reflection. I have thought of a
- Write a tool that allows one to "script" C++; if you linked this
tool into your program, it would use the reflection information
presented by Xrtti to let you via a command line interface, create
objects, call methods on them, change values, etc. Not sure exactly
what kind of program could take full advantage of this kind of
capability but it is interesting.
- Some kind of automated testing support If you can call any method
on any class via reflection, you could write a library that supported
some kind of automated testing by walking the tree of classes in your
program and instantiating objects, calling methods on them, etc.
- You can serialize and deserialize instances of any class you define,
via a single library that uses the extended runtime type information
to walk over the data members of your classes.
In fact, the last one is the reason that I wrote Xrtti; I had written
a tool that adds serialization support to all of your classes "for
free", without any changes necessary to your class definitions (unlike
other C++ serialization systems that I have seen, such as
Boost::Serialization and s11n, which just provide frameworks to assist
you in serializing your objects, but you still have to write the
I then realized that this could be done more cleanly in two parts: 1)
a tool that generates extended runtime type information, and 2) a
serializer library that operates on this information. I assumed that
since I found something useful to do with (1), others may think of
other interesting things to do with it as well.
VIEWS ON THIS POST
Wednesday 7th November 2012