/* -*-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 #include #include 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 class TypedMethodInfo0: public MethodInfo { public: typedef R (C::*ConstFunctionType)() const; typedef R (C::*FunctionType)(); TypedMethodInfo0(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo0(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(0), f_(f) { } static TypedMethodInfo0 *constMethod(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) { return new TypedMethodInfo0(qname, cf, plist, virtualState, briefHelp, detailedHelp); } static TypedMethodInfo0 *nonConstMethod(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) { return new TypedMethodInfo0(qname, f, plist, virtualState, 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(instance)->*cf_)(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(); if (f_) return (variant_cast(instance)->*f_)(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(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(instance)->*cf_)(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(); if (f_) return (variant_cast(instance)->*f_)(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(); if (f_) return (variant_cast(instance).*f_)(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo1(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(1); convertArgument(args, newargs, getParameters(), 0); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo2(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(2); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo3(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(3); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo4(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(4); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo5(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(5); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo6(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(6); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo7(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(7); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo8(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(8); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo9(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(9); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo10(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(10); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo11(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(11); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo12(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(12); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo13(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(13); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo14(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); convertArgument(args, newargs, getParameters(), 13); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(14); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); convertArgument(args, newargs, getParameters(), 13); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo15(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); convertArgument(args, newargs, getParameters(), 13); convertArgument(args, newargs, getParameters(), 14); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(15); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); convertArgument(args, newargs, getParameters(), 13); convertArgument(args, newargs, getParameters(), 14); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo16(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(R), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); convertArgument(args, newargs, getParameters(), 13); convertArgument(args, newargs, getParameters(), 14); convertArgument(args, newargs, getParameters(), 15); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(16); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); convertArgument(args, newargs, getParameters(), 13); convertArgument(args, newargs, getParameters(), 14); convertArgument(args, newargs, getParameters(), 15); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo0: public MethodInfo { public: typedef void (C::*ConstFunctionType)() const; typedef void (C::*FunctionType)(); TypedMethodInfo0(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo0(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(instance)->*cf_)(), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(), Value(); if (f_) return (variant_cast(instance)->*f_)(), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(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(instance)->*cf_)(), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(), Value(); if (f_) return (variant_cast(instance)->*f_)(), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(), Value(); if (f_) return (variant_cast(instance).*f_)(), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo1: public MethodInfo { public: typedef void (C::*ConstFunctionType)(P0) const; typedef void (C::*FunctionType)(P0); TypedMethodInfo1(const std::string& qname, ConstFunctionType cf, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo1(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(1); convertArgument(args, newargs, getParameters(), 0); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo2: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo2(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(2); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo3: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo3(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(3); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo4: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo4(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(4); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo5: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo5(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(5); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo6: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo6(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(6); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo7: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo7(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(7); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo8: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo8(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(8); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo9: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo9(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(9); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo10: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo10(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(10); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo11: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo11(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(11); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo12: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo12(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(12); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo13: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo13(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(13); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo14: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo14(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); convertArgument(args, newargs, getParameters(), 13); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(14); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); convertArgument(args, newargs, getParameters(), 13); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo15: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo15(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); convertArgument(args, newargs, getParameters(), 13); convertArgument(args, newargs, getParameters(), 14); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(15); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); convertArgument(args, newargs, getParameters(), 13); convertArgument(args, newargs, getParameters(), 14); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; template class TypedMethodInfo16: 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, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, briefHelp, detailedHelp), cf_(cf), f_(0) { } TypedMethodInfo16(const std::string& qname, FunctionType f, const ParameterInfoList& plist, VirtualState virtualState, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : MethodInfo(qname, typeof(C), typeof(void), plist, virtualState, 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(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); convertArgument(args, newargs, getParameters(), 13); convertArgument(args, newargs, getParameters(), 14); convertArgument(args, newargs, getParameters(), 15); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } Value invoke(Value& instance, ValueList& args) const { ValueList newargs(16); convertArgument(args, newargs, getParameters(), 0); convertArgument(args, newargs, getParameters(), 1); convertArgument(args, newargs, getParameters(), 2); convertArgument(args, newargs, getParameters(), 3); convertArgument(args, newargs, getParameters(), 4); convertArgument(args, newargs, getParameters(), 5); convertArgument(args, newargs, getParameters(), 6); convertArgument(args, newargs, getParameters(), 7); convertArgument(args, newargs, getParameters(), 8); convertArgument(args, newargs, getParameters(), 9); convertArgument(args, newargs, getParameters(), 10); convertArgument(args, newargs, getParameters(), 11); convertArgument(args, newargs, getParameters(), 12); convertArgument(args, newargs, getParameters(), 13); convertArgument(args, newargs, getParameters(), 14); convertArgument(args, newargs, getParameters(), 15); const Type& type = instance.getType(); if (type.isPointer()) { if (type.isConstPointer()) { if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])), Value(); if (f_) throw ConstIsConstException(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance)->*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])), Value(); if (f_) return (variant_cast(instance)->*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])), Value(); throw InvalidFunctionPointerException(); } if (cf_) return (variant_cast(instance).*cf_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])), Value(); if (f_) return (variant_cast(instance).*f_)(variant_cast(newargs[0]), variant_cast(newargs[1]), variant_cast(newargs[2]), variant_cast(newargs[3]), variant_cast(newargs[4]), variant_cast(newargs[5]), variant_cast(newargs[6]), variant_cast(newargs[7]), variant_cast(newargs[8]), variant_cast(newargs[9]), variant_cast(newargs[10]), variant_cast(newargs[11]), variant_cast(newargs[12]), variant_cast(newargs[13]), variant_cast(newargs[14]), variant_cast(newargs[15])), Value(); throw InvalidFunctionPointerException(); } private: ConstFunctionType cf_; FunctionType f_; }; } #endif