|
Boost : |
From: Stefan Roiser (stefan.roiser_at_[hidden])
Date: 2006-01-30 07:15:25
David Abrahams <dave <at> boost-consulting.com> writes:
>
> Stefan Roiser <stefan.roiser <at> cern.ch> writes:
>
> > Hi,
> >
> > We would like to propose a library and tools which enhance C++ with
> > reflection capabilities. The package, "Reflex", provides a library
> > for runtime introspection and interaction with C++ "constructs" such
> > as objects, types, scopes, members, templated types, ... The library
> > has no external dependencies and was developed with the ISO/IEC
> > standard for C++ as guideline.
> >
> > Production of dictionary information of arbitrary C++ definitions is
> > done via a Python script (genreflex), in a non-intrusive way, using
> > an external tool (gccxml - www.gccxml.org). The generated dictionary
> > source code can be compiled into a shared library, dynamically loaded
> > and accessed via an API providing the introspection information.
> >
> > You can find more information at
> >
> > http://cern.ch/reflex
> >
> > Below you may find an example code snippet which exposes a subset of
> > the functionality. The four different parts show
> > 1 - the definition of the example classes
> > 2 - how to generate the dictionary information
> > 3 - example on introspection (re-generate classes from the dictionary
> > information)
> > 4 - examples on interaction (get/set data members, invoke functions,
> > con/destruct objects)
>
> How does this work relate or compare to
> http://www.language-binding.net/pygccxml/pygccxml.html?
>
> The latter already has some traction in the Boost community because of
> its use in http://www.language-binding.net/pyplusplus/pyplusplus.html
>
I had already an off-list discussion with the developers of pygccxml. I have
been using it for private scripts and found it very useful.
The Reflex package provides a python script (genreflex.py) which produces
dictionary source code for C++ definitions. In order to do this it invokes
gccxml on these definitions and parses it's output. At the moment
genreflex.py uses it's own data structures. In the future it could be useful
to switch to pygccxml. Unfortunately at the moment we don't have the
manpower to do this.
Cheers
Stefan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk