Mirror

A C++ library to help you with your development.
Download

Mirror Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware / $0.00
  • Language:
  • English
  • Publisher Name:
  • Imagine Interactive Systems
  • File Size:
  • 350K

Mirror Tags


Mirror Description

Provides both compile-time and run-time meta-data describing common C++ constructs The aim of the Mirror library 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. Features: * Static and dynamic reflection of the following base-level language constructs: o namespaces o types o typedefs o classes o class templates * Static and dynamic range based traversals of: o namespace members like nested namespaces, classes, typedefs, templates, etc. o class inheritance including the inheritance type specifier, access specifier, the derived and the base class in the inheritance o class member variables providing information about the storage class specifier, access specifier, scope, type and name of the member variable o all class member variables including those inherited from base classes o class member functions static / dynamic ] o constructors o conversion operators o template parameters o function parameters including the type and the name of the parameter * The factory generator utility * Other 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. o base names without the nested name specifiers o full names with the nested name specifiers o local names of nested named constructs which can have parts of the full nested name specifier stripped away based on the use of the Mirror's using directive on the global scope or the local scopes * Generic functions for getting and setting the value of 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 function overload or template specialization dispatching and meta-object tag enumerations in run-time branching based on the type of the meta-object. * Higher-level utilities based on the basic meta-data: o 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 instances of a specified type. * Annotation of meta-objects with tag types. Various meta objects (currently only types) can be tagged by pre-defined or application-specific tag types which can be used in meta-programs for the triggering of specialized processing. Planned features * Higher-level utilities based on the basic meta-data: o Object inspectors similar to the factory generators utility, which would allow to build classes for inspection of the structure (and values where applicable) of a class, type, namespace, member variable etc. in a user-defined way (in a GUI for example). o Abstract factory generator, allowing to create instances of different derived classes with a common base class. o Traversals of namespaces, classes, etc for (de)serialization-like operations. o Access to semantic data describing the individual language constructs conceptually. This would allow for example to write agents able to use objects of other applications without access to their sources defining these classes. * Automatic (or semi-automatic) registering, using various common tools and toolchains like (doxygen, gcc2xml, openc++, xslt, etc.) or specialized portable parsers and transformers for generating the source code necessary for registering the base-level constructs with Mirror. o May be fully automatic in some cases o May use annotations embedded in comments (like doxygen does)


Mirror Related Software