Mirror C++ reflection utilities

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)



Important
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 into the Boost C++ libraries.
Note
Mirror is currently in development and so is this web site and the documentation.

Introduction

The aim of the Mirror library is to provide both compile-time and run-time meta-data describing C++ constructs like namespaces, types typedef-ined types, enums, classes with their base classes, member variables, constructors, member functions, etc. and to provide uniform and generic interfaces for their introspection.

Because standard C++ provides only a very limited set of meta-information to build upon, a potential drawback of this library is, that namespaces, types, classes, etc. need to be registered before they can be reflected. However Mirror tries to make the process of registering simple by providing a set of user-friendly registering macros and has the native and many of the other common types, classes, templates and namespaces pre-registered. Furthermore, a portable tool for automatic / semi-automatic registering is being worked on. Once registered the meta-data can be reused in a large number of situations.

Mirror is designed with the principle of stratification in mind and tries to be as less intrusive as possible. New or existing classes do not need to be designed to directly support Mirror and no Mirror-related code is necessary in the class' definition, as far as some general guidelines are followed. This allows you to do reflection even on third-party code that you cannot modify.

Features

  • Reusability: The meta-data provided by Mirror is reusable in many situations and for many different purposes.
  • Flexibility: Mirror and the additional layers built on top of it allow to access the provided meta-data both at compile-time and run-time in a functional and object-oriented manner depending on the application needs.
  • Encapsulation: Mirror and the additional layers provide interfaces for easy access to program meta-data.
  • Stratification: Mirror is non-intrusive and separates the meta-level from the base-level constructs it reflects.
  • Ontological correspondence: The meta-level facilities correspond to the ontology of the base-level C++ language constructs which they reflect.
  • Completeness: Mirror tries to provide as much useful meta-data as possible, including various specifiers, iteration of namespace members and much more.
  • Ease of use: Although Mirror allows to do very complicated reflective (meta-)programming, simple things are kept simple.
  • Cooperation with other librares: Mirror can be used with the introspection facilites provided by the standard library and other libraries.

Components

The Mirror suite consists of the following components:

C++ libraries

Mirror
A compile-time reflective meta-programming library. Suitable for generic meta-programming similar for example to the standard type_traits library. Allows to write compile-time meta-programs which can generate efficient program code based on the meta-data provided by reflection.
Puddle
A compile-time object-ish layer, with some run-time features, built on top of Mirror. Simplifies the compile-time reflective programming.
Rubber
A type-erasure utility for Mirror's meta-objects and specifiers.
Lagoon
A polymorphic object-oriented run-time layer built on top of Mirror. Suitable for run-time reflective programming.

Utilities

MAuReEn
An external command-line tool which can generate the Mirror's registering code automatically from a set of C++ input files, usually headers.

Documentation and related documents

Download

Packaged releases (Mirror)

The current and the previous releases of the packaged sources of Mirror (with Puddle and Lagoon) can be downloaded from Sourceforge at the following url: http://sourceforge.net/projects/mirror-lib/files/. The latest releases can alternatively also be downloaded from here.

Packaged releases (MAuReEn)

The current and the previous releases of the packaged sources of MAuReEn can be downloaded from here.

Git repository (Mirror)

Git users can get anonymous read-only access to the source repository by using the following command: git clone git://mirror-lib.git.sourceforge.net/gitroot/mirror-lib/mirror-lib

Git repository (MAuReEn)

Anonymous read-only access to the (MAuReEn's) source repository can be obtained by using the following command: git clone git://gitorious.org/maureen/maureen.git

Supported compilers

Mirror does not use any compiler-specific extensions and should be usable with any compiler implementing the C++11 features. It has been tested and is currently known to work with the following compilers:

Requirements and dependencies

Mirror currently does not have any external dependencies besides the (C++11) standard library (with the exception of several tools listed below, which are however, not required for the use of the main features of the library).

History

This version of the Mirror library is a major rewrite of a previous version which has been developed in C++98 since April 2008 (available in the Boost Sandbox [svn.boost.org]). The new (C++11) version draws from more than one and half year of user experience with the previous version and is in development since September 2009.



Ohloh Statistics


Copyright © 2006-2011 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<chochlik -at -gmail.com>
<matus.chochlik -at- fri.uniza.sk>