osgIntrospection::TypedMethodInfo0< C, R > Class Template Reference

Class templates TypedMethodInfoN (where 0 <= N <= 16) are concrete implementations of MethodInfo. More...

Inheritance diagram for osgIntrospection::TypedMethodInfo0< C, R >:

Inheritance graph
[legend]

List of all members.

Public Types

typedef R(C::* ConstFunctionType )() const
typedef R(C::* FunctionType )()

Public Member Functions

 TypedMethodInfo0 (const std::string &qname, ConstFunctionType cf, const ParameterInfoList &plist, VirtualState virtualState, std::string briefHelp=std::string(), std::string detailedHelp=std::string())
 TypedMethodInfo0 (const std::string &qname, FunctionType f, const ParameterInfoList &plist, VirtualState virtualState, std::string briefHelp=std::string(), std::string detailedHelp=std::string())
bool isConst () const
 Returns whether the reflected method is const or not.
bool isStatic () const
 Returns whether the reflected method is static or not.
Value invoke (const Value &instance, ValueList &) const
 Invokes the reflected method dynamically on the given const instance, passing it the arguments as a list of Value objects.
Value invoke (Value &instance, ValueList &) const
 Invokes the reflected method dynamically on the given instance, passing it the arguments as a list of Value objects.

Static Public Member Functions

static TypedMethodInfo0constMethod (const std::string &qname, ConstFunctionType cf, const ParameterInfoList &plist, VirtualState virtualState, std::string briefHelp=std::string(), std::string detailedHelp=std::string())
static TypedMethodInfo0nonConstMethod (const std::string &qname, FunctionType f, const ParameterInfoList &plist, VirtualState virtualState, std::string briefHelp=std::string(), std::string detailedHelp=std::string())


Detailed Description

template<typename C, typename R>
class osgIntrospection::TypedMethodInfo0< C, R >

Class templates TypedMethodInfoN (where 0 <= N <= 16) are concrete implementations of MethodInfo.

They are used to keep information about class methods and to provide the means for calling them dynamically. Each class template can handle methods with N arguments and is parametrized by the class that declares the method and by the return type. Both const and non-const methods are supported. The invoke() methods allow to call the reflected method dynamically, passing it the arguments as a list of Value objects. The instance on which the reflected method will be called is passed to invoke() as a Value object, which can contain either a value of type C or a pointer to C. If the constness doesn't match (i.e., you try to call a non-const reflected method on a const instance) an exception is thrown.

NOTE: currently, variant_cast<> does not check pointer conversions, it simply converts one pointer into another even if they point to types that are completely unrelated. This means you won't probably get any exceptions if you try to call a class' method on another class' instance, but of course that's a bad, bad idea...


Member Typedef Documentation

template<typename C, typename R>
typedef R(C::* osgIntrospection::TypedMethodInfo0< C, R >::ConstFunctionType)() const

template<typename C, typename R>
typedef R(C::* osgIntrospection::TypedMethodInfo0< C, R >::FunctionType)()


Constructor & Destructor Documentation

template<typename C, typename R>
osgIntrospection::TypedMethodInfo0< C, R >::TypedMethodInfo0 ( const std::string &  qname,
ConstFunctionType  cf,
const ParameterInfoList plist,
VirtualState  virtualState,
std::string  briefHelp = std::string(),
std::string  detailedHelp = std::string() 
) [inline]

template<typename C, typename R>
osgIntrospection::TypedMethodInfo0< C, R >::TypedMethodInfo0 ( const std::string &  qname,
FunctionType  f,
const ParameterInfoList plist,
VirtualState  virtualState,
std::string  briefHelp = std::string(),
std::string  detailedHelp = std::string() 
) [inline]


Member Function Documentation

template<typename C, typename R>
static TypedMethodInfo0* osgIntrospection::TypedMethodInfo0< C, R >::constMethod ( const std::string &  qname,
ConstFunctionType  cf,
const ParameterInfoList plist,
VirtualState  virtualState,
std::string  briefHelp = std::string(),
std::string  detailedHelp = std::string() 
) [inline, static]

template<typename C, typename R>
static TypedMethodInfo0* osgIntrospection::TypedMethodInfo0< C, R >::nonConstMethod ( const std::string &  qname,
FunctionType  f,
const ParameterInfoList plist,
VirtualState  virtualState,
std::string  briefHelp = std::string(),
std::string  detailedHelp = std::string() 
) [inline, static]

template<typename C, typename R>
bool osgIntrospection::TypedMethodInfo0< C, R >::isConst (  )  const [inline, virtual]

Returns whether the reflected method is const or not.

Implements osgIntrospection::MethodInfo.

template<typename C, typename R>
bool osgIntrospection::TypedMethodInfo0< C, R >::isStatic (  )  const [inline, virtual]

Returns whether the reflected method is static or not.

Implements osgIntrospection::MethodInfo.

template<typename C, typename R>
Value osgIntrospection::TypedMethodInfo0< C, R >::invoke ( const Value instance,
ValueList args 
) const [inline, virtual]

Invokes the reflected method dynamically on the given const instance, passing it the arguments as a list of Value objects.

Reimplemented from osgIntrospection::MethodInfo.

template<typename C, typename R>
Value osgIntrospection::TypedMethodInfo0< C, R >::invoke ( Value instance,
ValueList args 
) const [inline, virtual]

Invokes the reflected method dynamically on the given instance, passing it the arguments as a list of Value objects.

Reimplemented from osgIntrospection::MethodInfo.


The documentation for this class was generated from the following file:
Generated at Sun Oct 14 02:12:35 2007 for the OpenSceneGraph by doxygen 1.5.3.