Show IReflectedValue.h syntax highlighted
#ifndef __IREFLECTEDVALUE_H__
#define __IREFLECTEDVALUE_H__
#include <string>
#include <osg/Referenced>
#include <osgIntrospection/Type>
#include <osgIntrospectionToolKit/Export.h>
namespace osgIntrospectionToolKit
{
class OSGINTROSPECTIONTOOLKIT_EXPORT IReflectedValue: public osg::Referenced
{
public:
IReflectedValue()
: osg::Referenced()
{}
enum Scope
{
Instance,
Pointer,
RefPointer
};
virtual Scope valueScope() const = 0;
virtual void getValue(std::string& value) const = 0;
virtual const osgIntrospection::Type& type() const = 0;
virtual const osgIntrospection::Type& instanceType() const = 0;
virtual const osgIntrospection::Type& pointedType() const
{
return (type().getPointedType());
}
void getTypeName(std::string& typeName) const
{
const osgIntrospection::Type& t = type();
typeName = ( (t.isDefined()) ? (t.getQualifiedName()) : (t.getStdTypeInfo().name()) );
}
void getInstanceTypeName(std::string& typeName) const
{
const osgIntrospection::Type& t = instanceType();
typeName = ( (t.isDefined()) ? (t.getQualifiedName()) : (t.getStdTypeInfo().name()) );
}
void getPointedTypeName(std::string& typeName) const
{
if (type().isDefined())
{
const osgIntrospection::Type& tp = type().getPointedType();
typeName = ((tp.isDefined()) ? (tp.getQualifiedName()) : (tp.getStdTypeInfo().name()));
}
else
typeName = type().getStdTypeInfo().name();
}
protected:
virtual ~IReflectedValue()
{}
};
}
#endif // ** __IREFLECTEDVALUE_H__ ** //
See more files for this project here