|C++ Reflection package? firstname.lastname@example.org (Mihai Christodorescu) (1999-04-01)|
|Re: C++ Reflection package? email@example.com (Lieven Marchand) (1999-04-03)|
|Re: C++ Reflection package? firstname.lastname@example.org (Hao-yang Wang) (1999-04-03)|
|Re: C++ Reflection package? email@example.com (Olivier Lefevre) (1999-04-06)|
|From:||Lieven Marchand <firstname.lastname@example.org>|
|Date:||3 Apr 1999 21:57:20 -0500|
|Organization:||Only under extreme pressure|
Mihai Christodorescu <email@example.com> writes:
> I was wondering whether there is such a beast as a reflection
> (in the Java DevKit sense) library for C++. As far as I can figure out
> (and I have not spent too much time on the topic), one would be able
> to extract such information only from object files / shared libs that
> were compiled with debug info. I know RTTI lets you query whether an
> object is of a certain type. But I want to extract some textual
> information about the class.
Before Java called it reflection Lispers called stuff like that a meta
object protocol. An implementation for C++ is OpenC++ at
One comprehensive starting point for MOPs is
http://www.parc.xerox.com/spl/projects/mops/default.html although they
have now broadened their research to a concept they call Open
PS: I presume you are aware that RTTI only is guaranteed to work on
classes with at least one virtual function?
> PS. On a completely different topic, is it possible to manipulate
> namespaces in C++ (i.e. add/remove/replace classes in a namespace)?
Do you mean at compile time or at run time? I think the name lookup
rules for C++ are too complex to allow manipulating namespaces at run
time. It would force an interpreter based system since you would have
to reparse everything to know to what the functions resolve to after
changing anything in a namespace.
Lieven Marchand <firstname.lastname@example.org>
Return to the
Search the comp.compilers archives again.