Boost logo

Boost :

From: Matus Chochlik (chochlik_at_[hidden])
Date: 2008-04-22 05:06:13


Greetings,

I would like to announce, that a very early version of 'mirror'
library is available
in the boost sandbox at http://svn.boost.org/svn/boost/sandbox/mirror/ .

Mirror is a compile-time reflection library intended to be proposed as
a boost library (in case of interest) at some point in the future.

The current version of mirror allows to register and then reflect namespaces,
types, typedefined types, classes, base classes, and class member attributes.

It allows to inspect:
- the name of a namespace and it's scope.
- the base name of a type and it's scope (currently, types defined on
  the global scope, in a namespace and inside of a class are supported)
- the list of base classes of a class, including the type of inheritance
  (virtual/non-virtual) and access type (private/protected/public)
- the list of types of the member attributes (own or all, including inherited)
- the names of the member attributes

It allows to get and set the value of a member attribute.

It supports attributes with getter/setter functions.

It tries to be as less intrusive as possible, in some cases
the reflected class does not need to be changed at all, even
if it has non-public member attributes, in other cases
a one line PP macro has to be inserted into the definition
of the class.

There are several examples, (some of them still incomplete and
rather poorly commented), showing, how the library can be used.

/libs/examples/registering/namespaces.cpp
 - shows how namespaces can be registered and which properties
   can be inspected.

/libs/examples/registering/types.cpp
 - shows how to register types and typedefined types and how
   to get the meta-data describing them.

/libs/examples/registering/classes.cpp
 - this is a fairly complicated example about registering and reflecting
   classes, base classes and various types of class member attributes.

/libs/examples/registering/virtual_bases.cpp
 - shows how to register virtual base classes and how to access
   all member attributes, including the inherited ones.

The examples were succesfully compiled with
  MS Visual C++ 2008EE, on Vista
  g++ 4.1.3, on Ubuntu
There are unfortunatelly no jamfiles (yet).

The (sore excuse for ;) ) documentation is still rather sketchy and
currently contains only a basic overview and the goals of the library.

As said, the library is still in early stages of development and many things
may (and will) be changed yet.
Anyway, I would certainly appreciate any opinions, constructive critique,
ideas about new useful features, etc.

Best regards,

-- 
________________
::matus_chochlik

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk