#ifndef METHOD_BIND_FREE_FUNC_H #define METHOD_BIND_FREE_FUNC_H //including this header file allows method binding to use free functions //note that the free function must have a pointer to an instance of the class as its first parameter #ifdef TYPED_METHOD_BIND template class FunctionBind0 : public MethodBind { public: void (*method) ( T *); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } #endif (method)(instance); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance) ; } #endif FunctionBind0 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(0); #else set_argument_count(0); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *) ) { FunctionBind0 * a = memnew( (FunctionBind0) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind0R : public MethodBind { public: R (*method) ( T *); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } #endif Variant ret = (method)(instance); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance) ,r_ret) ; } #endif FunctionBind0R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(0); #else set_argument_count(0); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *) ) { FunctionBind0R * a = memnew( (FunctionBind0R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind0C : public MethodBind { public: void (*method) (const T *); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } #endif (method)(instance); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance) ; } #endif FunctionBind0C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(0); #else set_argument_count(0); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *) ) { FunctionBind0C * a = memnew( (FunctionBind0C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind0RC : public MethodBind { public: R (*method) (const T *); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } #endif Variant ret = (method)(instance); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance) ,r_ret) ; } #endif FunctionBind0RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(0); #else set_argument_count(0); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *) ) { FunctionBind0RC * a = memnew( (FunctionBind0RC) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind1 : public MethodBind { public: void (*method) ( T *, P1); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); #endif (method)(instance, _VC(1)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1])) ; } #endif FunctionBind1 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(1); #else set_argument_count(1); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *, P1) ) { FunctionBind1 * a = memnew( (FunctionBind1) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind1R : public MethodBind { public: R (*method) ( T *, P1); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); #endif Variant ret = (method)(instance, _VC(1)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1])) ,r_ret) ; } #endif FunctionBind1R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(1); #else set_argument_count(1); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *, P1) ) { FunctionBind1R * a = memnew( (FunctionBind1R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind1C : public MethodBind { public: void (*method) (const T *, P1); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); #endif (method)(instance, _VC(1)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1])) ; } #endif FunctionBind1C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(1); #else set_argument_count(1); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *, P1) ) { FunctionBind1C * a = memnew( (FunctionBind1C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind1RC : public MethodBind { public: R (*method) (const T *, P1); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); #endif Variant ret = (method)(instance, _VC(1)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1])) ,r_ret) ; } #endif FunctionBind1RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(1); #else set_argument_count(1); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *, P1) ) { FunctionBind1RC * a = memnew( (FunctionBind1RC) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind2 : public MethodBind { public: void (*method) ( T *, P1, P2); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); #endif (method)(instance, _VC(1), _VC(2)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1])) ; } #endif FunctionBind2 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(2); #else set_argument_count(2); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *, P1, P2) ) { FunctionBind2 * a = memnew( (FunctionBind2) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind2R : public MethodBind { public: R (*method) ( T *, P1, P2); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); #endif Variant ret = (method)(instance, _VC(1), _VC(2)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1])) ,r_ret) ; } #endif FunctionBind2R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(2); #else set_argument_count(2); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *, P1, P2) ) { FunctionBind2R * a = memnew( (FunctionBind2R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind2C : public MethodBind { public: void (*method) (const T *, P1, P2); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); #endif (method)(instance, _VC(1), _VC(2)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1])) ; } #endif FunctionBind2C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(2); #else set_argument_count(2); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *, P1, P2) ) { FunctionBind2C * a = memnew( (FunctionBind2C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind2RC : public MethodBind { public: R (*method) (const T *, P1, P2); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); #endif Variant ret = (method)(instance, _VC(1), _VC(2)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1])) ,r_ret) ; } #endif FunctionBind2RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(2); #else set_argument_count(2); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *, P1, P2) ) { FunctionBind2RC * a = memnew( (FunctionBind2RC) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind3 : public MethodBind { public: void (*method) ( T *, P1, P2, P3); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); #endif (method)(instance, _VC(1), _VC(2), _VC(3)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1])) ; } #endif FunctionBind3 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(3); #else set_argument_count(3); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *, P1, P2, P3) ) { FunctionBind3 * a = memnew( (FunctionBind3) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind3R : public MethodBind { public: R (*method) ( T *, P1, P2, P3); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1])) ,r_ret) ; } #endif FunctionBind3R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(3); #else set_argument_count(3); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *, P1, P2, P3) ) { FunctionBind3R * a = memnew( (FunctionBind3R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind3C : public MethodBind { public: void (*method) (const T *, P1, P2, P3); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); #endif (method)(instance, _VC(1), _VC(2), _VC(3)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1])) ; } #endif FunctionBind3C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(3); #else set_argument_count(3); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *, P1, P2, P3) ) { FunctionBind3C * a = memnew( (FunctionBind3C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind3RC : public MethodBind { public: R (*method) (const T *, P1, P2, P3); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1])) ,r_ret) ; } #endif FunctionBind3RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(3); #else set_argument_count(3); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *, P1, P2, P3) ) { FunctionBind3RC * a = memnew( (FunctionBind3RC) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind4 : public MethodBind { public: void (*method) ( T *, P1, P2, P3, P4); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1])) ; } #endif FunctionBind4 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(4); #else set_argument_count(4); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *, P1, P2, P3, P4) ) { FunctionBind4 * a = memnew( (FunctionBind4) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind4R : public MethodBind { public: R (*method) ( T *, P1, P2, P3, P4); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1])) ,r_ret) ; } #endif FunctionBind4R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(4); #else set_argument_count(4); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *, P1, P2, P3, P4) ) { FunctionBind4R * a = memnew( (FunctionBind4R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind4C : public MethodBind { public: void (*method) (const T *, P1, P2, P3, P4); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1])) ; } #endif FunctionBind4C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(4); #else set_argument_count(4); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *, P1, P2, P3, P4) ) { FunctionBind4C * a = memnew( (FunctionBind4C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind4RC : public MethodBind { public: R (*method) (const T *, P1, P2, P3, P4); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1])) ,r_ret) ; } #endif FunctionBind4RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(4); #else set_argument_count(4); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *, P1, P2, P3, P4) ) { FunctionBind4RC * a = memnew( (FunctionBind4RC) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind5 : public MethodBind { public: void (*method) ( T *, P1, P2, P3, P4, P5); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1])) ; } #endif FunctionBind5 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(5); #else set_argument_count(5); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *, P1, P2, P3, P4, P5) ) { FunctionBind5 * a = memnew( (FunctionBind5) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind5R : public MethodBind { public: R (*method) ( T *, P1, P2, P3, P4, P5); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1])) ,r_ret) ; } #endif FunctionBind5R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(5); #else set_argument_count(5); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *, P1, P2, P3, P4, P5) ) { FunctionBind5R * a = memnew( (FunctionBind5R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind5C : public MethodBind { public: void (*method) (const T *, P1, P2, P3, P4, P5); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1])) ; } #endif FunctionBind5C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(5); #else set_argument_count(5); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *, P1, P2, P3, P4, P5) ) { FunctionBind5C * a = memnew( (FunctionBind5C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind5RC : public MethodBind { public: R (*method) (const T *, P1, P2, P3, P4, P5); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1])) ,r_ret) ; } #endif FunctionBind5RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(5); #else set_argument_count(5); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *, P1, P2, P3, P4, P5) ) { FunctionBind5RC * a = memnew( (FunctionBind5RC) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind6 : public MethodBind { public: void (*method) ( T *, P1, P2, P3, P4, P5, P6); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1])) ; } #endif FunctionBind6 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(6); #else set_argument_count(6); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *, P1, P2, P3, P4, P5, P6) ) { FunctionBind6 * a = memnew( (FunctionBind6) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind6R : public MethodBind { public: R (*method) ( T *, P1, P2, P3, P4, P5, P6); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1])) ,r_ret) ; } #endif FunctionBind6R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(6); #else set_argument_count(6); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *, P1, P2, P3, P4, P5, P6) ) { FunctionBind6R * a = memnew( (FunctionBind6R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind6C : public MethodBind { public: void (*method) (const T *, P1, P2, P3, P4, P5, P6); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1])) ; } #endif FunctionBind6C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(6); #else set_argument_count(6); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *, P1, P2, P3, P4, P5, P6) ) { FunctionBind6C * a = memnew( (FunctionBind6C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind6RC : public MethodBind { public: R (*method) (const T *, P1, P2, P3, P4, P5, P6); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1])) ,r_ret) ; } #endif FunctionBind6RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(6); #else set_argument_count(6); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *, P1, P2, P3, P4, P5, P6) ) { FunctionBind6RC * a = memnew( (FunctionBind6RC) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind7 : public MethodBind { public: void (*method) ( T *, P1, P2, P3, P4, P5, P6, P7); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1])) ; } #endif FunctionBind7 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(7); #else set_argument_count(7); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7) ) { FunctionBind7 * a = memnew( (FunctionBind7) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind7R : public MethodBind { public: R (*method) ( T *, P1, P2, P3, P4, P5, P6, P7); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1])) ,r_ret) ; } #endif FunctionBind7R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(7); #else set_argument_count(7); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7) ) { FunctionBind7R * a = memnew( (FunctionBind7R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind7C : public MethodBind { public: void (*method) (const T *, P1, P2, P3, P4, P5, P6, P7); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1])) ; } #endif FunctionBind7C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(7); #else set_argument_count(7); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7) ) { FunctionBind7C * a = memnew( (FunctionBind7C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind7RC : public MethodBind { public: R (*method) (const T *, P1, P2, P3, P4, P5, P6, P7); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1])) ,r_ret) ; } #endif FunctionBind7RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(7); #else set_argument_count(7); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7) ) { FunctionBind7RC * a = memnew( (FunctionBind7RC) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind8 : public MethodBind { public: void (*method) ( T *, P1, P2, P3, P4, P5, P6, P7, P8); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1])) ; } #endif FunctionBind8 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(8); #else set_argument_count(8); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7, P8) ) { FunctionBind8 * a = memnew( (FunctionBind8) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind8R : public MethodBind { public: R (*method) ( T *, P1, P2, P3, P4, P5, P6, P7, P8); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1])) ,r_ret) ; } #endif FunctionBind8R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(8); #else set_argument_count(8); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7, P8) ) { FunctionBind8R * a = memnew( (FunctionBind8R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind8C : public MethodBind { public: void (*method) (const T *, P1, P2, P3, P4, P5, P6, P7, P8); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1])) ; } #endif FunctionBind8C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(8); #else set_argument_count(8); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7, P8) ) { FunctionBind8C * a = memnew( (FunctionBind8C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind8RC : public MethodBind { public: R (*method) (const T *, P1, P2, P3, P4, P5, P6, P7, P8); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1])) ,r_ret) ; } #endif FunctionBind8RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(8); #else set_argument_count(8); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7, P8) ) { FunctionBind8RC * a = memnew( (FunctionBind8RC) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind9 : public MethodBind { public: void (*method) ( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1])) ; } #endif FunctionBind9 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(9); #else set_argument_count(9); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9) ) { FunctionBind9 * a = memnew( (FunctionBind9) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind9R : public MethodBind { public: R (*method) ( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1])) ,r_ret) ; } #endif FunctionBind9R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(9); #else set_argument_count(9); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9) ) { FunctionBind9R * a = memnew( (FunctionBind9R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind9C : public MethodBind { public: void (*method) (const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1])) ; } #endif FunctionBind9C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(9); #else set_argument_count(9); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9) ) { FunctionBind9C * a = memnew( (FunctionBind9C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind9RC : public MethodBind { public: R (*method) (const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1])) ,r_ret) ; } #endif FunctionBind9RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(9); #else set_argument_count(9); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9) ) { FunctionBind9RC * a = memnew( (FunctionBind9RC) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind10 : public MethodBind { public: void (*method) ( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1])) ; } #endif FunctionBind10 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(10); #else set_argument_count(10); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) ) { FunctionBind10 * a = memnew( (FunctionBind10) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind10R : public MethodBind { public: R (*method) ( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1])) ,r_ret) ; } #endif FunctionBind10R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(10); #else set_argument_count(10); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) ) { FunctionBind10R * a = memnew( (FunctionBind10R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind10C : public MethodBind { public: void (*method) (const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1])) ; } #endif FunctionBind10C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(10); #else set_argument_count(10); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) ) { FunctionBind10C * a = memnew( (FunctionBind10C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind10RC : public MethodBind { public: R (*method) (const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1])) ,r_ret) ; } #endif FunctionBind10RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(10); #else set_argument_count(10); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) ) { FunctionBind10RC * a = memnew( (FunctionBind10RC) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind11 : public MethodBind { public: void (*method) ( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; if (p_arg==(11-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(11-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); if (p_argument==(11-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); CHECK_ARG(11); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10), _VC(11)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1]), PtrToArg::convert(p_args[11-1])) ; } #endif FunctionBind11 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(11); #else set_argument_count(11); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) ) { FunctionBind11 * a = memnew( (FunctionBind11) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind11R : public MethodBind { public: R (*method) ( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; if (p_arg==(11-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(11-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); if (p_argument==(11-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); CHECK_ARG(11); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10), _VC(11)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1]), PtrToArg::convert(p_args[11-1])) ,r_ret) ; } #endif FunctionBind11R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(11); #else set_argument_count(11); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) ) { FunctionBind11R * a = memnew( (FunctionBind11R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind11C : public MethodBind { public: void (*method) (const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; if (p_arg==(11-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(11-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); if (p_argument==(11-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); CHECK_ARG(11); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10), _VC(11)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1]), PtrToArg::convert(p_args[11-1])) ; } #endif FunctionBind11C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(11); #else set_argument_count(11); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) ) { FunctionBind11C * a = memnew( (FunctionBind11C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind11RC : public MethodBind { public: R (*method) (const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; if (p_arg==(11-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(11-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); if (p_argument==(11-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); CHECK_ARG(11); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10), _VC(11)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1]), PtrToArg::convert(p_args[11-1])) ,r_ret) ; } #endif FunctionBind11RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(11); #else set_argument_count(11); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) ) { FunctionBind11RC * a = memnew( (FunctionBind11RC) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind12 : public MethodBind { public: void (*method) ( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; if (p_arg==(11-1)) return GetTypeInfo::METADATA; if (p_arg==(12-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(11-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(12-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); if (p_argument==(11-1)) return GetTypeInfo::get_class_info(); if (p_argument==(12-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); CHECK_ARG(11); CHECK_ARG(12); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10), _VC(11), _VC(12)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1]), PtrToArg::convert(p_args[11-1]), PtrToArg::convert(p_args[12-1])) ; } #endif FunctionBind12 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(12); #else set_argument_count(12); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) ) { FunctionBind12 * a = memnew( (FunctionBind12) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind12R : public MethodBind { public: R (*method) ( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; if (p_arg==(11-1)) return GetTypeInfo::METADATA; if (p_arg==(12-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(11-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(12-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); if (p_argument==(11-1)) return GetTypeInfo::get_class_info(); if (p_argument==(12-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); CHECK_ARG(11); CHECK_ARG(12); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10), _VC(11), _VC(12)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1]), PtrToArg::convert(p_args[11-1]), PtrToArg::convert(p_args[12-1])) ,r_ret) ; } #endif FunctionBind12R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(12); #else set_argument_count(12); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) ) { FunctionBind12R * a = memnew( (FunctionBind12R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind12C : public MethodBind { public: void (*method) (const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; if (p_arg==(11-1)) return GetTypeInfo::METADATA; if (p_arg==(12-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(11-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(12-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); if (p_argument==(11-1)) return GetTypeInfo::get_class_info(); if (p_argument==(12-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); CHECK_ARG(11); CHECK_ARG(12); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10), _VC(11), _VC(12)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1]), PtrToArg::convert(p_args[11-1]), PtrToArg::convert(p_args[12-1])) ; } #endif FunctionBind12C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(12); #else set_argument_count(12); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) ) { FunctionBind12C * a = memnew( (FunctionBind12C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind12RC : public MethodBind { public: R (*method) (const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; if (p_arg==(11-1)) return GetTypeInfo::METADATA; if (p_arg==(12-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(11-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(12-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); if (p_argument==(11-1)) return GetTypeInfo::get_class_info(); if (p_argument==(12-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); CHECK_ARG(11); CHECK_ARG(12); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10), _VC(11), _VC(12)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1]), PtrToArg::convert(p_args[11-1]), PtrToArg::convert(p_args[12-1])) ,r_ret) ; } #endif FunctionBind12RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(12); #else set_argument_count(12); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) ) { FunctionBind12RC * a = memnew( (FunctionBind12RC) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind13 : public MethodBind { public: void (*method) ( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; if (p_arg==(11-1)) return GetTypeInfo::METADATA; if (p_arg==(12-1)) return GetTypeInfo::METADATA; if (p_arg==(13-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(11-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(12-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(13-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); if (p_argument==(11-1)) return GetTypeInfo::get_class_info(); if (p_argument==(12-1)) return GetTypeInfo::get_class_info(); if (p_argument==(13-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); CHECK_ARG(11); CHECK_ARG(12); CHECK_ARG(13); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10), _VC(11), _VC(12), _VC(13)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1]), PtrToArg::convert(p_args[11-1]), PtrToArg::convert(p_args[12-1]), PtrToArg::convert(p_args[13-1])) ; } #endif FunctionBind13 () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(13); #else set_argument_count(13); #endif }; }; template MethodBind* create_method_bind( void (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13) ) { FunctionBind13 * a = memnew( (FunctionBind13) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind13R : public MethodBind { public: R (*method) ( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; if (p_arg==(11-1)) return GetTypeInfo::METADATA; if (p_arg==(12-1)) return GetTypeInfo::METADATA; if (p_arg==(13-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(11-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(12-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(13-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); if (p_argument==(11-1)) return GetTypeInfo::get_class_info(); if (p_argument==(12-1)) return GetTypeInfo::get_class_info(); if (p_argument==(13-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); CHECK_ARG(11); CHECK_ARG(12); CHECK_ARG(13); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10), _VC(11), _VC(12), _VC(13)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1]), PtrToArg::convert(p_args[11-1]), PtrToArg::convert(p_args[12-1]), PtrToArg::convert(p_args[13-1])) ,r_ret) ; } #endif FunctionBind13R () { #ifdef DEBUG_METHODS_ENABLED _set_const(false); _generate_argument_types(13); #else set_argument_count(13); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)( T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13) ) { FunctionBind13R * a = memnew( (FunctionBind13R) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind13C : public MethodBind { public: void (*method) (const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; if (p_arg==(11-1)) return GetTypeInfo::METADATA; if (p_arg==(12-1)) return GetTypeInfo::METADATA; if (p_arg==(13-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(11-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(12-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(13-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); if (p_argument==(11-1)) return GetTypeInfo::get_class_info(); if (p_argument==(12-1)) return GetTypeInfo::get_class_info(); if (p_argument==(13-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); CHECK_ARG(11); CHECK_ARG(12); CHECK_ARG(13); #endif (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10), _VC(11), _VC(12), _VC(13)); return Variant(); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1]), PtrToArg::convert(p_args[11-1]), PtrToArg::convert(p_args[12-1]), PtrToArg::convert(p_args[13-1])) ; } #endif FunctionBind13C () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(13); #else set_argument_count(13); #endif }; }; template MethodBind* create_method_bind( void (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13) ) { FunctionBind13C * a = memnew( (FunctionBind13C) ); a->method=p_method; return a; } #endif #ifdef TYPED_METHOD_BIND template class FunctionBind13RC : public MethodBind { public: R (*method) (const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); } virtual PandemoniumTypeInfo::Metadata get_argument_meta(int p_arg) const { if (p_arg==-1) return GetTypeInfo::METADATA; if (p_arg==(1-1)) return GetTypeInfo::METADATA; if (p_arg==(2-1)) return GetTypeInfo::METADATA; if (p_arg==(3-1)) return GetTypeInfo::METADATA; if (p_arg==(4-1)) return GetTypeInfo::METADATA; if (p_arg==(5-1)) return GetTypeInfo::METADATA; if (p_arg==(6-1)) return GetTypeInfo::METADATA; if (p_arg==(7-1)) return GetTypeInfo::METADATA; if (p_arg==(8-1)) return GetTypeInfo::METADATA; if (p_arg==(9-1)) return GetTypeInfo::METADATA; if (p_arg==(10-1)) return GetTypeInfo::METADATA; if (p_arg==(11-1)) return GetTypeInfo::METADATA; if (p_arg==(12-1)) return GetTypeInfo::METADATA; if (p_arg==(13-1)) return GetTypeInfo::METADATA; return PandemoniumTypeInfo::METADATA_NONE; } Variant::Type _get_argument_type(int p_argument) const { if (p_argument==-1) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(1-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(2-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(3-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(4-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(5-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(6-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(7-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(8-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(9-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(10-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(11-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(12-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; if (p_argument==(13-1)) return (Variant::Type)GetTypeInfo::VARIANT_TYPE; return Variant::NIL; } virtual PropertyInfo _gen_argument_type_info(int p_argument) const { if (p_argument==-1) return GetTypeInfo::get_class_info(); if (p_argument==(1-1)) return GetTypeInfo::get_class_info(); if (p_argument==(2-1)) return GetTypeInfo::get_class_info(); if (p_argument==(3-1)) return GetTypeInfo::get_class_info(); if (p_argument==(4-1)) return GetTypeInfo::get_class_info(); if (p_argument==(5-1)) return GetTypeInfo::get_class_info(); if (p_argument==(6-1)) return GetTypeInfo::get_class_info(); if (p_argument==(7-1)) return GetTypeInfo::get_class_info(); if (p_argument==(8-1)) return GetTypeInfo::get_class_info(); if (p_argument==(9-1)) return GetTypeInfo::get_class_info(); if (p_argument==(10-1)) return GetTypeInfo::get_class_info(); if (p_argument==(11-1)) return GetTypeInfo::get_class_info(); if (p_argument==(12-1)) return GetTypeInfo::get_class_info(); if (p_argument==(13-1)) return GetTypeInfo::get_class_info(); return PropertyInfo(); } #endif virtual String get_instance_class() const { return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { T *instance=Object::cast_to(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } CHECK_ARG(1); CHECK_ARG(2); CHECK_ARG(3); CHECK_ARG(4); CHECK_ARG(5); CHECK_ARG(6); CHECK_ARG(7); CHECK_ARG(8); CHECK_ARG(9); CHECK_ARG(10); CHECK_ARG(11); CHECK_ARG(12); CHECK_ARG(13); #endif Variant ret = (method)(instance, _VC(1), _VC(2), _VC(3), _VC(4), _VC(5), _VC(6), _VC(7), _VC(8), _VC(9), _VC(10), _VC(11), _VC(12), _VC(13)); return Variant(ret); } #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { T *instance=Object::cast_to(p_object); PtrToArg::encode( (method)(instance, PtrToArg::convert(p_args[1-1]), PtrToArg::convert(p_args[2-1]), PtrToArg::convert(p_args[3-1]), PtrToArg::convert(p_args[4-1]), PtrToArg::convert(p_args[5-1]), PtrToArg::convert(p_args[6-1]), PtrToArg::convert(p_args[7-1]), PtrToArg::convert(p_args[8-1]), PtrToArg::convert(p_args[9-1]), PtrToArg::convert(p_args[10-1]), PtrToArg::convert(p_args[11-1]), PtrToArg::convert(p_args[12-1]), PtrToArg::convert(p_args[13-1])) ,r_ret) ; } #endif FunctionBind13RC () { #ifdef DEBUG_METHODS_ENABLED _set_const(true); _generate_argument_types(13); #else set_argument_count(13); #endif _set_returns(true); }; }; template MethodBind* create_method_bind(R (*p_method)(const T *, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13) ) { FunctionBind13RC * a = memnew( (FunctionBind13RC) ); a->method=p_method; return a; } #endif #endif