= Reflection Framework =
[[TracNav(TracNav/CommunityTOC)]]
== Notes about project ==
osgIntrospection is now checked into CVS, and will set its first official release as part of 0.9.9. osgInspection is the core introspection framework library that end users querry methods and properties of class through, this is then accompanied by osgWrapper plugins that add reflection support for specific libraries. The !osgWrapper plugins are now automatically generated by Marco Jez's new GenWrapper utitlity program that reads headers and generates the wrapper code. You can run GenWrapper yourself to generate wrappers for you own libraries.
== google search results for RTTI Reflection/C++ resources ==
* [http://vcf.sourceforge.net/ Visual Component Framework website]
* [http://www.codeproject.com/library/vcf_rtti.asp Visual Component Framework article]
* [http://www.codeguru.com/Cpp/frameworks/advancedui/componentlibraries/article.php/c3211/ Visual Component Framework article II]
* [http://www.phptr.com/articles/article.asp?p=25948 Programming with Reflection in the .NET Framework Using Managed C++]
* [http://seal.web.cern.ch/seal/snapshot/work-packages/dictionary/index.html Cern SEAL project] - The LCG Dictionary is an attempt to provide introspection (reflection) functionality to the standard C++. The Refection package provides the reflection API to the dictionary information. The package !ReflectionBuilder is used to build at run-time the dictionary information in memory. The command lcgdict (based on gcc_xml) is available to generated the !ReflectionBuilder code directly from C++ header files.
== Relevant resources ==
* [http://doc.trolltech.com/3.0/object.html Qt object model] - Qt uses a precompiler "moc" to help generate the meta object information.
* [http://www.geocities.com/axilmar/ LibReflection]
* [http://www.gccxml.org/HTML/Index.html gcc-xml]
* new [http://www.boost.org/libs/serialization/doc/index.html boost serialisation library]
== Requirements ==
* Drew's notes are now at his page - [wiki:Community/People/DrewWhitehouse here.]
== Design suggestions ==
* [attachment:Marco_ReflectionFrameWork.pdf Preliminary description] of a possible reflection framework for OSG (by [wiki:Community/People/MarcoJez Marco Jez])
[[Image(Marco_ReflectionFrameWorkClassDiagram.gif)]]
== Implementations ==
* Now checked in to CVS version of the !OpenSceneGraph, see osgIntrospection (containing the reflectance framework), src/osgWrappers/osg (containing the preliminary wrappers for the core osg library) and the osgintrospection example application which introsepection in action.
== Examples ==
* This example shows how to use the reflection framework to move compile-time dependencies to run time. '''Typical scenario:''' the author of an advanced osgDB I/O plugin realizes that the features offered by an external !NodeKit (osgNV in this example) would greatly improve the quality of imported models, making them closer to the original ones. '''Problem:''' using such features would make the whole OSG dependent on the external !NodeKit, which is not desiderable. '''Solution''': if the !NodeKit has introspection wrappers defined, the reflection framework can be used to load the !NodeKit and communicate with it at run time without requiring any compile-time dependency and keeping the whole thing optional. Furthermore, it's really easy: take a look at the [attachment:Marco_ref_example1.zip source code].