Version 6 (modified by martin, 10 years ago)


Reflection Framework

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

Relevant resources


  • Drew's notes are now at his page - here.

Design suggestions


  • 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.


  • 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 source code.