f3b71fc2ac
" the main problem is the wrapper generation: The PropertyInfo class use MethodInfo class to access to the value. When the property are define with the I_Property* macro, the MethodInfo use by the property to have access to the value are instancied in the I_Property* macro, but there are already instantied by the I_Method* macro before secondary problem: - the function used by the property could no be customized in the genwrapper.conf file - an array property can't insert a value - the std::map reflector (and indexedProperty in general) haven't remove method - about the help in wrapper ... why not ... solution : To use the function define by the I_Method, I add a MethodInfo variable in the I_Method0 macro old macro : #define I_Method0(ret, fn) (\ params.clear(),\ addMethod(new osgIntrospection::TypedMethodIn fo0<reflected_type, ret >(qualifyName(#fn), &reflected_type::fn, params))) new macro : #define I_Method0(ret, fn, signature, briefHelp, detailedHelp) \ params.clear(); \ osgIntrospection::MethodInfo* signature = addMethod(new osgIntrospection::TypedMethodInfo0<reflected_type, ret >(qualifyName(#fn), &reflected_type::fn, params, briefHelp, detailedHelp)); sink(signature) the osgIntrospection::MethodInfo* signature is used by the I_Property macro to define the MethodInfo that it use so for I_Property macro : old macro : #define I_PropertyWithReturnType(t, n, r) \ cap=addProperty(new osgIntrospection::PropertyInfo(osgIntrospection::Reflection::getType(typeid(reflected_type)), osgIntrospection::Reflection::getType(typeid(t)), #n, \ I_Method0(t, get##n), \ I_Method1(r, set##n, IN, t, value))) new macro: #define I_SimpleProperty(t, n, get, set) \ get, \ set)) The genwrapper has been modified in this way. The method signature is define by the prototype of the method For example, the "const char* libraryName();" have "__C5_char_P1__libraryName" for signature solution for secondary problem: The genwrapper accept new tokens in the configuration to custumize the property. The new PropertyInserter and the CustomPropertyInsertAttribute class has been defined The PropertyRemover has been added to the StdMapReflector The _briefHelp and _detailedHelp variable has been added in PropertyInfo, MethodInfo and ContructorInfo class modification: I have modify the genwrapper files Configuration.cpp Configuration.h add some tokens to custumize the property Doxyfile.template add the comment in the output xml genwrapper.conf customize some property in osg::Geometry RegistryBuilder.h RegistryBuilder.cpp add the process_help function (to extract help from xml) TypeRegister.cpp TypeRegister.h optimize the property detection TypeDesc.h TypeDesc.cpp modify FunctionDesc and PropertyDesc WrapperGenerator.h WrapperGenerator.cpp modify the output I also modify the fallowing osgIntrospection files: include/osgIntrospection/Attributes add the PropertyInserter and the CustomPropertyInsertAttribute class include/osgIntrospection/ConstructorInfo add the _briefHelp and _detailedHelp variable in the ConstructorInfo class add access function for the two new variables (_briefHelp and _detailedHelp) modify the constructor to define the two new variables (_briefHelp and _detailedHelp) include/osgIntrospection/MethodInfo add the _briefHelp and _detailedHelp variable in the MethodInfo class add access function for the two new variables (_briefHelp and _detailedHelp) modify the constructor to define the two new variables (_briefHelp and _detailedHelp) include/osgIntrospection/PropertyInfo add the _briefHelp and _detailedHelp variable in the PropertyInfo class add access function for the two new variables (_briefHelp and _detailedHelp) modify the constructor to define the two new variables (_briefHelp and _detailedHelp) include/osgIntrospection/ReflectionMacro remove unused I_Property* macro modify all I_Method macro to accept the help string modify all I_Method macro to define a MethodInfo signature include/osgIntrospection/Reflector add the PropertyInserter in StdVectorReflector and StdListReflector add the PropertyRemover in the StdMapReflector include/osgIntrospection/StaticMethodInfo modify all StaticMethodInfo* to accept the help in parameter include/osgIntrospection/TypedMethodInfo modify all TypedMethodInfo* to accept the help in parameter include/osgIntrospection/TypedConstructorInfo modify all TypedConstructorInfo* to accept the help in parameter include/osgIntrospection/Type add the _briefHelp and _detailedHelp variable in the Type class "
2979 lines
210 KiB
C++
2979 lines
210 KiB
C++
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
|
*
|
|
* This library is open source and may be redistributed and/or modified under
|
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
|
* (at your option) any later version. The full license is in LICENSE file
|
|
* included with this distribution, and on the openscenegraph.org website.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* OpenSceneGraph Public License for more details.
|
|
*/
|
|
//osgIntrospection - Copyright (C) 2005 Marco Jez
|
|
|
|
#ifndef OSGINTROSPECTION_TYPEDMETHODINFO_
|
|
#define OSGINTROSPECTION_TYPEDMETHODINFO_
|
|
|
|
#include <osgIntrospection/MethodInfo>
|
|
#include <osgIntrospection/Reflection>
|
|
#include <osgIntrospection/Utility>
|
|
|
|
namespace osgIntrospection
|
|
{
|
|
|
|
/// 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...
|
|
///
|
|
template<typename C, typename R>
|
|
class TypedMethodInfo0: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)() const;
|
|
typedef R (C::*FunctionType)();
|
|
|
|
TypedMethodInfo0(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo0(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
static TypedMethodInfo0 *constMethod(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
{
|
|
return new TypedMethodInfo0(qname, cf, plist, briefHelp, detailedHelp);
|
|
}
|
|
|
|
static TypedMethodInfo0 *nonConstMethod(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
{
|
|
return new TypedMethodInfo0(qname, f, plist, briefHelp, detailedHelp);
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& /*args*/) const
|
|
{
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& /*args*/) const
|
|
{
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0>
|
|
class TypedMethodInfo1: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0) const;
|
|
typedef R (C::*FunctionType)(P0);
|
|
|
|
TypedMethodInfo1(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo1(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(1);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(1);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1>
|
|
class TypedMethodInfo2: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1) const;
|
|
typedef R (C::*FunctionType)(P0, P1);
|
|
|
|
TypedMethodInfo2(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo2(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(2);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(2);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2>
|
|
class TypedMethodInfo3: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2);
|
|
|
|
TypedMethodInfo3(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo3(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(3);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(3);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2, typename P3>
|
|
class TypedMethodInfo4: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2, P3) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2, P3);
|
|
|
|
TypedMethodInfo4(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo4(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(4);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(4);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2, typename P3, typename P4>
|
|
class TypedMethodInfo5: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2, P3, P4) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2, P3, P4);
|
|
|
|
TypedMethodInfo5(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo5(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(5);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(5);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5>
|
|
class TypedMethodInfo6: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2, P3, P4, P5);
|
|
|
|
TypedMethodInfo6(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo6(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(6);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(6);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
|
|
class TypedMethodInfo7: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6);
|
|
|
|
TypedMethodInfo7(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo7(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(7);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(7);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
|
|
class TypedMethodInfo8: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7);
|
|
|
|
TypedMethodInfo8(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo8(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(8);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(8);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
|
|
class TypedMethodInfo9: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8);
|
|
|
|
TypedMethodInfo9(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo9(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(9);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(9);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
|
|
class TypedMethodInfo10: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9);
|
|
|
|
TypedMethodInfo10(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo10(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(10);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(10);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
|
|
class TypedMethodInfo11: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10);
|
|
|
|
TypedMethodInfo11(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo11(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(11);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(11);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11>
|
|
class TypedMethodInfo12: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11);
|
|
|
|
TypedMethodInfo12(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo12(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(12);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(12);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12>
|
|
class TypedMethodInfo13: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12);
|
|
|
|
TypedMethodInfo13(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo13(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(13);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(13);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename P13>
|
|
class TypedMethodInfo14: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13);
|
|
|
|
TypedMethodInfo14(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo14(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(14);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
convertArgument<P13>(args, newargs, getParameters(), 13);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(14);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
convertArgument<P13>(args, newargs, getParameters(), 13);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename P13, typename P14>
|
|
class TypedMethodInfo15: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14);
|
|
|
|
TypedMethodInfo15(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo15(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(15);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
convertArgument<P13>(args, newargs, getParameters(), 13);
|
|
convertArgument<P14>(args, newargs, getParameters(), 14);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(15);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
convertArgument<P13>(args, newargs, getParameters(), 13);
|
|
convertArgument<P14>(args, newargs, getParameters(), 14);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename P13, typename P14, typename P15>
|
|
class TypedMethodInfo16: public MethodInfo
|
|
{
|
|
public:
|
|
typedef R (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15) const;
|
|
typedef R (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15);
|
|
|
|
TypedMethodInfo16(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo16(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(R), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(16);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
convertArgument<P13>(args, newargs, getParameters(), 13);
|
|
convertArgument<P14>(args, newargs, getParameters(), 14);
|
|
convertArgument<P15>(args, newargs, getParameters(), 15);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(16);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
convertArgument<P13>(args, newargs, getParameters(), 13);
|
|
convertArgument<P14>(args, newargs, getParameters(), 14);
|
|
convertArgument<P15>(args, newargs, getParameters(), 15);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15]));
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15]));
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15]));
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15]));
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C>
|
|
class TypedMethodInfo0<C, void>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)() const;
|
|
typedef void (C::*FunctionType)();
|
|
|
|
TypedMethodInfo0(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo0(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& /*args*/) const
|
|
{
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& /*args*/) const
|
|
{
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0>
|
|
class TypedMethodInfo1<C, void, P0>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0) const;
|
|
typedef void (C::*FunctionType)(P0);
|
|
|
|
TypedMethodInfo1(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo1(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(1);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(1);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1>
|
|
class TypedMethodInfo2<C, void, P0, P1>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1) const;
|
|
typedef void (C::*FunctionType)(P0, P1);
|
|
|
|
TypedMethodInfo2(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo2(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(2);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(2);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2>
|
|
class TypedMethodInfo3<C, void, P0, P1, P2>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2);
|
|
|
|
TypedMethodInfo3(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo3(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(3);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(3);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2, typename P3>
|
|
class TypedMethodInfo4<C, void, P0, P1, P2, P3>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2, P3) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2, P3);
|
|
|
|
TypedMethodInfo4(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo4(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(4);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(4);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2, typename P3, typename P4>
|
|
class TypedMethodInfo5<C, void, P0, P1, P2, P3, P4>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2, P3, P4) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2, P3, P4);
|
|
|
|
TypedMethodInfo5(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo5(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(5);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(5);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5>
|
|
class TypedMethodInfo6<C, void, P0, P1, P2, P3, P4, P5>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2, P3, P4, P5);
|
|
|
|
TypedMethodInfo6(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo6(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(6);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(6);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
|
|
class TypedMethodInfo7<C, void, P0, P1, P2, P3, P4, P5, P6>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6);
|
|
|
|
TypedMethodInfo7(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo7(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(7);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(7);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
|
|
class TypedMethodInfo8<C, void, P0, P1, P2, P3, P4, P5, P6, P7>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7);
|
|
|
|
TypedMethodInfo8(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo8(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(8);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(8);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
|
|
class TypedMethodInfo9<C, void, P0, P1, P2, P3, P4, P5, P6, P7, P8>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8);
|
|
|
|
TypedMethodInfo9(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo9(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(9);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(9);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
|
|
class TypedMethodInfo10<C, void, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9);
|
|
|
|
TypedMethodInfo10(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo10(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(10);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(10);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
|
|
class TypedMethodInfo11<C, void, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10);
|
|
|
|
TypedMethodInfo11(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo11(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(11);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(11);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11>
|
|
class TypedMethodInfo12<C, void, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11);
|
|
|
|
TypedMethodInfo12(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo12(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(12);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(12);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12>
|
|
class TypedMethodInfo13<C, void, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12);
|
|
|
|
TypedMethodInfo13(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo13(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(13);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(13);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename P13>
|
|
class TypedMethodInfo14<C, void, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13);
|
|
|
|
TypedMethodInfo14(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo14(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(14);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
convertArgument<P13>(args, newargs, getParameters(), 13);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(14);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
convertArgument<P13>(args, newargs, getParameters(), 13);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename P13, typename P14>
|
|
class TypedMethodInfo15<C, void, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14);
|
|
|
|
TypedMethodInfo15(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo15(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(15);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
convertArgument<P13>(args, newargs, getParameters(), 13);
|
|
convertArgument<P14>(args, newargs, getParameters(), 14);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(15);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
convertArgument<P13>(args, newargs, getParameters(), 13);
|
|
convertArgument<P14>(args, newargs, getParameters(), 14);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
|
|
template<typename C, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename P13, typename P14, typename P15>
|
|
class TypedMethodInfo16<C, void, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15>: public MethodInfo
|
|
{
|
|
public:
|
|
typedef void (C::*ConstFunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15) const;
|
|
typedef void (C::*FunctionType)(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15);
|
|
|
|
TypedMethodInfo16(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(cf), f_(0)
|
|
{
|
|
}
|
|
|
|
TypedMethodInfo16(const std::string& qname, FunctionType f, const ParameterInfoList& plist, std::string briefHelp = std::string(), std::string detailedHelp = std::string())
|
|
: MethodInfo(qname, typeof(C), typeof(void), plist, briefHelp, detailedHelp), cf_(0), f_(f)
|
|
{
|
|
}
|
|
|
|
bool isConst() const { return cf_; }
|
|
bool isStatic() const { return false; }
|
|
|
|
Value invoke(const Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(16);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
convertArgument<P13>(args, newargs, getParameters(), 13);
|
|
convertArgument<P14>(args, newargs, getParameters(), 14);
|
|
convertArgument<P15>(args, newargs, getParameters(), 15);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<const C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
Value invoke(Value& instance, ValueList& args) const
|
|
{
|
|
ValueList newargs(16);
|
|
convertArgument<P0>(args, newargs, getParameters(), 0);
|
|
convertArgument<P1>(args, newargs, getParameters(), 1);
|
|
convertArgument<P2>(args, newargs, getParameters(), 2);
|
|
convertArgument<P3>(args, newargs, getParameters(), 3);
|
|
convertArgument<P4>(args, newargs, getParameters(), 4);
|
|
convertArgument<P5>(args, newargs, getParameters(), 5);
|
|
convertArgument<P6>(args, newargs, getParameters(), 6);
|
|
convertArgument<P7>(args, newargs, getParameters(), 7);
|
|
convertArgument<P8>(args, newargs, getParameters(), 8);
|
|
convertArgument<P9>(args, newargs, getParameters(), 9);
|
|
convertArgument<P10>(args, newargs, getParameters(), 10);
|
|
convertArgument<P11>(args, newargs, getParameters(), 11);
|
|
convertArgument<P12>(args, newargs, getParameters(), 12);
|
|
convertArgument<P13>(args, newargs, getParameters(), 13);
|
|
convertArgument<P14>(args, newargs, getParameters(), 14);
|
|
convertArgument<P15>(args, newargs, getParameters(), 15);
|
|
|
|
const Type& type = instance.getType();
|
|
if (type.isPointer())
|
|
{
|
|
if (type.isConstPointer())
|
|
{
|
|
if (cf_) return (variant_cast<const C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15])), Value();
|
|
if (f_) throw ConstIsConstException();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C *>(instance)->*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15])), Value();
|
|
if (f_) return (variant_cast<C *>(instance)->*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
if (cf_) return (variant_cast<C &>(instance).*cf_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15])), Value();
|
|
if (f_) return (variant_cast<C &>(instance).*f_)(variant_cast<P0>(newargs[0]), variant_cast<P1>(newargs[1]), variant_cast<P2>(newargs[2]), variant_cast<P3>(newargs[3]), variant_cast<P4>(newargs[4]), variant_cast<P5>(newargs[5]), variant_cast<P6>(newargs[6]), variant_cast<P7>(newargs[7]), variant_cast<P8>(newargs[8]), variant_cast<P9>(newargs[9]), variant_cast<P10>(newargs[10]), variant_cast<P11>(newargs[11]), variant_cast<P12>(newargs[12]), variant_cast<P13>(newargs[13]), variant_cast<P14>(newargs[14]), variant_cast<P15>(newargs[15])), Value();
|
|
throw InvalidFunctionPointerException();
|
|
}
|
|
|
|
private:
|
|
ConstFunctionType cf_;
|
|
FunctionType f_;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|
|
|