OpenSceneGraph 2.8.4
Classes | Public Types | Public Member Functions | Protected Member Functions
osgIntrospection::Reflector< T > Class Template Reference

A Reflector is a proxy class that is used to create a new description of a given type. More...

Inheritance diagram for osgIntrospection::Reflector< T >:
Inheritance graph
[legend]

List of all members.

Classes

struct  ConstPtrConstructor
struct  PtrConstructor

Public Types

typedef T reflected_type
typedef Reflector< T > inherited

Public Member Functions

virtual ~Reflector ()
 Virtual destructor.

Protected Member Functions

 Reflector (const std::string &name, const std::string &ns, bool abstract=false)
 Direct initialization constructor.
 Reflector (const std::string &qname, bool abstract=false)
 Direct initialization constructor.
TypegetType ()
 Returns the Type object being described.
void addBaseType (const Type &type)
 Declares a new base type for the current type.
void setComparator (const Comparator *cmp)
 Sets the comparator object for the current type.
PropertyInfoaddProperty (PropertyInfo *pi)
 Adds a property description to the current type.
MethodInfoaddMethod (MethodInfo *mi)
 Adds a method description to the current type.
MethodInfoaddProtectedMethod (MethodInfo *mi)
 Adds a protected method description to the current type.
void addEnumLabel (int v, const std::string &label, bool strip_namespace=true)
 Adds an enumeration label to the current type.
ConstructorInfoaddConstructor (ConstructorInfo *ci)
 Adds a constructor description to the current type.
ConstructorInfoaddProtectedConstructor (ConstructorInfo *ci)
 Adds a protected constructor description to the current type.
std::string qualifyName (const std::string &name) const
 Returns a string containing the qualified version of 'name'.
CustomAttributeProvideraddAttribute (const CustomAttribute *attrib)
 Adds a custom attribute to the type being described.
void setReaderWriter (const ReaderWriter *rw)
 Sets the current type's ReaderWriter object.
void setDeclaringFile (const std::string &file) const
 Sets the current type's declaring file.

Detailed Description

template<typename T>
class osgIntrospection::Reflector< T >

A Reflector is a proxy class that is used to create a new description of a given type.

If the type to be described is simple and doesn't require additional details such as properties and methods, it can be reflected by simply creating a global instance of one of the classes derived from Reflector, for example ValueReflector. Other types may need further information and therefore it could be necessary to create a new subclass of Reflector or extend one of the existing subclasses. The reflected type can be set by calling Reflector's protected methods.

NOTE: when you create a Reflector for type T, it will automatically create descriptions for types T*, const T*, T&, and const T&. You should NEVER create reflectors for pointer or reference types explicitly.


Member Typedef Documentation

template<typename T >
typedef Reflector<T> osgIntrospection::Reflector< T >::inherited
template<typename T >
typedef T osgIntrospection::Reflector< T >::reflected_type

Constructor & Destructor Documentation

template<typename T >
virtual osgIntrospection::Reflector< T >::~Reflector ( ) [inline, virtual]

Virtual destructor.

template<typename T >
osgIntrospection::Reflector< T >::Reflector ( const std::string &  name,
const std::string &  ns,
bool  abstract = false 
) [protected]

Direct initialization constructor.

Parameter 'name' is the name of the type being reflected and 'ns' is its namespace.

template<typename T >
osgIntrospection::Reflector< T >::Reflector ( const std::string &  qname,
bool  abstract = false 
) [protected]

Direct initialization constructor.

Parameter 'qname' is the fully-qualified name of the type being reflected, i.e. containing both the namespace and the name (separated by "::").


Member Function Documentation

template<typename T >
CustomAttributeProvider * osgIntrospection::Reflector< T >::addAttribute ( const CustomAttribute attrib) [protected]

Adds a custom attribute to the type being described.

References osgIntrospection::CustomAttributeProvider::addAttribute().

template<typename T >
void osgIntrospection::Reflector< T >::addBaseType ( const Type type) [protected]

Declares a new base type for the current type.

template<typename T >
ConstructorInfo * osgIntrospection::Reflector< T >::addConstructor ( ConstructorInfo ci) [protected]
template<typename T >
void osgIntrospection::Reflector< T >::addEnumLabel ( int  v,
const std::string &  label,
bool  strip_namespace = true 
) [protected]

Adds an enumeration label to the current type.

template<typename T >
MethodInfo * osgIntrospection::Reflector< T >::addMethod ( MethodInfo mi) [protected]

Adds a method description to the current type.

References osgIntrospection::MethodInfo::overrides().

template<typename T >
PropertyInfo * osgIntrospection::Reflector< T >::addProperty ( PropertyInfo pi) [protected]
template<typename T >
ConstructorInfo * osgIntrospection::Reflector< T >::addProtectedConstructor ( ConstructorInfo ci) [protected]

Adds a protected constructor description to the current type.

template<typename T >
MethodInfo * osgIntrospection::Reflector< T >::addProtectedMethod ( MethodInfo mi) [protected]

Adds a protected method description to the current type.

References osgIntrospection::MethodInfo::overrides().

template<typename T >
Type* osgIntrospection::Reflector< T >::getType ( ) [inline, protected]

Returns the Type object being described.

template<typename T >
std::string osgIntrospection::Reflector< T >::qualifyName ( const std::string &  name) const [protected]

Returns a string containing the qualified version of 'name'.

template<typename T >
void osgIntrospection::Reflector< T >::setComparator ( const Comparator cmp) [protected]
template<typename T >
void osgIntrospection::Reflector< T >::setDeclaringFile ( const std::string &  file) const [protected]

Sets the current type's declaring file.

template<typename T >
void osgIntrospection::Reflector< T >::setReaderWriter ( const ReaderWriter rw) [protected]

The documentation for this class was generated from the following file:

osg logo
Generated at Sun Jan 8 2012 13:16:37 for the OpenSceneGraph by doxygen 1.7.4.