// // SqratOverloadMethods: Overload Methods // // // Copyright (c) 2009 Brandon Jones // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source // distribution. // #if !defined(_SQRAT_OVERLOAD_METHODS_H_) #define _SQRAT_OVERLOAD_METHODS_H_ #ifdef SQMOD_PLUGIN_API #include #else #include #endif // SQMOD_PLUGIN_API #include #include "sqratTypes.h" #include "sqratUtil.h" #include "sqratGlobalMethods.h" #include "sqratMemberMethods.h" namespace Sqrat { /// @cond DEV // // Overload name generator // class SqOverloadName { public: static string Get(const SQChar* name, int args) { std::basic_stringstream overloadName; overloadName << _SC("__overload_") << name << args; return overloadName.str(); } }; // // Squirrel Overload Functions // template class SqOverload { public: static SQInteger Func(HSQUIRRELVM vm) { // Get the arg count int argCount = sq_gettop(vm) - 2; const SQChar* funcName; sq_getstring(vm, -1, &funcName); // get the function name (free variable) string overloadName = SqOverloadName::Get(funcName, argCount); sq_pushstring(vm, overloadName.c_str(), -1); #if !defined (SCRAT_NO_ERROR_CHECKING) if (SQ_FAILED(sq_get(vm, 1))) { // Lookup the proper overload return sq_throwerror(vm, _SC("wrong number of parameters")); } #else sq_get(vm, 1); #endif // Push the args again for (int i = 1; i <= argCount + 1; ++i) { sq_push(vm, i); } #if !defined (SCRAT_NO_ERROR_CHECKING) SQRESULT result = sq_call(vm, argCount + 1, true, ErrorHandling::IsEnabled()); if (SQ_FAILED(result)) { return sq_throwerror(vm, LastErrorString(vm).c_str()); } #else sq_call(vm, argCount + 1, true, ErrorHandling::IsEnabled()); #endif return 1; } }; // // void return specialization // template <> class SqOverload { public: static SQInteger Func(HSQUIRRELVM vm) { // Get the arg count int argCount = sq_gettop(vm) - 2; const SQChar* funcName; sq_getstring(vm, -1, &funcName); // get the function name (free variable) string overloadName = SqOverloadName::Get(funcName, argCount); sq_pushstring(vm, overloadName.c_str(), -1); #if !defined (SCRAT_NO_ERROR_CHECKING) if (SQ_FAILED(sq_get(vm, 1))) { // Lookup the proper overload return sq_throwerror(vm, _SC("wrong number of parameters")); } #else sq_get(vm, 1); #endif // Push the args again for (int i = 1; i <= argCount + 1; ++i) { sq_push(vm, i); } #if !defined (SCRAT_NO_ERROR_CHECKING) SQRESULT result = sq_call(vm, argCount + 1, false, ErrorHandling::IsEnabled()); if (SQ_FAILED(result)) { return sq_throwerror(vm, LastErrorString(vm).c_str()); } #else sq_call(vm, argCount + 1, false, ErrorHandling::IsEnabled()); #endif return 0; } }; // // Global Overloaded Function Resolvers // // Arg Count 0 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)()) { return &SqGlobal::template Func0; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)()) { return &SqGlobal::template Func0; } // Arg Count 1 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1)) { return &SqGlobal::template Func1; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1)) { return &SqGlobal::template Func1; } // Arg Count 2 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1, A2)) { return &SqGlobal::template Func2; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1, A2)) { return &SqGlobal::template Func2; } // Arg Count 3 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3)) { return &SqGlobal::template Func3; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3)) { return &SqGlobal::template Func3; } // Arg Count 4 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4)) { return &SqGlobal::template Func4; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4)) { return &SqGlobal::template Func4; } // Arg Count 5 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5)) { return &SqGlobal::template Func5; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5)) { return &SqGlobal::template Func5; } // Arg Count 6 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6)) { return &SqGlobal::template Func6; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6)) { return &SqGlobal::template Func6; } // Arg Count 7 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7)) { return &SqGlobal::template Func7; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7)) { return &SqGlobal::template Func7; } // Arg Count 8 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8)) { return &SqGlobal::template Func8; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8)) { return &SqGlobal::template Func8; } // Arg Count 9 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { return &SqGlobal::template Func9; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { return &SqGlobal::template Func9; } // Arg Count 10 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { return &SqGlobal::template Func10; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { return &SqGlobal::template Func10; } // Arg Count 11 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)) { return &SqGlobal::template Func11; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)) { return &SqGlobal::template Func11; } // Arg Count 12 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)) { return &SqGlobal::template Func12; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)) { return &SqGlobal::template Func12; } // Arg Count 13 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)) { return &SqGlobal::template Func13; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)) { return &SqGlobal::template Func13; } // Arg Count 14 template SQFUNCTION SqGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)) { return &SqGlobal::template Func14; } template SQFUNCTION SqGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)) { return &SqGlobal::template Func14; } // // Member Global Overloaded Function Resolvers // // Arg Count 1 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1)) { return &SqGlobal::template Func1; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1)) { return &SqGlobal::template Func1; } // Arg Count 2 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1, A2)) { return &SqGlobal::template Func2; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1, A2)) { return &SqGlobal::template Func2; } // Arg Count 3 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3)) { return &SqGlobal::template Func3; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3)) { return &SqGlobal::template Func3; } // Arg Count 4 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4)) { return &SqGlobal::template Func4; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4)) { return &SqGlobal::template Func4; } // Arg Count 5 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5)) { return &SqGlobal::template Func5; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5)) { return &SqGlobal::template Func5; } // Arg Count 6 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6)) { return &SqGlobal::template Func6; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6)) { return &SqGlobal::template Func6; } // Arg Count 7 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7)) { return &SqGlobal::template Func7; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7)) { return &SqGlobal::template Func7; } // Arg Count 8 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8)) { return &SqGlobal::template Func8; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8)) { return &SqGlobal::template Func8; } // Arg Count 9 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { return &SqGlobal::template Func9; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { return &SqGlobal::template Func9; } // Arg Count 10 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { return &SqGlobal::template Func10; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { return &SqGlobal::template Func10; } // Arg Count 11 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)) { return &SqGlobal::template Func11; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)) { return &SqGlobal::template Func11; } // Arg Count 12 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)) { return &SqGlobal::template Func12; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)) { return &SqGlobal::template Func12; } // Arg Count 13 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)) { return &SqGlobal::template Func13; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)) { return &SqGlobal::template Func13; } // Arg Count 14 template SQFUNCTION SqMemberGlobalOverloadedFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)) { return &SqGlobal::template Func14; } template SQFUNCTION SqMemberGlobalOverloadedFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)) { return &SqGlobal::template Func14; } // // Member Overloaded Function Resolvers // // Arg Count 0 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)()) { return &SqMember::template Func0; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)() const) { return &SqMember::template Func0C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)()) { return &SqMember::template Func0; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)() const) { return &SqMember::template Func0C; } // Arg Count 1 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1)) { return &SqMember::template Func1; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1) const) { return &SqMember::template Func1C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1)) { return &SqMember::template Func1; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1) const) { return &SqMember::template Func1C; } // Arg Count 2 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2)) { return &SqMember::template Func2; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2) const) { return &SqMember::template Func2C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2)) { return &SqMember::template Func2; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2) const) { return &SqMember::template Func2C; } // Arg Count 3 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3)) { return &SqMember::template Func3; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3) const) { return &SqMember::template Func3C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3)) { return &SqMember::template Func3; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3) const) { return &SqMember::template Func3C; } // Arg Count 4 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4)) { return &SqMember::template Func4; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4) const) { return &SqMember::template Func4C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4)) { return &SqMember::template Func4; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4) const) { return &SqMember::template Func4C; } // Arg Count 5 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5)) { return &SqMember::template Func5; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5) const) { return &SqMember::template Func5C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5)) { return &SqMember::template Func5; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5) const) { return &SqMember::template Func5C; } // Arg Count 6 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6)) { return &SqMember::template Func6; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6) const) { return &SqMember::template Func6C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6)) { return &SqMember::template Func6; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6) const) { return &SqMember::template Func6C; } // Arg Count 7 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7)) { return &SqMember::template Func7; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7) const) { return &SqMember::template Func7C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7)) { return &SqMember::template Func7; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7) const) { return &SqMember::template Func7C; } // Arg Count 8 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8)) { return &SqMember::template Func8; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8) const) { return &SqMember::template Func8C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8)) { return &SqMember::template Func8; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8) const) { return &SqMember::template Func8C; } // Arg Count 9 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { return &SqMember::template Func9; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9) const) { return &SqMember::template Func9C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { return &SqMember::template Func9; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9) const) { return &SqMember::template Func9C; } // Arg Count 10 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { return &SqMember::template Func10; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) const) { return &SqMember::template Func10C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { return &SqMember::template Func10; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) const) { return &SqMember::template Func10C; } // Arg Count 11 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)) { return &SqMember::template Func11; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) const) { return &SqMember::template Func11C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)) { return &SqMember::template Func11; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) const) { return &SqMember::template Func11C; } // Arg Count 12 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)) { return &SqMember::template Func12; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) const) { return &SqMember::template Func12C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)) { return &SqMember::template Func12; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) const) { return &SqMember::template Func12C; } // Arg Count 13 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)) { return &SqMember::template Func13; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) const) { return &SqMember::template Func13C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)) { return &SqMember::template Func13; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) const) { return &SqMember::template Func13C; } // Arg Count 14 template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)) { return &SqMember::template Func14; } template inline SQFUNCTION SqMemberOverloadedFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) const) { return &SqMember::template Func14C; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)) { return &SqMember::template Func14; } template inline SQFUNCTION SqMemberOverloadedFunc(R& (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) const) { return &SqMember::template Func14C; } // // Overload handler resolver // template inline SQFUNCTION SqOverloadFunc(R (* /*method*/)) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)() const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1) const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1, A2) const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1, A2, A3) const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1, A2, A3, A4) const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5) const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6) const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7) const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8) const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9) const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) const ) { return &SqOverload::Func; } template inline SQFUNCTION SqOverloadFunc(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) const ) { return &SqOverload::Func; } // // Query argument count // // Arg Count 0 template inline int SqGetArgCount(R (* /*method*/)()) { return 0; } // Arg Count 1 template inline int SqGetArgCount(R (* /*method*/)(A1)) { return 1; } // Arg Count 2 template inline int SqGetArgCount(R (* /*method*/)(A1, A2)) { return 2; } // Arg Count 3 template inline int SqGetArgCount(R (* /*method*/)(A1, A2, A3)) { return 3; } // Arg Count 4 template inline int SqGetArgCount(R (* /*method*/)(A1, A2, A3, A4)) { return 4; } // Arg Count 5 template inline int SqGetArgCount(R (* /*method*/)(A1, A2, A3, A4, A5)) { return 5; } // Arg Count 6 template inline int SqGetArgCount(R (* /*method*/)(A1, A2, A3, A4, A5, A6)) { return 6; } // Arg Count 7 template inline int SqGetArgCount(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7)) { return 7; } // Arg Count 8 template inline int SqGetArgCount(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8)) { return 8; } // Arg Count 9 template inline int SqGetArgCount(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { return 9; } // Arg Count 10 template inline int SqGetArgCount(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { return 10; } // Arg Count 11 template inline int SqGetArgCount(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)) { return 11; } // Arg Count 12 template inline int SqGetArgCount(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)) { return 12; } // Arg Count 13 template inline int SqGetArgCount(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)) { return 13; } // Arg Count 14 template inline int SqGetArgCount(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)) { return 14; } // // Query member function argument count // // Arg Count 0 template inline int SqGetArgCount(R (C::* /*method*/)()) { return 0; } // Arg Count 1 template inline int SqGetArgCount(R (C::* /*method*/)(A1)) { return 1; } // Arg Count 2 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2)) { return 2; } // Arg Count 3 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3)) { return 3; } // Arg Count 4 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4)) { return 4; } // Arg Count 5 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5)) { return 5; } // Arg Count 6 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6)) { return 6; } // Arg Count 7 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7)) { return 7; } // Arg Count 8 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8)) { return 8; } // Arg Count 9 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { return 9; } // Arg Count 10 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { return 10; } // Arg Count 11 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)) { return 11; } // Arg Count 12 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)) { return 12; } // Arg Count 13 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)) { return 13; } // Arg Count 14 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)) { return 14; } // // Query const member function argument count // // Arg Count 0 template inline int SqGetArgCount(R (C::* /*method*/)() const) { return 0; } // Arg Count 1 template inline int SqGetArgCount(R (C::* /*method*/)(A1) const) { return 1; } // Arg Count 2 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2) const) { return 2; } // Arg Count 3 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3) const) { return 3; } // Arg Count 4 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4) const) { return 4; } // Arg Count 5 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5) const) { return 5; } // Arg Count 6 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6) const) { return 6; } // Arg Count 7 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7) const) { return 7; } // Arg Count 8 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8) const) { return 8; } // Arg Count 9 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9) const) { return 9; } // Arg Count 10 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) const) { return 10; } // Arg Count 11 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) const) { return 11; } // Arg Count 12 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) const) { return 12; } // Arg Count 13 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) const) { return 13; } // Arg Count 14 template inline int SqGetArgCount(R (C::* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) const) { return 14; } /// @endcond } #endif