From Marco Jez, improvements to osgIntrospection, and new automatically generated

osgWrappers/osg set.
This commit is contained in:
Robert Osfield
2005-04-07 20:00:17 +00:00
parent 5b4482c70d
commit 7a27a0bef7
132 changed files with 8608 additions and 301 deletions

View File

@@ -1,8 +1,11 @@
#ifndef OSGINTROSPECTION_REFLECTIONMACROS_
#define OSGINTROSPECTION_REFLECTIONMACROS_
#include <osgIntrospection/Type>
#include <osgIntrospection/Reflector>
#include <osgIntrospection/TypeNameAliasProxy>
#include <osgIntrospection/ConverterProxy>
#include <osgIntrospection/Converter>
// --------------------------------------------------------------------------
// "private" macros, not to be used outside this file
@@ -20,6 +23,24 @@
#define TYPE_NAME_ALIAS(t, n) \
namespace { osgIntrospection::TypeNameAliasProxy<t > OSG_RM_LINEID(tnalias) (#n); }
// --------------------------------------------------------------------------
// TYPE CONVERTERS
// --------------------------------------------------------------------------
#define Converter(s, d, c) \
namespace { osgIntrospection::ConverterProxy OSG_RM_LINEID(cvt) (s, d, new c); }
#define StaticConverter(s, d) \
Converter(s, d, osgIntrospection::StaticConverter<s, d>);
#define DynamicConverter(s, d) \
Converter(s, d, osgIntrospection::DynamicConverter<s, d>);
#define ReinterpretConverter(s, d) \
Converter(s, d, osgIntrospection::ReinterpretConverter<s, d>);
// --------------------------------------------------------------------------
// ONE-LINE REFLECTORS
@@ -110,7 +131,33 @@
#define ReaderWriter(x) setReaderWriter(new x);
#define Comparator(x) setComparator(new x);
#define BaseType(x) addBaseType(typeof(x));
#define BaseType(x) \
{ \
addBaseType(typeof(x)); \
const osgIntrospection::Type &st = typeof(reflected_type *); \
const osgIntrospection::Type &cst = typeof(const reflected_type *); \
const osgIntrospection::Type &dt = typeof(x *); \
const osgIntrospection::Type &cdt = typeof(const x *); \
osgIntrospection::ConverterProxy cp1(st, dt, new osgIntrospection::StaticConverter<reflected_type *, x *>); \
osgIntrospection::ConverterProxy cp2(cst, cdt, new osgIntrospection::StaticConverter<const reflected_type *, const x *>); \
osgIntrospection::ConverterProxy cp1c(st, cdt, new osgIntrospection::StaticConverter<reflected_type *, const x *>); \
osgIntrospection::ConverterProxy cp3(dt, st, new osgIntrospection::StaticConverter<x *, reflected_type *>); \
osgIntrospection::ConverterProxy cp4(cdt, cst, new osgIntrospection::StaticConverter<const x *, const reflected_type *>); \
osgIntrospection::ConverterProxy cp3c(dt, cst, new osgIntrospection::StaticConverter<x *, const reflected_type *>); \
}
#define VirtualBaseType(x) \
{ \
addBaseType(typeof(x)); \
const osgIntrospection::Type &st = typeof(reflected_type *); \
const osgIntrospection::Type &cst = typeof(const reflected_type *); \
const osgIntrospection::Type &dt = typeof(x *); \
const osgIntrospection::Type &cdt = typeof(const x *); \
osgIntrospection::ConverterProxy cp1(st, dt, new osgIntrospection::StaticConverter<reflected_type *, x *>); \
osgIntrospection::ConverterProxy cp2(cst, cdt, new osgIntrospection::StaticConverter<const reflected_type *, const x *>); \
osgIntrospection::ConverterProxy cp1c(st, cdt, new osgIntrospection::StaticConverter<reflected_type *, const x *>); \
}
#define EnumLabel(x) addEnumLabel(x, #x, true);