Mirror reflection library - Lagoon run-time layer 0.5.13

Mirror C++ reflection library - Lagoon run-time layer

lagoon.png

Copyright © 2006-2011 Matus Chochlik.

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

This is a reference manual generated by Doxygen, for the Lagoon run-time layer, which is part of the Mirror reflection library.

Other resources and documentation for Mirror and the related libraries and utilities can also be found on the project home page.

Lagoon is a run-time layer which is built on top of the compile-time meta-objects implemented by Mirror and provides a polymorphic interface for these meta-objects. This means that once a base-level object (namespace, class, class member, etc.) is registered with Mirror it is also reflectible by Lagoon.

While the compile-time facilities implemented by Mirror provide meta-data usable in meta-programs which can generate efficient program code, the nature of this meta-data is inherently static. There are however situations, where one needs to use the meta-data in a dynamic manner dependent on other data available only at run-time. One might for example want to traverse the set of class' member variables and find the one searched for by the user or satisfying a predicate based on run-time input. While this can be achieved even with the static meta-objects provided by Mirror (as proved by the fact that the Lagoon layer is built on top of them), the compile-time interface makes it difficult and is not very suitable for such tasks.

Thus the interfaces and their implementations defined by the Lagoon layer provide basically the same meta-data as Mirror does. The difference is, that everywhere Mirror requires doing a traversal of meta-objects by a compile-time generic algorithm, Lagoon allows to traverse them in a run-time loop. Furthermore the interfaces which Lagoon defines for the Mirror's concepts use run-time polymorphism (i.e. virtual functions) with all its virtues (and drawbacks). This means that the different meta-objects reflecting different base-level objects can be accessed via a single interface type. The main drawback is the performance penalty induced by virtual function calls and the inability of the compiler to inline such calls in many cases.

The decision whether to use Mirror or Lagoon should therefore be based on application-specific factors (as performance, source code size, simplicity of application code, tasks performed by the applications, etc.).


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.