Mirror library description
Mirror C++ reflection library
Mirror library's goal is to provide both compile-time and run-time meta-data describing common C++ constructs like namespaces, types (and as an important special case typedef-ined types), classes and their base classes and member variables, constructors, 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, the main drawback of this library is, that namespace, 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 several tools for automatic / semi-automatic registering are 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.
Mirror provides a compile-time reflection layer which can be used in compile-time meta-programs and a run-time layer with a similar, but dynamic interface based on the compile-time meta-data.
Here are some key features of "Mirror library":
- Static and dynamic reflectionf the following base-level language constructs:
- namespaces [static / dynamic ]
- types [static / dynamic ]
- typedefs [static ]
- classes [static / dynamic ]
- class templates [static ]
- Static and dynamic range based traversalsf:
- namespace members like nested namespaces, classes, typedefs, templates, etc. [static / dynamic ]
- class inheritance including the inheritance type specifier, access specifier, the derived and the base class in the inheritance [static / dynamic ]
- class member variables providing information about the storage class specifier, access specifier, scope, type and namef the member variable [static / dynamic ]
- all class member variables including those inherited from base classes [static / dynamic ]
- class member functions static / dynamic ]
- constructors [static / dynamic ]
- conversionperators [static / dynamic ]
- template parameters [static / dynamic ]
- function parameters including the type and the namef the parameter [static / dynamic ]
- The factory generator utility
- *ther compile-time meta-programming utilities
- Name getter functions for all named language constructs like namespaces, types (including derived types like pointers, references, arrays, functions, CV-qualified types and combinations thereof), typedefs, member variables, etc.
- base names without the nested name specifiers [static / dynamic ]
- full names with the nested name specifiers [static / dynamic ]
- local namesf nested named constructs which can have partsf the full nested name specifier stripped away basedn the usef the Mirror's using directiven the global scoper the local scopes [static / dynamic ]
- generic name getter allowing to choose the character typef the returned string
- Generic functions for getting and setting the valuef a class member variable when given a reference to the class to which the member variable belongs.
- Meta-object reflection , categorization and tag dispatching. Tag types for different meta-objects can be used in compile-time functionverloadr template specialization dispatching and meta-object tag enumerations in run-time branching basedn the typef the meta-object.
- Higher-level utilities basedn the basic meta-data:
- Factory generators allowing to easily create highly customizable, specialized factory classes which gather the necessary parameter values, pick and call the appropriate constructor in a user specified way (from a GUI, from a RDB dataset, from an XML file, etc.) to create instancesf a specified type.
- Annotationf meta-objects with tag types. Various metabjects (currentlynly types) can be tagged by pre-definedr application-specific tag types which can be used in meta-programs for the triggeringf specialized processing.
- Support for compile-time container reflection was added.
- The meta_object_kind template for more flexible meta-object categorization was added.
- Several bugs and pedantic warnings were fixed.
- The documentation has been updated.
- Other minor changes were made.