Mirror reflection library 0.5.13

Wait, you have to register everyting manually? That sucks.

Well, not really and not really. First, the registering macros make the whole process semi-automatic. Many things like member variable types, etc. can be deduced and the quick registering macros make the process even more convenient. Also a portable tool for automated registering is being worked on.

Furthermore, the fact that the registering is manual gives the user much more control over the results, than fully automatic reflection without any means for tweaking would. Just suppose that the user wants to reflect a class that has except regular member variables that have some meaning for the clients of that class also some internal data for caching to increase performance. For most purposes, like serialization, presentation of the instances to the application user, manipulation by an software agent, etc. the programmer probably would like to hide such internal data, and this is what manual registering makes possible. It let's you choose what is and what is not reflected, in cases where it is desirable.

In a similar fashion it is possible to hide constructors or member functions that are for some reason public, but you do not want them be used by the factories, generated by the factory generator or function callers generated by the invoker generator.

Manual registering also allows to tie getter and setter functions to a member variable. All tools built on top of the meta-object reflecting that member variable get and set the value via these member functions which may have additional side effects compared to just reading or changing the value of the variable. Let's suppose that you have a set of geometric shapes that are rendered by the aplication. Every time some property of the shape like border width, style, color, fill pattern, etc. changes you would like the object to redraw itself or have the engine redraw it. This is usually done by implementing setter functions that besides changing of the value of the property also invoke a update procedure. If the reflection system was not aware of this, a manipulator based on the reflected data would not trigger the update.


Copyright © 2006-2011 Matus Chochlik, University of Zilina, Zilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Fri Dec 16 2011 by Doxygen (version 1.7.3).
Important note: Although the 'boostified' version of Mirror uses the Boost C++ libraries Coding Guidelines and is implemented inside of the boost namespace, it IS NOT an officially reviewed and accepted Boost library. Mirror is being developed with the intention to be submitted for review for inclusion to the Boost C++ libraries.