From c977e74afd18afff8729070f631e6b7a3f2887f5 Mon Sep 17 00:00:00 2001 From: Vitaly Fanaskov Date: Wed, 26 Feb 2020 15:22:40 +0100 Subject: QtConcurrent::run: accept more then five function's arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ChangeLog][Potentially Source-Incompatible Changes] QtConcurrent::run has the following signatures: run(Function &&f, Args &&...args) and run(QThreadPool *pool, Function &&f, Args &&...args). If f is a member pointer, the first argument of args should be an object for which that member is defined (or a reference, or a pointer to it). See the documentation for more details. Fixes: QTBUG-82383 Change-Id: I18f7fcfb2adbdd9f75b29c346bd3516304e32d31 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Sona Kurazyan --- src/concurrent/qtconcurrentstoredfunctioncall.h | 2206 +---------------------- 1 file changed, 26 insertions(+), 2180 deletions(-) (limited to 'src/concurrent/qtconcurrentstoredfunctioncall.h') diff --git a/src/concurrent/qtconcurrentstoredfunctioncall.h b/src/concurrent/qtconcurrentstoredfunctioncall.h index 209832e5bbf..e2d0e3de0fd 100644 --- a/src/concurrent/qtconcurrentstoredfunctioncall.h +++ b/src/concurrent/qtconcurrentstoredfunctioncall.h @@ -37,7 +37,6 @@ ** ****************************************************************************/ -// Generated code, do not edit! Use generator at tools/qtconcurrent/generaterun/ #ifndef QTCONCURRENT_STOREDFUNCTIONCALL_H #define QTCONCURRENT_STOREDFUNCTIONCALL_H @@ -45,6 +44,7 @@ #ifndef QT_NO_CONCURRENT #include +#include QT_BEGIN_NAMESPACE @@ -52,2204 +52,50 @@ QT_BEGIN_NAMESPACE #ifndef Q_QDOC namespace QtConcurrent { -template -struct StoredFunctorCall0: public RunFunctionTask -{ - inline StoredFunctorCall0(FunctionPointer _function) - : function(_function) {} - void runFunctor() override { this->result = function(); } - FunctionPointer function; - -}; - -template -struct StoredFunctorCall0: public RunFunctionTask -{ - inline StoredFunctorCall0(FunctionPointer _function) - : function(_function) {} - void runFunctor() override { function(); } - FunctionPointer function; - -}; - -template -struct StoredFunctorPointerCall0: public RunFunctionTask -{ - inline StoredFunctorPointerCall0(FunctionPointer * _function) - : function(_function) {} - void runFunctor() override { this->result =(*function)(); } - FunctionPointer * function; - -}; - -template -struct VoidStoredFunctorPointerCall0: public RunFunctionTask -{ - inline VoidStoredFunctorPointerCall0(FunctionPointer * _function) - : function(_function) {} - void runFunctor() override { (*function)(); } - FunctionPointer * function; - -}; - -template -struct SelectStoredFunctorPointerCall0 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredFunctorPointerCall0 >::type type; -}; -template -class StoredMemberFunctionCall0 : public RunFunctionTask -{ -public: - StoredMemberFunctionCall0(T (Class::*_fn)(), const Class &_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - this->result = (object.*fn)(); - } -private: - T (Class::*fn)(); - Class object; - -}; -template -class VoidStoredMemberFunctionCall0 : public RunFunctionTask -{ -public: - VoidStoredMemberFunctionCall0(T (Class::*_fn)(), const Class &_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - (object.*fn)(); - } -private: - T (Class::*fn)(); - Class object; - -}; -template -struct SelectStoredMemberFunctionCall0 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredMemberFunctionCall0 >::type type; -}; -template -class StoredConstMemberFunctionCall0 : public RunFunctionTask -{ -public: - StoredConstMemberFunctionCall0(T (Class::*_fn)() const, const Class &_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - this->result = (object.*fn)(); - } -private: - T (Class::*fn)() const; - const Class object; - -}; -template -class VoidStoredConstMemberFunctionCall0 : public RunFunctionTask -{ -public: - VoidStoredConstMemberFunctionCall0(T (Class::*_fn)() const, const Class &_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - (object.*fn)(); - } -private: - T (Class::*fn)() const; - const Class object; - -}; -template -struct SelectStoredConstMemberFunctionCall0 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstMemberFunctionCall0 >::type type; -}; -template -class StoredMemberFunctionPointerCall0 : public RunFunctionTask -{ -public: - StoredMemberFunctionPointerCall0(T (Class::*_fn)(), Class *_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - this->result = (object->*fn)(); - } -private: - T (Class::*fn)(); - Class *object; - -}; -template -class VoidStoredMemberFunctionPointerCall0 : public RunFunctionTask -{ -public: - VoidStoredMemberFunctionPointerCall0(T (Class::*_fn)(), Class *_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - (object->*fn)(); - } -private: - T (Class::*fn)(); - Class *object; - -}; -template -struct SelectStoredMemberFunctionPointerCall0 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredMemberFunctionPointerCall0 >::type type; -}; -template -class StoredConstMemberFunctionPointerCall0 : public RunFunctionTask -{ -public: - StoredConstMemberFunctionPointerCall0(T (Class::*_fn)() const, Class const *_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - this->result = (object->*fn)(); - } -private: - T (Class::*fn)() const; - Class const *object; - -}; -template -class VoidStoredConstMemberFunctionPointerCall0 : public RunFunctionTask -{ -public: - VoidStoredConstMemberFunctionPointerCall0(T (Class::*_fn)() const, Class const *_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - (object->*fn)(); - } -private: - T (Class::*fn)() const; - Class const *object; - -}; -template -struct SelectStoredConstMemberFunctionPointerCall0 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstMemberFunctionPointerCall0 >::type type; -}; -#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 -template -class StoredNoExceptMemberFunctionCall0 : public RunFunctionTask -{ -public: - StoredNoExceptMemberFunctionCall0(T (Class::*_fn)() noexcept, const Class &_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - this->result = (object.*fn)(); - } -private: - T (Class::*fn)() noexcept; - Class object; - -}; -template -class VoidStoredNoExceptMemberFunctionCall0 : public RunFunctionTask -{ -public: - VoidStoredNoExceptMemberFunctionCall0(T (Class::*_fn)() noexcept, const Class &_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - (object.*fn)(); - } -private: - T (Class::*fn)() noexcept; - Class object; - -}; -template -struct SelectStoredNoExceptMemberFunctionCall0 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredNoExceptMemberFunctionCall0 >::type type; -}; -template -class StoredConstNoExceptMemberFunctionCall0 : public RunFunctionTask -{ -public: - StoredConstNoExceptMemberFunctionCall0(T (Class::*_fn)() const noexcept, const Class &_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - this->result = (object.*fn)(); - } -private: - T (Class::*fn)() const noexcept; - const Class object; - -}; -template -class VoidStoredConstNoExceptMemberFunctionCall0 : public RunFunctionTask -{ -public: - VoidStoredConstNoExceptMemberFunctionCall0(T (Class::*_fn)() const noexcept, const Class &_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - (object.*fn)(); - } -private: - T (Class::*fn)() const noexcept; - const Class object; - -}; -template -struct SelectStoredConstNoExceptMemberFunctionCall0 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstNoExceptMemberFunctionCall0 >::type type; -}; -template -class StoredNoExceptMemberFunctionPointerCall0 : public RunFunctionTask -{ -public: - StoredNoExceptMemberFunctionPointerCall0(T (Class::*_fn)() noexcept, Class *_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - this->result = (object->*fn)(); - } -private: - T (Class::*fn)() noexcept; - Class *object; - -}; -template -class VoidStoredNoExceptMemberFunctionPointerCall0 : public RunFunctionTask -{ -public: - VoidStoredNoExceptMemberFunctionPointerCall0(T (Class::*_fn)() noexcept, Class *_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - (object->*fn)(); - } -private: - T (Class::*fn)() noexcept; - Class *object; - -}; -template -struct SelectStoredNoExceptMemberFunctionPointerCall0 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredNoExceptMemberFunctionPointerCall0 >::type type; -}; -template -class StoredConstNoExceptMemberFunctionPointerCall0 : public RunFunctionTask -{ -public: - StoredConstNoExceptMemberFunctionPointerCall0(T (Class::*_fn)() const noexcept, Class const *_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - this->result = (object->*fn)(); - } -private: - T (Class::*fn)() const noexcept; - Class const *object; - -}; -template -class VoidStoredConstNoExceptMemberFunctionPointerCall0 : public RunFunctionTask -{ -public: - VoidStoredConstNoExceptMemberFunctionPointerCall0(T (Class::*_fn)() const noexcept, Class const *_object) - : fn(_fn), object(_object){ } - - void runFunctor() override - { - (object->*fn)(); - } -private: - T (Class::*fn)() const noexcept; - Class const *object; - -}; -template -struct SelectStoredConstNoExceptMemberFunctionPointerCall0 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstNoExceptMemberFunctionPointerCall0 >::type type; -}; -#endif - -template -struct StoredFunctorCall1: public RunFunctionTask -{ - inline StoredFunctorCall1(FunctionPointer _function, const Arg1 &_arg1) - : function(_function), arg1(_arg1) {} - void runFunctor() override { this->result = function(arg1); } - FunctionPointer function; - Arg1 arg1; -}; - -template -struct StoredFunctorCall1: public RunFunctionTask -{ - inline StoredFunctorCall1(FunctionPointer _function, const Arg1 &_arg1) - : function(_function), arg1(_arg1) {} - void runFunctor() override { function(arg1); } - FunctionPointer function; - Arg1 arg1; -}; - -template -struct StoredFunctorPointerCall1: public RunFunctionTask -{ - inline StoredFunctorPointerCall1(FunctionPointer * _function, const Arg1 &_arg1) - : function(_function), arg1(_arg1) {} - void runFunctor() override { this->result =(*function)(arg1); } - FunctionPointer * function; - Arg1 arg1; -}; - -template -struct VoidStoredFunctorPointerCall1: public RunFunctionTask -{ - inline VoidStoredFunctorPointerCall1(FunctionPointer * _function, const Arg1 &_arg1) - : function(_function), arg1(_arg1) {} - void runFunctor() override { (*function)(arg1); } - FunctionPointer * function; - Arg1 arg1; -}; - -template -struct SelectStoredFunctorPointerCall1 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredFunctorPointerCall1 >::type type; -}; -template -class StoredMemberFunctionCall1 : public RunFunctionTask -{ -public: - StoredMemberFunctionCall1(T (Class::*_fn)(Param1), const Class &_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1); - } -private: - T (Class::*fn)(Param1); - Class object; - Arg1 arg1; -}; -template -class VoidStoredMemberFunctionCall1 : public RunFunctionTask -{ -public: - VoidStoredMemberFunctionCall1(T (Class::*_fn)(Param1), const Class &_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - (object.*fn)(arg1); - } -private: - T (Class::*fn)(Param1); - Class object; - Arg1 arg1; -}; -template -struct SelectStoredMemberFunctionCall1 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredMemberFunctionCall1 >::type type; -}; -template -class StoredConstMemberFunctionCall1 : public RunFunctionTask -{ -public: - StoredConstMemberFunctionCall1(T (Class::*_fn)(Param1) const, const Class &_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1); - } -private: - T (Class::*fn)(Param1) const; - const Class object; - Arg1 arg1; -}; -template -class VoidStoredConstMemberFunctionCall1 : public RunFunctionTask -{ -public: - VoidStoredConstMemberFunctionCall1(T (Class::*_fn)(Param1) const, const Class &_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - (object.*fn)(arg1); - } -private: - T (Class::*fn)(Param1) const; - const Class object; - Arg1 arg1; -}; -template -struct SelectStoredConstMemberFunctionCall1 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstMemberFunctionCall1 >::type type; -}; -template -class StoredMemberFunctionPointerCall1 : public RunFunctionTask -{ -public: - StoredMemberFunctionPointerCall1(T (Class::*_fn)(Param1), Class *_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1); - } -private: - T (Class::*fn)(Param1); - Class *object; - Arg1 arg1; -}; -template -class VoidStoredMemberFunctionPointerCall1 : public RunFunctionTask -{ -public: - VoidStoredMemberFunctionPointerCall1(T (Class::*_fn)(Param1), Class *_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - (object->*fn)(arg1); - } -private: - T (Class::*fn)(Param1); - Class *object; - Arg1 arg1; -}; -template -struct SelectStoredMemberFunctionPointerCall1 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredMemberFunctionPointerCall1 >::type type; -}; -template -class StoredConstMemberFunctionPointerCall1 : public RunFunctionTask -{ -public: - StoredConstMemberFunctionPointerCall1(T (Class::*_fn)(Param1) const, Class const *_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1); - } -private: - T (Class::*fn)(Param1) const; - Class const *object; - Arg1 arg1; -}; -template -class VoidStoredConstMemberFunctionPointerCall1 : public RunFunctionTask -{ -public: - VoidStoredConstMemberFunctionPointerCall1(T (Class::*_fn)(Param1) const, Class const *_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - (object->*fn)(arg1); - } -private: - T (Class::*fn)(Param1) const; - Class const *object; - Arg1 arg1; -}; -template -struct SelectStoredConstMemberFunctionPointerCall1 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstMemberFunctionPointerCall1 >::type type; -}; -#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 -template -class StoredNoExceptMemberFunctionCall1 : public RunFunctionTask -{ -public: - StoredNoExceptMemberFunctionCall1(T (Class::*_fn)(Param1) noexcept, const Class &_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1); - } -private: - T (Class::*fn)(Param1) noexcept; - Class object; - Arg1 arg1; -}; -template -class VoidStoredNoExceptMemberFunctionCall1 : public RunFunctionTask -{ -public: - VoidStoredNoExceptMemberFunctionCall1(T (Class::*_fn)(Param1) noexcept, const Class &_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - (object.*fn)(arg1); - } -private: - T (Class::*fn)(Param1) noexcept; - Class object; - Arg1 arg1; -}; -template -struct SelectStoredNoExceptMemberFunctionCall1 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredNoExceptMemberFunctionCall1 >::type type; -}; -template -class StoredConstNoExceptMemberFunctionCall1 : public RunFunctionTask -{ -public: - StoredConstNoExceptMemberFunctionCall1(T (Class::*_fn)(Param1) const noexcept, const Class &_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1); - } -private: - T (Class::*fn)(Param1) const noexcept; - const Class object; - Arg1 arg1; -}; -template -class VoidStoredConstNoExceptMemberFunctionCall1 : public RunFunctionTask -{ -public: - VoidStoredConstNoExceptMemberFunctionCall1(T (Class::*_fn)(Param1) const noexcept, const Class &_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - (object.*fn)(arg1); - } -private: - T (Class::*fn)(Param1) const noexcept; - const Class object; - Arg1 arg1; -}; -template -struct SelectStoredConstNoExceptMemberFunctionCall1 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstNoExceptMemberFunctionCall1 >::type type; -}; -template -class StoredNoExceptMemberFunctionPointerCall1 : public RunFunctionTask -{ -public: - StoredNoExceptMemberFunctionPointerCall1(T (Class::*_fn)(Param1) noexcept, Class *_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1); - } -private: - T (Class::*fn)(Param1) noexcept; - Class *object; - Arg1 arg1; -}; -template -class VoidStoredNoExceptMemberFunctionPointerCall1 : public RunFunctionTask -{ -public: - VoidStoredNoExceptMemberFunctionPointerCall1(T (Class::*_fn)(Param1) noexcept, Class *_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - (object->*fn)(arg1); - } -private: - T (Class::*fn)(Param1) noexcept; - Class *object; - Arg1 arg1; -}; -template -struct SelectStoredNoExceptMemberFunctionPointerCall1 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredNoExceptMemberFunctionPointerCall1 >::type type; -}; -template -class StoredConstNoExceptMemberFunctionPointerCall1 : public RunFunctionTask -{ -public: - StoredConstNoExceptMemberFunctionPointerCall1(T (Class::*_fn)(Param1) const noexcept, Class const *_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1); - } -private: - T (Class::*fn)(Param1) const noexcept; - Class const *object; - Arg1 arg1; -}; -template -class VoidStoredConstNoExceptMemberFunctionPointerCall1 : public RunFunctionTask -{ -public: - VoidStoredConstNoExceptMemberFunctionPointerCall1(T (Class::*_fn)(Param1) const noexcept, Class const *_object, const Arg1 &_arg1) - : fn(_fn), object(_object), arg1(_arg1){ } - - void runFunctor() override - { - (object->*fn)(arg1); - } -private: - T (Class::*fn)(Param1) const noexcept; - Class const *object; - Arg1 arg1; -}; -template -struct SelectStoredConstNoExceptMemberFunctionPointerCall1 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstNoExceptMemberFunctionPointerCall1 >::type type; -}; -#endif - -template -struct StoredFunctorCall2: public RunFunctionTask -{ - inline StoredFunctorCall2(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2) - : function(_function), arg1(_arg1), arg2(_arg2) {} - void runFunctor() override { this->result = function(arg1, arg2); } - FunctionPointer function; - Arg1 arg1; Arg2 arg2; -}; - -template -struct StoredFunctorCall2: public RunFunctionTask -{ - inline StoredFunctorCall2(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2) - : function(_function), arg1(_arg1), arg2(_arg2) {} - void runFunctor() override { function(arg1, arg2); } - FunctionPointer function; - Arg1 arg1; Arg2 arg2; -}; - -template -struct StoredFunctorPointerCall2: public RunFunctionTask -{ - inline StoredFunctorPointerCall2(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2) - : function(_function), arg1(_arg1), arg2(_arg2) {} - void runFunctor() override { this->result =(*function)(arg1, arg2); } - FunctionPointer * function; - Arg1 arg1; Arg2 arg2; -}; - -template -struct VoidStoredFunctorPointerCall2: public RunFunctionTask -{ - inline VoidStoredFunctorPointerCall2(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2) - : function(_function), arg1(_arg1), arg2(_arg2) {} - void runFunctor() override { (*function)(arg1, arg2); } - FunctionPointer * function; - Arg1 arg1; Arg2 arg2; -}; - -template -struct SelectStoredFunctorPointerCall2 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredFunctorPointerCall2 >::type type; -}; -template -class StoredMemberFunctionCall2 : public RunFunctionTask -{ -public: - StoredMemberFunctionCall2(T (Class::*_fn)(Param1, Param2), const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2); - Class object; - Arg1 arg1; Arg2 arg2; -}; -template -class VoidStoredMemberFunctionCall2 : public RunFunctionTask -{ -public: - VoidStoredMemberFunctionCall2(T (Class::*_fn)(Param1, Param2), const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2); - Class object; - Arg1 arg1; Arg2 arg2; -}; -template -struct SelectStoredMemberFunctionCall2 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredMemberFunctionCall2 >::type type; -}; -template -class StoredConstMemberFunctionCall2 : public RunFunctionTask -{ -public: - StoredConstMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2) const; - const Class object; - Arg1 arg1; Arg2 arg2; -}; -template -class VoidStoredConstMemberFunctionCall2 : public RunFunctionTask -{ -public: - VoidStoredConstMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2) const; - const Class object; - Arg1 arg1; Arg2 arg2; -}; -template -struct SelectStoredConstMemberFunctionCall2 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstMemberFunctionCall2 >::type type; -}; -template -class StoredMemberFunctionPointerCall2 : public RunFunctionTask -{ -public: - StoredMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2), Class *_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2); - Class *object; - Arg1 arg1; Arg2 arg2; -}; -template -class VoidStoredMemberFunctionPointerCall2 : public RunFunctionTask -{ -public: - VoidStoredMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2), Class *_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2); - Class *object; - Arg1 arg1; Arg2 arg2; -}; -template -struct SelectStoredMemberFunctionPointerCall2 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredMemberFunctionPointerCall2 >::type type; -}; -template -class StoredConstMemberFunctionPointerCall2 : public RunFunctionTask -{ -public: - StoredConstMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2) const; - Class const *object; - Arg1 arg1; Arg2 arg2; -}; -template -class VoidStoredConstMemberFunctionPointerCall2 : public RunFunctionTask -{ -public: - VoidStoredConstMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2) const; - Class const *object; - Arg1 arg1; Arg2 arg2; -}; -template -struct SelectStoredConstMemberFunctionPointerCall2 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstMemberFunctionPointerCall2 >::type type; -}; -#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 -template -class StoredNoExceptMemberFunctionCall2 : public RunFunctionTask -{ -public: - StoredNoExceptMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2) noexcept; - Class object; - Arg1 arg1; Arg2 arg2; -}; -template -class VoidStoredNoExceptMemberFunctionCall2 : public RunFunctionTask -{ -public: - VoidStoredNoExceptMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2) noexcept; - Class object; - Arg1 arg1; Arg2 arg2; -}; -template -struct SelectStoredNoExceptMemberFunctionCall2 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredNoExceptMemberFunctionCall2 >::type type; -}; -template -class StoredConstNoExceptMemberFunctionCall2 : public RunFunctionTask -{ -public: - StoredConstNoExceptMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2) const noexcept; - const Class object; - Arg1 arg1; Arg2 arg2; -}; -template -class VoidStoredConstNoExceptMemberFunctionCall2 : public RunFunctionTask -{ -public: - VoidStoredConstNoExceptMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2) const noexcept; - const Class object; - Arg1 arg1; Arg2 arg2; -}; -template -struct SelectStoredConstNoExceptMemberFunctionCall2 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstNoExceptMemberFunctionCall2 >::type type; -}; -template -class StoredNoExceptMemberFunctionPointerCall2 : public RunFunctionTask -{ -public: - StoredNoExceptMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2) noexcept; - Class *object; - Arg1 arg1; Arg2 arg2; -}; -template -class VoidStoredNoExceptMemberFunctionPointerCall2 : public RunFunctionTask -{ -public: - VoidStoredNoExceptMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2) noexcept; - Class *object; - Arg1 arg1; Arg2 arg2; -}; -template -struct SelectStoredNoExceptMemberFunctionPointerCall2 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredNoExceptMemberFunctionPointerCall2 >::type type; -}; -template -class StoredConstNoExceptMemberFunctionPointerCall2 : public RunFunctionTask -{ -public: - StoredConstNoExceptMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2) const noexcept; - Class const *object; - Arg1 arg1; Arg2 arg2; -}; -template -class VoidStoredConstNoExceptMemberFunctionPointerCall2 : public RunFunctionTask -{ -public: - VoidStoredConstNoExceptMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2); - } -private: - T (Class::*fn)(Param1, Param2) const noexcept; - Class const *object; - Arg1 arg1; Arg2 arg2; -}; -template -struct SelectStoredConstNoExceptMemberFunctionPointerCall2 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstNoExceptMemberFunctionPointerCall2 >::type type; -}; -#endif - -template -struct StoredFunctorCall3: public RunFunctionTask -{ - inline StoredFunctorCall3(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3) {} - void runFunctor() override { this->result = function(arg1, arg2, arg3); } - FunctionPointer function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; - -template -struct StoredFunctorCall3: public RunFunctionTask -{ - inline StoredFunctorCall3(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3) {} - void runFunctor() override { function(arg1, arg2, arg3); } - FunctionPointer function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; - -template -struct StoredFunctorPointerCall3: public RunFunctionTask -{ - inline StoredFunctorPointerCall3(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3) {} - void runFunctor() override { this->result =(*function)(arg1, arg2, arg3); } - FunctionPointer * function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; - -template -struct VoidStoredFunctorPointerCall3: public RunFunctionTask -{ - inline VoidStoredFunctorPointerCall3(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3) {} - void runFunctor() override { (*function)(arg1, arg2, arg3); } - FunctionPointer * function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; - -template -struct SelectStoredFunctorPointerCall3 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredFunctorPointerCall3 >::type type; -}; -template -class StoredMemberFunctionCall3 : public RunFunctionTask -{ -public: - StoredMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3), const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3); - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -class VoidStoredMemberFunctionCall3 : public RunFunctionTask -{ -public: - VoidStoredMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3), const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3); - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -struct SelectStoredMemberFunctionCall3 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredMemberFunctionCall3 >::type type; -}; -template -class StoredConstMemberFunctionCall3 : public RunFunctionTask -{ -public: - StoredConstMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3) const; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -class VoidStoredConstMemberFunctionCall3 : public RunFunctionTask -{ -public: - VoidStoredConstMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3) const; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -struct SelectStoredConstMemberFunctionCall3 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstMemberFunctionCall3 >::type type; -}; -template -class StoredMemberFunctionPointerCall3 : public RunFunctionTask -{ -public: - StoredMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3), Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3); - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -class VoidStoredMemberFunctionPointerCall3 : public RunFunctionTask -{ -public: - VoidStoredMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3), Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3); - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -struct SelectStoredMemberFunctionPointerCall3 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredMemberFunctionPointerCall3 >::type type; -}; -template -class StoredConstMemberFunctionPointerCall3 : public RunFunctionTask -{ -public: - StoredConstMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3) const; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -class VoidStoredConstMemberFunctionPointerCall3 : public RunFunctionTask -{ -public: - VoidStoredConstMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3) const; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -struct SelectStoredConstMemberFunctionPointerCall3 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstMemberFunctionPointerCall3 >::type type; -}; -#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 -template -class StoredNoExceptMemberFunctionCall3 : public RunFunctionTask -{ -public: - StoredNoExceptMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3) noexcept; - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -class VoidStoredNoExceptMemberFunctionCall3 : public RunFunctionTask -{ -public: - VoidStoredNoExceptMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3) noexcept; - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -struct SelectStoredNoExceptMemberFunctionCall3 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredNoExceptMemberFunctionCall3 >::type type; -}; -template -class StoredConstNoExceptMemberFunctionCall3 : public RunFunctionTask -{ -public: - StoredConstNoExceptMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3) const noexcept; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -class VoidStoredConstNoExceptMemberFunctionCall3 : public RunFunctionTask -{ -public: - VoidStoredConstNoExceptMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3) const noexcept; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -struct SelectStoredConstNoExceptMemberFunctionCall3 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstNoExceptMemberFunctionCall3 >::type type; -}; -template -class StoredNoExceptMemberFunctionPointerCall3 : public RunFunctionTask -{ -public: - StoredNoExceptMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3) noexcept; - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -class VoidStoredNoExceptMemberFunctionPointerCall3 : public RunFunctionTask -{ -public: - VoidStoredNoExceptMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3) noexcept; - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -struct SelectStoredNoExceptMemberFunctionPointerCall3 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredNoExceptMemberFunctionPointerCall3 >::type type; -}; -template -class StoredConstNoExceptMemberFunctionPointerCall3 : public RunFunctionTask -{ -public: - StoredConstNoExceptMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3) const noexcept; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -class VoidStoredConstNoExceptMemberFunctionPointerCall3 : public RunFunctionTask -{ -public: - VoidStoredConstNoExceptMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2, arg3); - } -private: - T (Class::*fn)(Param1, Param2, Param3) const noexcept; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -struct SelectStoredConstNoExceptMemberFunctionPointerCall3 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstNoExceptMemberFunctionPointerCall3 >::type type; -}; -#endif - -template -struct StoredFunctorCall4: public RunFunctionTask -{ - inline StoredFunctorCall4(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4) {} - void runFunctor() override { this->result = function(arg1, arg2, arg3, arg4); } - FunctionPointer function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; - -template -struct StoredFunctorCall4: public RunFunctionTask -{ - inline StoredFunctorCall4(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4) {} - void runFunctor() override { function(arg1, arg2, arg3, arg4); } - FunctionPointer function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; - -template -struct StoredFunctorPointerCall4: public RunFunctionTask -{ - inline StoredFunctorPointerCall4(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4) {} - void runFunctor() override { this->result =(*function)(arg1, arg2, arg3, arg4); } - FunctionPointer * function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; - -template -struct VoidStoredFunctorPointerCall4: public RunFunctionTask -{ - inline VoidStoredFunctorPointerCall4(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4) {} - void runFunctor() override { (*function)(arg1, arg2, arg3, arg4); } - FunctionPointer * function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; - -template -struct SelectStoredFunctorPointerCall4 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredFunctorPointerCall4 >::type type; -}; -template -class StoredMemberFunctionCall4 : public RunFunctionTask -{ -public: - StoredMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4), const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4); - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -class VoidStoredMemberFunctionCall4 : public RunFunctionTask -{ -public: - VoidStoredMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4), const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4); - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -struct SelectStoredMemberFunctionCall4 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredMemberFunctionCall4 >::type type; -}; -template -class StoredConstMemberFunctionCall4 : public RunFunctionTask -{ -public: - StoredConstMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4) const; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -class VoidStoredConstMemberFunctionCall4 : public RunFunctionTask -{ -public: - VoidStoredConstMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4) const; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -struct SelectStoredConstMemberFunctionCall4 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstMemberFunctionCall4 >::type type; -}; -template -class StoredMemberFunctionPointerCall4 : public RunFunctionTask -{ -public: - StoredMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4), Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4); - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -class VoidStoredMemberFunctionPointerCall4 : public RunFunctionTask -{ -public: - VoidStoredMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4), Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4); - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -struct SelectStoredMemberFunctionPointerCall4 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredMemberFunctionPointerCall4 >::type type; -}; -template -class StoredConstMemberFunctionPointerCall4 : public RunFunctionTask -{ -public: - StoredConstMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4) const; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -class VoidStoredConstMemberFunctionPointerCall4 : public RunFunctionTask -{ -public: - VoidStoredConstMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4) const; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -struct SelectStoredConstMemberFunctionPointerCall4 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstMemberFunctionPointerCall4 >::type type; -}; -#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 -template -class StoredNoExceptMemberFunctionCall4 : public RunFunctionTask -{ -public: - StoredNoExceptMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4) noexcept; - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -class VoidStoredNoExceptMemberFunctionCall4 : public RunFunctionTask -{ -public: - VoidStoredNoExceptMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4) noexcept; - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -struct SelectStoredNoExceptMemberFunctionCall4 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredNoExceptMemberFunctionCall4 >::type type; -}; -template -class StoredConstNoExceptMemberFunctionCall4 : public RunFunctionTask -{ -public: - StoredConstNoExceptMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4) const noexcept; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -class VoidStoredConstNoExceptMemberFunctionCall4 : public RunFunctionTask -{ -public: - VoidStoredConstNoExceptMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4) const noexcept; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -struct SelectStoredConstNoExceptMemberFunctionCall4 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstNoExceptMemberFunctionCall4 >::type type; -}; -template -class StoredNoExceptMemberFunctionPointerCall4 : public RunFunctionTask -{ -public: - StoredNoExceptMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4) noexcept; - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -class VoidStoredNoExceptMemberFunctionPointerCall4 : public RunFunctionTask -{ -public: - VoidStoredNoExceptMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4) noexcept; - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -struct SelectStoredNoExceptMemberFunctionPointerCall4 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredNoExceptMemberFunctionPointerCall4 >::type type; -}; -template -class StoredConstNoExceptMemberFunctionPointerCall4 : public RunFunctionTask -{ -public: - StoredConstNoExceptMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4) const noexcept; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -class VoidStoredConstNoExceptMemberFunctionPointerCall4 : public RunFunctionTask -{ -public: - VoidStoredConstNoExceptMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2, arg3, arg4); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4) const noexcept; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -struct SelectStoredConstNoExceptMemberFunctionPointerCall4 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstNoExceptMemberFunctionPointerCall4 >::type type; -}; -#endif - -template -struct StoredFunctorCall5: public RunFunctionTask -{ - inline StoredFunctorCall5(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5) {} - void runFunctor() override { this->result = function(arg1, arg2, arg3, arg4, arg5); } - FunctionPointer function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; - -template -struct StoredFunctorCall5: public RunFunctionTask -{ - inline StoredFunctorCall5(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5) {} - void runFunctor() override { function(arg1, arg2, arg3, arg4, arg5); } - FunctionPointer function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; - -template -struct StoredFunctorPointerCall5: public RunFunctionTask -{ - inline StoredFunctorPointerCall5(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5) {} - void runFunctor() override { this->result =(*function)(arg1, arg2, arg3, arg4, arg5); } - FunctionPointer * function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; - -template -struct VoidStoredFunctorPointerCall5: public RunFunctionTask -{ - inline VoidStoredFunctorPointerCall5(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5) {} - void runFunctor() override { (*function)(arg1, arg2, arg3, arg4, arg5); } - FunctionPointer * function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; - -template -struct SelectStoredFunctorPointerCall5 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredFunctorPointerCall5 >::type type; -}; -template -class StoredMemberFunctionCall5 : public RunFunctionTask -{ -public: - StoredMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5), const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5); - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -class VoidStoredMemberFunctionCall5 : public RunFunctionTask -{ -public: - VoidStoredMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5), const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5); - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -struct SelectStoredMemberFunctionCall5 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredMemberFunctionCall5 >::type type; -}; -template -class StoredConstMemberFunctionCall5 : public RunFunctionTask -{ -public: - StoredConstMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -class VoidStoredConstMemberFunctionCall5 : public RunFunctionTask -{ -public: - VoidStoredConstMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } - - void runFunctor() override - { - (object.*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -struct SelectStoredConstMemberFunctionCall5 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstMemberFunctionCall5 >::type type; -}; -template -class StoredMemberFunctionPointerCall5 : public RunFunctionTask -{ -public: - StoredMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5), Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } - - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5); - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -class VoidStoredMemberFunctionPointerCall5 : public RunFunctionTask -{ -public: - VoidStoredMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5), Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5); - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -struct SelectStoredMemberFunctionPointerCall5 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredMemberFunctionPointerCall5 >::type type; -}; -template -class StoredConstMemberFunctionPointerCall5 : public RunFunctionTask -{ -public: - StoredConstMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -class VoidStoredConstMemberFunctionPointerCall5 : public RunFunctionTask -{ -public: - VoidStoredConstMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } - - void runFunctor() override - { - (object->*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -struct SelectStoredConstMemberFunctionPointerCall5 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstMemberFunctionPointerCall5 >::type type; -}; -#if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 -template -class StoredNoExceptMemberFunctionCall5 : public RunFunctionTask -{ -public: - StoredNoExceptMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } - - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) noexcept; - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -class VoidStoredNoExceptMemberFunctionCall5 : public RunFunctionTask +template +struct InvokeResult { -public: - VoidStoredNoExceptMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } + static_assert(std::is_invocable_v, std::decay_t...>, + "It's not possible to invoke the function with passed arguments."); - void runFunctor() override - { - (object.*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) noexcept; - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -struct SelectStoredNoExceptMemberFunctionCall5 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredNoExceptMemberFunctionCall5 >::type type; + using Type = std::invoke_result_t, std::decay_t...>; }; -template -class StoredConstNoExceptMemberFunctionCall5 : public RunFunctionTask -{ -public: - StoredConstNoExceptMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } - void runFunctor() override - { - this->result = (object.*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const noexcept; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -class VoidStoredConstNoExceptMemberFunctionCall5 : public RunFunctionTask -{ -public: - VoidStoredConstNoExceptMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const noexcept, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } +template +using InvokeResultType = typename InvokeResult::Type; - void runFunctor() override - { - (object.*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const noexcept; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -struct SelectStoredConstNoExceptMemberFunctionCall5 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstNoExceptMemberFunctionCall5 >::type type; -}; -template -class StoredNoExceptMemberFunctionPointerCall5 : public RunFunctionTask +template +struct StoredFunctionCall : public RunFunctionTask> { -public: - StoredNoExceptMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } + template + using DecayedTuple = std::tuple...>; - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) noexcept; - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -class VoidStoredNoExceptMemberFunctionPointerCall5 : public RunFunctionTask -{ -public: - VoidStoredNoExceptMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) noexcept, Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } + StoredFunctionCall(Function &&f, Args &&...args) + : data{std::forward(f), std::forward(args)...} + {} void runFunctor() override { - (object->*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) noexcept; - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -struct SelectStoredNoExceptMemberFunctionPointerCall5 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredNoExceptMemberFunctionPointerCall5 >::type type; -}; -template -class StoredConstNoExceptMemberFunctionPointerCall5 : public RunFunctionTask -{ -public: - StoredConstNoExceptMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } + using Indexes = + std::make_index_sequence< + std::tuple_size>::value>; - void runFunctor() override - { - this->result = (object->*fn)(arg1, arg2, arg3, arg4, arg5); + invoke(Indexes()); } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const noexcept; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -class VoidStoredConstNoExceptMemberFunctionPointerCall5 : public RunFunctionTask -{ -public: - VoidStoredConstNoExceptMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const noexcept, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5) - : fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ } - void runFunctor() override + template + void invoke(std::index_sequence) { - (object->*fn)(arg1, arg2, arg3, arg4, arg5); + if constexpr (std::is_void_v>) + std::invoke(std::get(std::move(data))...); + else + this->result = std::invoke(std::get(std::move(data))...); } -private: - T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const noexcept; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -struct SelectStoredConstNoExceptMemberFunctionPointerCall5 -{ - typedef typename SelectSpecialization::template - Type, - VoidStoredConstNoExceptMemberFunctionPointerCall5 >::type type; -}; -#endif -template -class StoredFunctorCall : public RunFunctionTask -{ -public: - StoredFunctorCall(const Functor &f) : functor(f) { } - void runFunctor() override - { - this->result = functor(); - } -private: - Functor functor; -}; -template -class StoredFunctorCall : public RunFunctionTask -{ -public: - StoredFunctorCall(const Functor &f) : functor(f) { } - void runFunctor() override - { - functor(); - } -private: - Functor functor; + DecayedTuple data; }; - } //namespace QtConcurrent #endif // Q_QDOC -- cgit v1.2.3