From f05141cc12f73daf5901b5bfe5d1271b3a4f8449 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Tue, 23 Mar 2010 09:06:17 +0100 Subject: Make build() function static inside Coroutine. --- src/coroutine.h | 6 + src/coroutinebuild.h | 243 ---------------- src/coroutinebuilddeclaration_p.h | 111 ++++++++ src/coroutinebuilddefinition_p.h | 235 ++++++++++++++++ src/coroutinestoredfunctioncall.h | 536 ------------------------------------ src/coroutinestoredfunctioncall_p.h | 535 +++++++++++++++++++++++++++++++++++ src/src.pro | 5 +- tests/auto/build/tst_build.cpp | 5 +- tools/generatebuild/main.cpp | 136 +++++---- 9 files changed, 981 insertions(+), 831 deletions(-) delete mode 100644 src/coroutinebuild.h create mode 100644 src/coroutinebuilddeclaration_p.h create mode 100644 src/coroutinebuilddefinition_p.h delete mode 100644 src/coroutinestoredfunctioncall.h create mode 100644 src/coroutinestoredfunctioncall_p.h diff --git a/src/coroutine.h b/src/coroutine.h index 7a7cd1c..a054308 100644 --- a/src/coroutine.h +++ b/src/coroutine.h @@ -24,6 +24,9 @@ public: static Coroutine *currentCoroutine(); +// add declarations for static build(...) function +#include "coroutinebuilddeclaration_p.h" + protected: virtual void run() {} @@ -40,4 +43,7 @@ private: Status _status; }; +// add definitions for static build(...) function +#include "coroutinebuilddefinition_p.h" + #endif // INCLUDE_COROUTINE_H diff --git a/src/coroutinebuild.h b/src/coroutinebuild.h deleted file mode 100644 index ddff983..0000000 --- a/src/coroutinebuild.h +++ /dev/null @@ -1,243 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Toolkit. -** -****************************************************************************/ - -// Generated code, do not edit! Use generator at tools/generatebuild/ -#ifndef COROUTINE_MAKE_H -#define COROUTINE_MAKE_H - -#include "coroutine.h" -#include "coroutinestoredfunctioncall.h" - -#ifdef qdoc - - Coroutine* build(Function function, ...); - -#else - - -Coroutine* build(int stackSize, void (*functionPointer)()) -{ - return new StoredFunctorCall0(stackSize, functionPointer); -} -template -Coroutine* build(int stackSize, void (*functionPointer)(Param1), const Arg1 &arg1) -{ - return new StoredFunctorCall1(stackSize, functionPointer, arg1); -} -template -Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2) -{ - return new StoredFunctorCall2(stackSize, functionPointer, arg1, arg2); -} -template -Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) -{ - return new StoredFunctorCall3(stackSize, functionPointer, arg1, arg2, arg3); -} -template -Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) -{ - return new StoredFunctorCall4(stackSize, functionPointer, arg1, arg2, arg3, arg4); -} -template -Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2, Param3, Param4, Param5), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) -{ - return new StoredFunctorCall5(stackSize, functionPointer, arg1, arg2, arg3, arg4, arg5); -} - -template -Coroutine* build(int stackSize, FunctionObject functionObject) -{ - return new StoredFunctorCall0(stackSize, functionObject); -} -template -Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1) -{ - return new StoredFunctorCall1(stackSize, functionObject, arg1); -} -template -Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2) -{ - return new StoredFunctorCall2(stackSize, functionObject, arg1, arg2); -} -template -Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) -{ - return new StoredFunctorCall3(stackSize, functionObject, arg1, arg2, arg3); -} -template -Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) -{ - return new StoredFunctorCall4(stackSize, functionObject, arg1, arg2, arg3, arg4); -} -template -Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) -{ - return new StoredFunctorCall5(stackSize, functionObject, arg1, arg2, arg3, arg4, arg5); -} - -template -Coroutine* build(int stackSize, FunctionObject *functionObject) -{ - return new StoredFunctorPointerCall0(stackSize, functionObject); -} -template -Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1) -{ - return new StoredFunctorPointerCall1(stackSize, functionObject, arg1); -} -template -Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2) -{ - return new StoredFunctorPointerCall2(stackSize, functionObject, arg1, arg2); -} -template -Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) -{ - return new StoredFunctorPointerCall3(stackSize, functionObject, arg1, arg2, arg3); -} -template -Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) -{ - return new StoredFunctorPointerCall4(stackSize, functionObject, arg1, arg2, arg3, arg4); -} -template -Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) -{ - return new StoredFunctorPointerCall5(stackSize, functionObject, arg1, arg2, arg3, arg4, arg5); -} - -template -Coroutine* build(int stackSize, const Class &object, void (Class::*fn)()) -{ - return new StoredMemberFunctionCall0(stackSize, fn, object); -} -template -Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1), const Arg1 &arg1) -{ - return new StoredMemberFunctionCall1(stackSize, fn, object, arg1); -} -template -Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2) -{ - return new StoredMemberFunctionCall2(stackSize, fn, object, arg1, arg2); -} -template -Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) -{ - return new StoredMemberFunctionCall3(stackSize, fn, object, arg1, arg2, arg3); -} -template -Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) -{ - return new StoredMemberFunctionCall4(stackSize, fn, object, arg1, arg2, arg3, arg4); -} -template -Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) -{ - return new StoredMemberFunctionCall5(stackSize, fn, object, arg1, arg2, arg3, arg4, arg5); -} - -template -Coroutine *build(int stackSize, const Class &object, void (Class::*fn)() const) -{ - return new StoredConstMemberFunctionCall0(stackSize, fn, object); -} -template -Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1) const, const Arg1 &arg1) -{ - return new StoredConstMemberFunctionCall1(stackSize, fn, object, arg1); -} -template -Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2) -{ - return new StoredConstMemberFunctionCall2(stackSize, fn, object, arg1, arg2); -} -template -Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) -{ - return new StoredConstMemberFunctionCall3(stackSize, fn, object, arg1, arg2, arg3); -} -template -Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3, Param4) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) -{ - return new StoredConstMemberFunctionCall4(stackSize, fn, object, arg1, arg2, arg3, arg4); -} -template -Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) -{ - return new StoredConstMemberFunctionCall5(stackSize, fn, object, arg1, arg2, arg3, arg4, arg5); -} - -template -Coroutine* build(int stackSize, Class *object, void (Class::*fn)()) -{ - return new StoredMemberFunctionPointerCall0(stackSize, fn, object); -} -template -Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1), const Arg1 &arg1) -{ - return new StoredMemberFunctionPointerCall1(stackSize, fn, object, arg1); -} -template -Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2) -{ - return new StoredMemberFunctionPointerCall2(stackSize, fn, object, arg1, arg2); -} -template -Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) -{ - return new StoredMemberFunctionPointerCall3(stackSize, fn, object, arg1, arg2, arg3); -} -template -Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) -{ - return new StoredMemberFunctionPointerCall4(stackSize, fn, object, arg1, arg2, arg3, arg4); -} -template -Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) -{ - return new StoredMemberFunctionPointerCall5(stackSize, fn, object, arg1, arg2, arg3, arg4, arg5); -} - -template -Coroutine* build(int stackSize, const Class *object, void (Class::*fn)() const) -{ - return new StoredConstMemberFunctionPointerCall0(stackSize, fn, object); -} -template -Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1) const, const Arg1 &arg1) -{ - return new StoredConstMemberFunctionPointerCall1(stackSize, fn, object, arg1); -} -template -Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2) -{ - return new StoredConstMemberFunctionPointerCall2(stackSize, fn, object, arg1, arg2); -} -template -Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2, Param3) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) -{ - return new StoredConstMemberFunctionPointerCall3(stackSize, fn, object, arg1, arg2, arg3); -} -template -Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2, Param3, Param4) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) -{ - return new StoredConstMemberFunctionPointerCall4(stackSize, fn, object, arg1, arg2, arg3, arg4); -} -template -Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) -{ - return new StoredConstMemberFunctionPointerCall5(stackSize, fn, object, arg1, arg2, arg3, arg4, arg5); -} - - -#endif // qdoc - -#endif diff --git a/src/coroutinebuilddeclaration_p.h b/src/coroutinebuilddeclaration_p.h new file mode 100644 index 0000000..b7d51ae --- /dev/null +++ b/src/coroutinebuilddeclaration_p.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Toolkit. +** +****************************************************************************/ + +// Generated code, do not edit! Use generator at tools/generatebuild/ + +#ifdef qdoc + + static Coroutine* build(Function function, ...); + +#else + + +static Coroutine* build(int stackSize, void (*functionPointer)()); +template +static Coroutine* build(int stackSize, void (*functionPointer)(Param1), const Arg1 &arg1); +template +static Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2); +template +static Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3); +template +static Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4); +template +static Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2, Param3, Param4, Param5), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5); + +template +static Coroutine* build(int stackSize, FunctionObject functionObject); +template +static Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1); +template +static Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2); +template +static Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3); +template +static Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4); +template +static Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5); + +template +static Coroutine* build(int stackSize, FunctionObject *functionObject); +template +static Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1); +template +static Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2); +template +static Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3); +template +static Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4); +template +static Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5); + +template +static Coroutine* build(int stackSize, const Class &object, void (Class::*fn)()); +template +static Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1), const Arg1 &arg1); +template +static Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2); +template +static Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3); +template +static Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4); +template +static Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5); + +template +static Coroutine *build(int stackSize, const Class &object, void (Class::*fn)() const); +template +static Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1) const, const Arg1 &arg1); +template +static Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2); +template +static Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3); +template +static Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3, Param4) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4); +template +static Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5); + +template +static Coroutine* build(int stackSize, Class *object, void (Class::*fn)()); +template +static Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1), const Arg1 &arg1); +template +static Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2); +template +static Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3); +template +static Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4); +template +static Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5); + +template +static Coroutine* build(int stackSize, const Class *object, void (Class::*fn)() const); +template +static Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1) const, const Arg1 &arg1); +template +static Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2); +template +static Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2, Param3) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3); +template +static Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2, Param3, Param4) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4); +template +static Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5); + + +#endif // qdoc + diff --git a/src/coroutinebuilddefinition_p.h b/src/coroutinebuilddefinition_p.h new file mode 100644 index 0000000..bf624c1 --- /dev/null +++ b/src/coroutinebuilddefinition_p.h @@ -0,0 +1,235 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Toolkit. +** +****************************************************************************/ + +// Generated code, do not edit! Use generator at tools/generatebuild/ + +#include "coroutinestoredfunctioncall_p.h" + +#ifndef qdoc + + +Coroutine* Coroutine::build(int stackSize, void (*functionPointer)()) +{ + return new StoredFunctorCall0(stackSize, functionPointer); +} +template +Coroutine* Coroutine::build(int stackSize, void (*functionPointer)(Param1), const Arg1 &arg1) +{ + return new StoredFunctorCall1(stackSize, functionPointer, arg1); +} +template +Coroutine* Coroutine::build(int stackSize, void (*functionPointer)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2) +{ + return new StoredFunctorCall2(stackSize, functionPointer, arg1, arg2); +} +template +Coroutine* Coroutine::build(int stackSize, void (*functionPointer)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) +{ + return new StoredFunctorCall3(stackSize, functionPointer, arg1, arg2, arg3); +} +template +Coroutine* Coroutine::build(int stackSize, void (*functionPointer)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) +{ + return new StoredFunctorCall4(stackSize, functionPointer, arg1, arg2, arg3, arg4); +} +template +Coroutine* Coroutine::build(int stackSize, void (*functionPointer)(Param1, Param2, Param3, Param4, Param5), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) +{ + return new StoredFunctorCall5(stackSize, functionPointer, arg1, arg2, arg3, arg4, arg5); +} + +template +Coroutine* Coroutine::build(int stackSize, FunctionObject functionObject) +{ + return new StoredFunctorCall0(stackSize, functionObject); +} +template +Coroutine* Coroutine::build(int stackSize, FunctionObject functionObject, const Arg1 &arg1) +{ + return new StoredFunctorCall1(stackSize, functionObject, arg1); +} +template +Coroutine* Coroutine::build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2) +{ + return new StoredFunctorCall2(stackSize, functionObject, arg1, arg2); +} +template +Coroutine* Coroutine::build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) +{ + return new StoredFunctorCall3(stackSize, functionObject, arg1, arg2, arg3); +} +template +Coroutine* Coroutine::build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) +{ + return new StoredFunctorCall4(stackSize, functionObject, arg1, arg2, arg3, arg4); +} +template +Coroutine* Coroutine::build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) +{ + return new StoredFunctorCall5(stackSize, functionObject, arg1, arg2, arg3, arg4, arg5); +} + +template +Coroutine* Coroutine::build(int stackSize, FunctionObject *functionObject) +{ + return new StoredFunctorPointerCall0(stackSize, functionObject); +} +template +Coroutine* Coroutine::build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1) +{ + return new StoredFunctorPointerCall1(stackSize, functionObject, arg1); +} +template +Coroutine* Coroutine::build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2) +{ + return new StoredFunctorPointerCall2(stackSize, functionObject, arg1, arg2); +} +template +Coroutine* Coroutine::build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) +{ + return new StoredFunctorPointerCall3(stackSize, functionObject, arg1, arg2, arg3); +} +template +Coroutine* Coroutine::build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) +{ + return new StoredFunctorPointerCall4(stackSize, functionObject, arg1, arg2, arg3, arg4); +} +template +Coroutine* Coroutine::build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) +{ + return new StoredFunctorPointerCall5(stackSize, functionObject, arg1, arg2, arg3, arg4, arg5); +} + +template +Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)()) +{ + return new StoredMemberFunctionCall0(stackSize, fn, object); +} +template +Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1), const Arg1 &arg1) +{ + return new StoredMemberFunctionCall1(stackSize, fn, object, arg1); +} +template +Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2) +{ + return new StoredMemberFunctionCall2(stackSize, fn, object, arg1, arg2); +} +template +Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) +{ + return new StoredMemberFunctionCall3(stackSize, fn, object, arg1, arg2, arg3); +} +template +Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) +{ + return new StoredMemberFunctionCall4(stackSize, fn, object, arg1, arg2, arg3, arg4); +} +template +Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) +{ + return new StoredMemberFunctionCall5(stackSize, fn, object, arg1, arg2, arg3, arg4, arg5); +} + +template +Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)() const) +{ + return new StoredConstMemberFunctionCall0(stackSize, fn, object); +} +template +Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1) const, const Arg1 &arg1) +{ + return new StoredConstMemberFunctionCall1(stackSize, fn, object, arg1); +} +template +Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2) +{ + return new StoredConstMemberFunctionCall2(stackSize, fn, object, arg1, arg2); +} +template +Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) +{ + return new StoredConstMemberFunctionCall3(stackSize, fn, object, arg1, arg2, arg3); +} +template +Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3, Param4) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) +{ + return new StoredConstMemberFunctionCall4(stackSize, fn, object, arg1, arg2, arg3, arg4); +} +template +Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) +{ + return new StoredConstMemberFunctionCall5(stackSize, fn, object, arg1, arg2, arg3, arg4, arg5); +} + +template +Coroutine* Coroutine::build(int stackSize, Class *object, void (Class::*fn)()) +{ + return new StoredMemberFunctionPointerCall0(stackSize, fn, object); +} +template +Coroutine* Coroutine::build(int stackSize, Class *object, void (Class::*fn)(Param1), const Arg1 &arg1) +{ + return new StoredMemberFunctionPointerCall1(stackSize, fn, object, arg1); +} +template +Coroutine* Coroutine::build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2) +{ + return new StoredMemberFunctionPointerCall2(stackSize, fn, object, arg1, arg2); +} +template +Coroutine* Coroutine::build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) +{ + return new StoredMemberFunctionPointerCall3(stackSize, fn, object, arg1, arg2, arg3); +} +template +Coroutine* Coroutine::build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) +{ + return new StoredMemberFunctionPointerCall4(stackSize, fn, object, arg1, arg2, arg3, arg4); +} +template +Coroutine* Coroutine::build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) +{ + return new StoredMemberFunctionPointerCall5(stackSize, fn, object, arg1, arg2, arg3, arg4, arg5); +} + +template +Coroutine* Coroutine::build(int stackSize, const Class *object, void (Class::*fn)() const) +{ + return new StoredConstMemberFunctionPointerCall0(stackSize, fn, object); +} +template +Coroutine* Coroutine::build(int stackSize, const Class *object, void (Class::*fn)(Param1) const, const Arg1 &arg1) +{ + return new StoredConstMemberFunctionPointerCall1(stackSize, fn, object, arg1); +} +template +Coroutine* Coroutine::build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2) +{ + return new StoredConstMemberFunctionPointerCall2(stackSize, fn, object, arg1, arg2); +} +template +Coroutine* Coroutine::build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2, Param3) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) +{ + return new StoredConstMemberFunctionPointerCall3(stackSize, fn, object, arg1, arg2, arg3); +} +template +Coroutine* Coroutine::build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2, Param3, Param4) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) +{ + return new StoredConstMemberFunctionPointerCall4(stackSize, fn, object, arg1, arg2, arg3, arg4); +} +template +Coroutine* Coroutine::build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) +{ + return new StoredConstMemberFunctionPointerCall5(stackSize, fn, object, arg1, arg2, arg3, arg4, arg5); +} + + +#endif // qdoc + diff --git a/src/coroutinestoredfunctioncall.h b/src/coroutinestoredfunctioncall.h deleted file mode 100644 index bdcc329..0000000 --- a/src/coroutinestoredfunctioncall.h +++ /dev/null @@ -1,536 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Toolkit. -** -****************************************************************************/ - -// Generated code, do not edit! Use generator at tools/generatebuild/ -#ifndef COROUTINE_STOREDFUNCTIONCALL_H -#define COROUTINE_STOREDFUNCTIONCALL_H - -#include "coroutine.h" -#ifndef qdoc - -template -struct StoredFunctorCall0: public Coroutine -{ - inline StoredFunctorCall0(int stackSize, FunctionPointer function) - : Coroutine(stackSize), function(function) {} -protected: - virtual void run() { function(); } - FunctionPointer function; - -}; - -template -struct StoredFunctorPointerCall0: public Coroutine -{ - inline StoredFunctorPointerCall0(int stackSize, FunctionPointer * function) - : Coroutine(stackSize), function(function) {} -protected: - virtual void run() { (*function)(); } - FunctionPointer * function; - -}; - -template -class StoredMemberFunctionCall0 : public Coroutine -{ -public: - StoredMemberFunctionCall0(int stackSize, void (Class::*fn)() , const Class &object) - : Coroutine(stackSize), fn(fn), object(object){ } -protected: - virtual void run() - { - (object.*fn)(); - } -private: - void (Class::*fn)(); - Class object; - -}; -template -class StoredConstMemberFunctionCall0 : public Coroutine -{ -public: - StoredConstMemberFunctionCall0(int stackSize, void (Class::*fn)() const, const Class &object) - : Coroutine(stackSize), fn(fn), object(object){ } -protected: - virtual void run() - { - (object.*fn)(); - } -private: - void (Class::*fn)()const; - const Class object; - -}; -template -class StoredMemberFunctionPointerCall0 : public Coroutine -{ -public: - StoredMemberFunctionPointerCall0(int stackSize, void (Class::*fn)() , Class *object) - : Coroutine(stackSize), fn(fn), object(object){ } -protected: - virtual void run() - { - (object->*fn)(); - } -private: - void (Class::*fn)(); - Class *object; - -}; -template -class StoredConstMemberFunctionPointerCall0 : public Coroutine -{ -public: - StoredConstMemberFunctionPointerCall0(int stackSize, void (Class::*fn)() const, Class const *object) - : Coroutine(stackSize), fn(fn), object(object){ } -protected: - virtual void run() - { - (object->*fn)(); - } -private: - void (Class::*fn)()const; - Class const *object; - -}; -template -struct StoredFunctorCall1: public Coroutine -{ - inline StoredFunctorCall1(int stackSize, FunctionPointer function, const Arg1 &arg1) - : Coroutine(stackSize), function(function), arg1(arg1) {} -protected: - virtual void run() { function(arg1); } - FunctionPointer function; - Arg1 arg1; -}; - -template -struct StoredFunctorPointerCall1: public Coroutine -{ - inline StoredFunctorPointerCall1(int stackSize, FunctionPointer * function, const Arg1 &arg1) - : Coroutine(stackSize), function(function), arg1(arg1) {} -protected: - virtual void run() { (*function)(arg1); } - FunctionPointer * function; - Arg1 arg1; -}; - -template -class StoredMemberFunctionCall1 : public Coroutine -{ -public: - StoredMemberFunctionCall1(int stackSize, void (Class::*fn)(Param1) , const Class &object, const Arg1 &arg1) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1){ } -protected: - virtual void run() - { - (object.*fn)(arg1); - } -private: - void (Class::*fn)(Param1); - Class object; - Arg1 arg1; -}; -template -class StoredConstMemberFunctionCall1 : public Coroutine -{ -public: - StoredConstMemberFunctionCall1(int stackSize, void (Class::*fn)(Param1) const, const Class &object, const Arg1 &arg1) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1){ } -protected: - virtual void run() - { - (object.*fn)(arg1); - } -private: - void (Class::*fn)(Param1)const; - const Class object; - Arg1 arg1; -}; -template -class StoredMemberFunctionPointerCall1 : public Coroutine -{ -public: - StoredMemberFunctionPointerCall1(int stackSize, void (Class::*fn)(Param1) , Class *object, const Arg1 &arg1) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1){ } -protected: - virtual void run() - { - (object->*fn)(arg1); - } -private: - void (Class::*fn)(Param1); - Class *object; - Arg1 arg1; -}; -template -class StoredConstMemberFunctionPointerCall1 : public Coroutine -{ -public: - StoredConstMemberFunctionPointerCall1(int stackSize, void (Class::*fn)(Param1) const, Class const *object, const Arg1 &arg1) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1){ } -protected: - virtual void run() - { - (object->*fn)(arg1); - } -private: - void (Class::*fn)(Param1)const; - Class const *object; - Arg1 arg1; -}; -template -struct StoredFunctorCall2: public Coroutine -{ - inline StoredFunctorCall2(int stackSize, FunctionPointer function, const Arg1 &arg1, const Arg2 &arg2) - : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2) {} -protected: - virtual void run() { function(arg1, arg2); } - FunctionPointer function; - Arg1 arg1; Arg2 arg2; -}; - -template -struct StoredFunctorPointerCall2: public Coroutine -{ - inline StoredFunctorPointerCall2(int stackSize, FunctionPointer * function, const Arg1 &arg1, const Arg2 &arg2) - : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2) {} -protected: - virtual void run() { (*function)(arg1, arg2); } - FunctionPointer * function; - Arg1 arg1; Arg2 arg2; -}; - -template -class StoredMemberFunctionCall2 : public Coroutine -{ -public: - StoredMemberFunctionCall2(int stackSize, void (Class::*fn)(Param1, Param2) , const Class &object, const Arg1 &arg1, const Arg2 &arg2) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2){ } -protected: - virtual void run() - { - (object.*fn)(arg1, arg2); - } -private: - void (Class::*fn)(Param1, Param2); - Class object; - Arg1 arg1; Arg2 arg2; -}; -template -class StoredConstMemberFunctionCall2 : public Coroutine -{ -public: - StoredConstMemberFunctionCall2(int stackSize, void (Class::*fn)(Param1, Param2) const, const Class &object, const Arg1 &arg1, const Arg2 &arg2) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2){ } -protected: - virtual void run() - { - (object.*fn)(arg1, arg2); - } -private: - void (Class::*fn)(Param1, Param2)const; - const Class object; - Arg1 arg1; Arg2 arg2; -}; -template -class StoredMemberFunctionPointerCall2 : public Coroutine -{ -public: - StoredMemberFunctionPointerCall2(int stackSize, void (Class::*fn)(Param1, Param2) , Class *object, const Arg1 &arg1, const Arg2 &arg2) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2){ } -protected: - virtual void run() - { - (object->*fn)(arg1, arg2); - } -private: - void (Class::*fn)(Param1, Param2); - Class *object; - Arg1 arg1; Arg2 arg2; -}; -template -class StoredConstMemberFunctionPointerCall2 : public Coroutine -{ -public: - StoredConstMemberFunctionPointerCall2(int stackSize, void (Class::*fn)(Param1, Param2) const, Class const *object, const Arg1 &arg1, const Arg2 &arg2) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2){ } -protected: - virtual void run() - { - (object->*fn)(arg1, arg2); - } -private: - void (Class::*fn)(Param1, Param2)const; - Class const *object; - Arg1 arg1; Arg2 arg2; -}; -template -struct StoredFunctorCall3: public Coroutine -{ - inline StoredFunctorCall3(int stackSize, FunctionPointer function, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) - : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2), arg3(arg3) {} -protected: - virtual void run() { function(arg1, arg2, arg3); } - FunctionPointer function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; - -template -struct StoredFunctorPointerCall3: public Coroutine -{ - inline StoredFunctorPointerCall3(int stackSize, FunctionPointer * function, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) - : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2), arg3(arg3) {} -protected: - virtual void run() { (*function)(arg1, arg2, arg3); } - FunctionPointer * function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; - -template -class StoredMemberFunctionCall3 : public Coroutine -{ -public: - StoredMemberFunctionCall3(int stackSize, void (Class::*fn)(Param1, Param2, Param3) , const Class &object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3){ } -protected: - virtual void run() - { - (object.*fn)(arg1, arg2, arg3); - } -private: - void (Class::*fn)(Param1, Param2, Param3); - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -class StoredConstMemberFunctionCall3 : public Coroutine -{ -public: - StoredConstMemberFunctionCall3(int stackSize, void (Class::*fn)(Param1, Param2, Param3) const, const Class &object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3){ } -protected: - virtual void run() - { - (object.*fn)(arg1, arg2, arg3); - } -private: - void (Class::*fn)(Param1, Param2, Param3)const; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -class StoredMemberFunctionPointerCall3 : public Coroutine -{ -public: - StoredMemberFunctionPointerCall3(int stackSize, void (Class::*fn)(Param1, Param2, Param3) , Class *object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3){ } -protected: - virtual void run() - { - (object->*fn)(arg1, arg2, arg3); - } -private: - void (Class::*fn)(Param1, Param2, Param3); - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -class StoredConstMemberFunctionPointerCall3 : public Coroutine -{ -public: - StoredConstMemberFunctionPointerCall3(int stackSize, void (Class::*fn)(Param1, Param2, Param3) const, Class const *object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3){ } -protected: - virtual void run() - { - (object->*fn)(arg1, arg2, arg3); - } -private: - void (Class::*fn)(Param1, Param2, Param3)const; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -struct StoredFunctorCall4: public Coroutine -{ - inline StoredFunctorCall4(int stackSize, FunctionPointer function, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) - : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4) {} -protected: - virtual void run() { function(arg1, arg2, arg3, arg4); } - FunctionPointer function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; - -template -struct StoredFunctorPointerCall4: public Coroutine -{ - inline StoredFunctorPointerCall4(int stackSize, FunctionPointer * function, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) - : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4) {} -protected: - virtual void run() { (*function)(arg1, arg2, arg3, arg4); } - FunctionPointer * function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; - -template -class StoredMemberFunctionCall4 : public Coroutine -{ -public: - StoredMemberFunctionCall4(int stackSize, void (Class::*fn)(Param1, Param2, Param3, Param4) , const Class &object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4){ } -protected: - virtual void run() - { - (object.*fn)(arg1, arg2, arg3, arg4); - } -private: - void (Class::*fn)(Param1, Param2, Param3, Param4); - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -class StoredConstMemberFunctionCall4 : public Coroutine -{ -public: - StoredConstMemberFunctionCall4(int stackSize, void (Class::*fn)(Param1, Param2, Param3, Param4) const, const Class &object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4){ } -protected: - virtual void run() - { - (object.*fn)(arg1, arg2, arg3, arg4); - } -private: - void (Class::*fn)(Param1, Param2, Param3, Param4)const; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -class StoredMemberFunctionPointerCall4 : public Coroutine -{ -public: - StoredMemberFunctionPointerCall4(int stackSize, void (Class::*fn)(Param1, Param2, Param3, Param4) , Class *object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4){ } -protected: - virtual void run() - { - (object->*fn)(arg1, arg2, arg3, arg4); - } -private: - void (Class::*fn)(Param1, Param2, Param3, Param4); - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -class StoredConstMemberFunctionPointerCall4 : public Coroutine -{ -public: - StoredConstMemberFunctionPointerCall4(int stackSize, void (Class::*fn)(Param1, Param2, Param3, Param4) const, Class const *object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4){ } -protected: - virtual void run() - { - (object->*fn)(arg1, arg2, arg3, arg4); - } -private: - void (Class::*fn)(Param1, Param2, Param3, Param4)const; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -struct StoredFunctorCall5: public Coroutine -{ - inline StoredFunctorCall5(int stackSize, FunctionPointer function, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) - : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5) {} -protected: - virtual void run() { function(arg1, arg2, arg3, arg4, arg5); } - FunctionPointer function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; - -template -struct StoredFunctorPointerCall5: public Coroutine -{ - inline StoredFunctorPointerCall5(int stackSize, FunctionPointer * function, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) - : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5) {} -protected: - virtual void run() { (*function)(arg1, arg2, arg3, arg4, arg5); } - FunctionPointer * function; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; - -template -class StoredMemberFunctionCall5 : public Coroutine -{ -public: - StoredMemberFunctionCall5(int stackSize, void (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) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5){ } -protected: - virtual void run() - { - (object.*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - void (Class::*fn)(Param1, Param2, Param3, Param4, Param5); - Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -class StoredConstMemberFunctionCall5 : public Coroutine -{ -public: - StoredConstMemberFunctionCall5(int stackSize, void (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) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5){ } -protected: - virtual void run() - { - (object.*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - void (Class::*fn)(Param1, Param2, Param3, Param4, Param5)const; - const Class object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -class StoredMemberFunctionPointerCall5 : public Coroutine -{ -public: - StoredMemberFunctionPointerCall5(int stackSize, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5) , Class *object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5){ } -protected: - virtual void run() - { - (object->*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - void (Class::*fn)(Param1, Param2, Param3, Param4, Param5); - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -class StoredConstMemberFunctionPointerCall5 : public Coroutine -{ -public: - StoredConstMemberFunctionPointerCall5(int stackSize, void (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) - : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5){ } -protected: - virtual void run() - { - (object->*fn)(arg1, arg2, arg3, arg4, arg5); - } -private: - void (Class::*fn)(Param1, Param2, Param3, Param4, Param5)const; - Class const *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; - -#endif // qdoc - -#endif diff --git a/src/coroutinestoredfunctioncall_p.h b/src/coroutinestoredfunctioncall_p.h new file mode 100644 index 0000000..73e7ddb --- /dev/null +++ b/src/coroutinestoredfunctioncall_p.h @@ -0,0 +1,535 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Toolkit. +** +****************************************************************************/ + +// Generated code, do not edit! Use generator at tools/generatebuild/ +#ifndef COROUTINE_STOREDFUNCTIONCALL_H +#define COROUTINE_STOREDFUNCTIONCALL_H + +#ifndef qdoc + +template +struct StoredFunctorCall0: public Coroutine +{ + inline StoredFunctorCall0(int stackSize, FunctionPointer function) + : Coroutine(stackSize), function(function) {} +protected: + virtual void run() { function(); } + FunctionPointer function; + +}; + +template +struct StoredFunctorPointerCall0: public Coroutine +{ + inline StoredFunctorPointerCall0(int stackSize, FunctionPointer * function) + : Coroutine(stackSize), function(function) {} +protected: + virtual void run() { (*function)(); } + FunctionPointer * function; + +}; + +template +class StoredMemberFunctionCall0 : public Coroutine +{ +public: + StoredMemberFunctionCall0(int stackSize, void (Class::*fn)() , const Class &object) + : Coroutine(stackSize), fn(fn), object(object){ } +protected: + virtual void run() + { + (object.*fn)(); + } +private: + void (Class::*fn)(); + Class object; + +}; +template +class StoredConstMemberFunctionCall0 : public Coroutine +{ +public: + StoredConstMemberFunctionCall0(int stackSize, void (Class::*fn)() const, const Class &object) + : Coroutine(stackSize), fn(fn), object(object){ } +protected: + virtual void run() + { + (object.*fn)(); + } +private: + void (Class::*fn)()const; + const Class object; + +}; +template +class StoredMemberFunctionPointerCall0 : public Coroutine +{ +public: + StoredMemberFunctionPointerCall0(int stackSize, void (Class::*fn)() , Class *object) + : Coroutine(stackSize), fn(fn), object(object){ } +protected: + virtual void run() + { + (object->*fn)(); + } +private: + void (Class::*fn)(); + Class *object; + +}; +template +class StoredConstMemberFunctionPointerCall0 : public Coroutine +{ +public: + StoredConstMemberFunctionPointerCall0(int stackSize, void (Class::*fn)() const, Class const *object) + : Coroutine(stackSize), fn(fn), object(object){ } +protected: + virtual void run() + { + (object->*fn)(); + } +private: + void (Class::*fn)()const; + Class const *object; + +}; +template +struct StoredFunctorCall1: public Coroutine +{ + inline StoredFunctorCall1(int stackSize, FunctionPointer function, const Arg1 &arg1) + : Coroutine(stackSize), function(function), arg1(arg1) {} +protected: + virtual void run() { function(arg1); } + FunctionPointer function; + Arg1 arg1; +}; + +template +struct StoredFunctorPointerCall1: public Coroutine +{ + inline StoredFunctorPointerCall1(int stackSize, FunctionPointer * function, const Arg1 &arg1) + : Coroutine(stackSize), function(function), arg1(arg1) {} +protected: + virtual void run() { (*function)(arg1); } + FunctionPointer * function; + Arg1 arg1; +}; + +template +class StoredMemberFunctionCall1 : public Coroutine +{ +public: + StoredMemberFunctionCall1(int stackSize, void (Class::*fn)(Param1) , const Class &object, const Arg1 &arg1) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1){ } +protected: + virtual void run() + { + (object.*fn)(arg1); + } +private: + void (Class::*fn)(Param1); + Class object; + Arg1 arg1; +}; +template +class StoredConstMemberFunctionCall1 : public Coroutine +{ +public: + StoredConstMemberFunctionCall1(int stackSize, void (Class::*fn)(Param1) const, const Class &object, const Arg1 &arg1) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1){ } +protected: + virtual void run() + { + (object.*fn)(arg1); + } +private: + void (Class::*fn)(Param1)const; + const Class object; + Arg1 arg1; +}; +template +class StoredMemberFunctionPointerCall1 : public Coroutine +{ +public: + StoredMemberFunctionPointerCall1(int stackSize, void (Class::*fn)(Param1) , Class *object, const Arg1 &arg1) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1){ } +protected: + virtual void run() + { + (object->*fn)(arg1); + } +private: + void (Class::*fn)(Param1); + Class *object; + Arg1 arg1; +}; +template +class StoredConstMemberFunctionPointerCall1 : public Coroutine +{ +public: + StoredConstMemberFunctionPointerCall1(int stackSize, void (Class::*fn)(Param1) const, Class const *object, const Arg1 &arg1) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1){ } +protected: + virtual void run() + { + (object->*fn)(arg1); + } +private: + void (Class::*fn)(Param1)const; + Class const *object; + Arg1 arg1; +}; +template +struct StoredFunctorCall2: public Coroutine +{ + inline StoredFunctorCall2(int stackSize, FunctionPointer function, const Arg1 &arg1, const Arg2 &arg2) + : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2) {} +protected: + virtual void run() { function(arg1, arg2); } + FunctionPointer function; + Arg1 arg1; Arg2 arg2; +}; + +template +struct StoredFunctorPointerCall2: public Coroutine +{ + inline StoredFunctorPointerCall2(int stackSize, FunctionPointer * function, const Arg1 &arg1, const Arg2 &arg2) + : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2) {} +protected: + virtual void run() { (*function)(arg1, arg2); } + FunctionPointer * function; + Arg1 arg1; Arg2 arg2; +}; + +template +class StoredMemberFunctionCall2 : public Coroutine +{ +public: + StoredMemberFunctionCall2(int stackSize, void (Class::*fn)(Param1, Param2) , const Class &object, const Arg1 &arg1, const Arg2 &arg2) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2){ } +protected: + virtual void run() + { + (object.*fn)(arg1, arg2); + } +private: + void (Class::*fn)(Param1, Param2); + Class object; + Arg1 arg1; Arg2 arg2; +}; +template +class StoredConstMemberFunctionCall2 : public Coroutine +{ +public: + StoredConstMemberFunctionCall2(int stackSize, void (Class::*fn)(Param1, Param2) const, const Class &object, const Arg1 &arg1, const Arg2 &arg2) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2){ } +protected: + virtual void run() + { + (object.*fn)(arg1, arg2); + } +private: + void (Class::*fn)(Param1, Param2)const; + const Class object; + Arg1 arg1; Arg2 arg2; +}; +template +class StoredMemberFunctionPointerCall2 : public Coroutine +{ +public: + StoredMemberFunctionPointerCall2(int stackSize, void (Class::*fn)(Param1, Param2) , Class *object, const Arg1 &arg1, const Arg2 &arg2) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2){ } +protected: + virtual void run() + { + (object->*fn)(arg1, arg2); + } +private: + void (Class::*fn)(Param1, Param2); + Class *object; + Arg1 arg1; Arg2 arg2; +}; +template +class StoredConstMemberFunctionPointerCall2 : public Coroutine +{ +public: + StoredConstMemberFunctionPointerCall2(int stackSize, void (Class::*fn)(Param1, Param2) const, Class const *object, const Arg1 &arg1, const Arg2 &arg2) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2){ } +protected: + virtual void run() + { + (object->*fn)(arg1, arg2); + } +private: + void (Class::*fn)(Param1, Param2)const; + Class const *object; + Arg1 arg1; Arg2 arg2; +}; +template +struct StoredFunctorCall3: public Coroutine +{ + inline StoredFunctorCall3(int stackSize, FunctionPointer function, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) + : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2), arg3(arg3) {} +protected: + virtual void run() { function(arg1, arg2, arg3); } + FunctionPointer function; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; + +template +struct StoredFunctorPointerCall3: public Coroutine +{ + inline StoredFunctorPointerCall3(int stackSize, FunctionPointer * function, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) + : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2), arg3(arg3) {} +protected: + virtual void run() { (*function)(arg1, arg2, arg3); } + FunctionPointer * function; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; + +template +class StoredMemberFunctionCall3 : public Coroutine +{ +public: + StoredMemberFunctionCall3(int stackSize, void (Class::*fn)(Param1, Param2, Param3) , const Class &object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3){ } +protected: + virtual void run() + { + (object.*fn)(arg1, arg2, arg3); + } +private: + void (Class::*fn)(Param1, Param2, Param3); + Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; +template +class StoredConstMemberFunctionCall3 : public Coroutine +{ +public: + StoredConstMemberFunctionCall3(int stackSize, void (Class::*fn)(Param1, Param2, Param3) const, const Class &object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3){ } +protected: + virtual void run() + { + (object.*fn)(arg1, arg2, arg3); + } +private: + void (Class::*fn)(Param1, Param2, Param3)const; + const Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; +template +class StoredMemberFunctionPointerCall3 : public Coroutine +{ +public: + StoredMemberFunctionPointerCall3(int stackSize, void (Class::*fn)(Param1, Param2, Param3) , Class *object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3){ } +protected: + virtual void run() + { + (object->*fn)(arg1, arg2, arg3); + } +private: + void (Class::*fn)(Param1, Param2, Param3); + Class *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; +template +class StoredConstMemberFunctionPointerCall3 : public Coroutine +{ +public: + StoredConstMemberFunctionPointerCall3(int stackSize, void (Class::*fn)(Param1, Param2, Param3) const, Class const *object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3){ } +protected: + virtual void run() + { + (object->*fn)(arg1, arg2, arg3); + } +private: + void (Class::*fn)(Param1, Param2, Param3)const; + Class const *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; +template +struct StoredFunctorCall4: public Coroutine +{ + inline StoredFunctorCall4(int stackSize, FunctionPointer function, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) + : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4) {} +protected: + virtual void run() { function(arg1, arg2, arg3, arg4); } + FunctionPointer function; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; + +template +struct StoredFunctorPointerCall4: public Coroutine +{ + inline StoredFunctorPointerCall4(int stackSize, FunctionPointer * function, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) + : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4) {} +protected: + virtual void run() { (*function)(arg1, arg2, arg3, arg4); } + FunctionPointer * function; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; + +template +class StoredMemberFunctionCall4 : public Coroutine +{ +public: + StoredMemberFunctionCall4(int stackSize, void (Class::*fn)(Param1, Param2, Param3, Param4) , const Class &object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4){ } +protected: + virtual void run() + { + (object.*fn)(arg1, arg2, arg3, arg4); + } +private: + void (Class::*fn)(Param1, Param2, Param3, Param4); + Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; +template +class StoredConstMemberFunctionCall4 : public Coroutine +{ +public: + StoredConstMemberFunctionCall4(int stackSize, void (Class::*fn)(Param1, Param2, Param3, Param4) const, const Class &object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4){ } +protected: + virtual void run() + { + (object.*fn)(arg1, arg2, arg3, arg4); + } +private: + void (Class::*fn)(Param1, Param2, Param3, Param4)const; + const Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; +template +class StoredMemberFunctionPointerCall4 : public Coroutine +{ +public: + StoredMemberFunctionPointerCall4(int stackSize, void (Class::*fn)(Param1, Param2, Param3, Param4) , Class *object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4){ } +protected: + virtual void run() + { + (object->*fn)(arg1, arg2, arg3, arg4); + } +private: + void (Class::*fn)(Param1, Param2, Param3, Param4); + Class *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; +template +class StoredConstMemberFunctionPointerCall4 : public Coroutine +{ +public: + StoredConstMemberFunctionPointerCall4(int stackSize, void (Class::*fn)(Param1, Param2, Param3, Param4) const, Class const *object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4){ } +protected: + virtual void run() + { + (object->*fn)(arg1, arg2, arg3, arg4); + } +private: + void (Class::*fn)(Param1, Param2, Param3, Param4)const; + Class const *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; +template +struct StoredFunctorCall5: public Coroutine +{ + inline StoredFunctorCall5(int stackSize, FunctionPointer function, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) + : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5) {} +protected: + virtual void run() { function(arg1, arg2, arg3, arg4, arg5); } + FunctionPointer function; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; + +template +struct StoredFunctorPointerCall5: public Coroutine +{ + inline StoredFunctorPointerCall5(int stackSize, FunctionPointer * function, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) + : Coroutine(stackSize), function(function), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5) {} +protected: + virtual void run() { (*function)(arg1, arg2, arg3, arg4, arg5); } + FunctionPointer * function; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; + +template +class StoredMemberFunctionCall5 : public Coroutine +{ +public: + StoredMemberFunctionCall5(int stackSize, void (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) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5){ } +protected: + virtual void run() + { + (object.*fn)(arg1, arg2, arg3, arg4, arg5); + } +private: + void (Class::*fn)(Param1, Param2, Param3, Param4, Param5); + Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; +template +class StoredConstMemberFunctionCall5 : public Coroutine +{ +public: + StoredConstMemberFunctionCall5(int stackSize, void (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) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5){ } +protected: + virtual void run() + { + (object.*fn)(arg1, arg2, arg3, arg4, arg5); + } +private: + void (Class::*fn)(Param1, Param2, Param3, Param4, Param5)const; + const Class object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; +template +class StoredMemberFunctionPointerCall5 : public Coroutine +{ +public: + StoredMemberFunctionPointerCall5(int stackSize, void (Class::*fn)(Param1, Param2, Param3, Param4, Param5) , Class *object, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5){ } +protected: + virtual void run() + { + (object->*fn)(arg1, arg2, arg3, arg4, arg5); + } +private: + void (Class::*fn)(Param1, Param2, Param3, Param4, Param5); + Class *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; +template +class StoredConstMemberFunctionPointerCall5 : public Coroutine +{ +public: + StoredConstMemberFunctionPointerCall5(int stackSize, void (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) + : Coroutine(stackSize), fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5){ } +protected: + virtual void run() + { + (object->*fn)(arg1, arg2, arg3, arg4, arg5); + } +private: + void (Class::*fn)(Param1, Param2, Param3, Param4, Param5)const; + Class const *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; + +#endif // qdoc + +#endif diff --git a/src/src.pro b/src/src.pro index 1bc6de1..027e51e 100644 --- a/src/src.pro +++ b/src/src.pro @@ -4,8 +4,9 @@ TARGET = coroutine HEADERS += \ coroutine.h \ - coroutinebuild.h \ - coroutinestoredfunctioncall.h + coroutinebuilddeclaration_p.h \ + coroutinebuilddefinition_p.h \ + coroutinestoredfunctioncall_p.h SOURCES += coroutine.cpp diff --git a/tests/auto/build/tst_build.cpp b/tests/auto/build/tst_build.cpp index c557d34..2574f61 100644 --- a/tests/auto/build/tst_build.cpp +++ b/tests/auto/build/tst_build.cpp @@ -1,6 +1,5 @@ #include #include -#include class tst_build: public QObject { @@ -33,7 +32,7 @@ static void fnArg(int start) void tst_build::staticFn() { - Coroutine* c1 = build(32000, &fnNoArg); + Coroutine* c1 = Coroutine::build(32000, &fnNoArg); QCOMPARE(fnCounter, -99); QCOMPARE(c1->cont(), true); QCOMPARE(fnCounter, 0); @@ -43,7 +42,7 @@ void tst_build::staticFn() QCOMPARE(fnCounter, 2); delete c1; - Coroutine* c2 = build(32000, &fnArg, 40); + Coroutine* c2 = Coroutine::build(32000, &fnArg, 40); QCOMPARE(c2->cont(), true); QCOMPARE(fnCounter, 40); QCOMPARE(c2->cont(), true); diff --git a/tools/generatebuild/main.cpp b/tools/generatebuild/main.cpp index 9a87938..43b141d 100644 --- a/tools/generatebuild/main.cpp +++ b/tools/generatebuild/main.cpp @@ -93,8 +93,9 @@ Item Line(Item item) return item + "\n"; } -Item generateBuildFunctions(int repeats) +Item generateBuildFunctionDefinitions(int repeats) { + Item nameReturn = "Coroutine* Coroutine::build("; Item functionPointerType = "void (*)(" + parameterTypesNoPrefix + ")"; Item functionPointerParameter = "void (*functionPointer)(" + parameterTypesNoPrefix + ")"; @@ -106,7 +107,7 @@ Item generateBuildFunctions(int repeats) // plain functions Repeater functions = Line (typenameTypesWithTemplate) + - Line ("Coroutine* build(" + stackSizeParameter + functionPointerParameter + functionParameters + ")") + + Line (nameReturn + stackSizeParameter + functionPointerParameter + functionParameters + ")") + Line("{") + Line(" return new StoredFunctorCall" + Counter() + "<" + functionPointerType + argumentTypes + ">(" + stackSizeArgument + "functionPointer" + arguments + ");") + @@ -115,7 +116,7 @@ Item generateBuildFunctions(int repeats) // function objects by value Repeater functionObjects = Line ("template ") + - Line ("Coroutine* build(" + stackSizeParameter + "FunctionObject functionObject" + functionParameters + ")") + + Line (nameReturn + stackSizeParameter + "FunctionObject functionObject" + functionParameters + ")") + Line("{") + Line(" return new StoredFunctorCall" + Counter() + "") + - Line ("Coroutine* build(" + stackSizeParameter + "FunctionObject *functionObject" + functionParameters + ")") + + Line (nameReturn + stackSizeParameter + "FunctionObject *functionObject" + functionParameters + ")") + Line("{") + Line(" return new StoredFunctorPointerCall" + Counter() + "") + - Line ("Coroutine* build(" + stackSizeParameter + "const Class &object, void (Class::*fn)(" + parameterTypesNoPrefix + ")" + functionParameters + ")") + + Line (nameReturn + stackSizeParameter + "const Class &object, void (Class::*fn)(" + parameterTypesNoPrefix + ")" + functionParameters + ")") + Line("{") + Line(" return new StoredMemberFunctionCall" + Counter() + "") + - Line ("Coroutine *build(" + stackSizeParameter + "const Class &object, void (Class::*fn)(" + parameterTypesNoPrefix + ") const" + functionParameters + ")") + + Line (nameReturn + stackSizeParameter + "const Class &object, void (Class::*fn)(" + parameterTypesNoPrefix + ") const" + functionParameters + ")") + Line("{") + Line(" return new StoredConstMemberFunctionCall" + Counter() + "") + - Line ("Coroutine* build(" + stackSizeParameter + "Class *object, void (Class::*fn)(" + parameterTypesNoPrefix + ")" + functionParameters + ")") + + Line (nameReturn + stackSizeParameter + "Class *object, void (Class::*fn)(" + parameterTypesNoPrefix + ")" + functionParameters + ")") + Line("{") + Line(" return new StoredMemberFunctionPointerCall" + Counter() + "") + - Line ("Coroutine* build(" + stackSizeParameter + "const Class *object, void (Class::*fn)(" + parameterTypesNoPrefix + ") const" + functionParameters + ")") + + Line (nameReturn + stackSizeParameter + "const Class *object, void (Class::*fn)(" + parameterTypesNoPrefix + ") const" + functionParameters + ")") + Line("{") + Line(" return new StoredConstMemberFunctionPointerCall" + Counter() + "") + + Line ("static Coroutine* build(" + stackSizeParameter + "FunctionObject functionObject" + functionParameters + ");"); + functionObjects.setRepeatCount(repeats); + + // function objects by pointer + Repeater functionObjectsPointer = Line ("template ") + + Line ("static Coroutine* build(" + stackSizeParameter + "FunctionObject *functionObject" + functionParameters + ");"); + functionObjectsPointer.setRepeatCount(repeats); + + // member functions by value + Repeater memberFunction = Line ("template ") + + Line ("static Coroutine* build(" + stackSizeParameter + "const Class &object, void (Class::*fn)(" + parameterTypesNoPrefix + ")" + functionParameters + ");"); + memberFunction.setRepeatCount(repeats); + + // const member functions by value + Repeater constMemberFunction = Line ("template ") + + Line ("static Coroutine *build(" + stackSizeParameter + "const Class &object, void (Class::*fn)(" + parameterTypesNoPrefix + ") const" + functionParameters + ");"); + constMemberFunction.setRepeatCount(repeats); + + // member functions by class pointer + Repeater memberFunctionPointer = Line ("template ") + + Line ("static Coroutine* build(" + stackSizeParameter + "Class *object, void (Class::*fn)(" + parameterTypesNoPrefix + ")" + functionParameters + ");"); + memberFunctionPointer.setRepeatCount(repeats); + + // const member functions by class pointer + Repeater constMemberFunctionPointer = Line ("template ") + + Line ("static Coroutine* build(" + stackSizeParameter + "const Class *object, void (Class::*fn)(" + parameterTypesNoPrefix + ") const" + functionParameters + ");"); + constMemberFunctionPointer.setRepeatCount(repeats); + + + return functions + Line("") + functionObjects + Line("") + functionObjectsPointer + Line("") + + memberFunction + Line("") + constMemberFunction + Line("") + + memberFunctionPointer + Line("") + constMemberFunctionPointer + Line("") + ; +} Item functions(Item className, Item functorType, Item callLine) { @@ -280,42 +333,44 @@ int main() Line("****************************************************************************/") + Line("") + Line("// Generated code, do not edit! Use generator at tools/generatebuild/") + - Line("#ifndef COROUTINE_MAKE_H") + - Line("#define COROUTINE_MAKE_H") + - Line("") + - Line("#include \"coroutine.h\"") + - Line("#include \"coroutinestoredfunctioncall.h\"") + -// Line("") + -// Line("QT_BEGIN_HEADER") + -// Line("QT_BEGIN_NAMESPACE") + -// Line("") + -// Line("QT_MODULE(Core)") + Line("") + Line("#ifdef qdoc") + -// Line("") + -// Line("namespace Coroutine {") + Line("") + - Line(" Coroutine* build(Function function, ...);") + -// Line("") + -// Line("} // namespace Coroutine") + + Line(" static Coroutine* build(Function function, ...);") + Line("") + Line("#else") + -// Line("") + -// Line("namespace Coroutine {") + Line("") + - generateBuildFunctions(repeats) + -// Line("") + -// Line("} //namespace Coroutine") + + generateBuildFunctionDeclarations(repeats) + Line("") + Line("#endif // qdoc") + + Line("") + ); + + writeFile("../../src/coroutinebuilddeclaration_p.h", run.generate()); + + Item buildDefinition = ( + Line("/****************************************************************************") + + Line("**") + + Line("** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).") + + Line("** Contact: Nokia Corporation (qt-info@nokia.com)") + + Line("**") + + Line("** This file is part of the Qt Toolkit.") + + Line("**") + + Line("****************************************************************************/") + + Line("") + + Line("// Generated code, do not edit! Use generator at tools/generatebuild/") + + Line("") + + Line("#include \"coroutinestoredfunctioncall_p.h\"") + Line("") + -// Line("QT_END_NAMESPACE") + -// Line("QT_END_HEADER") + -// Line("") + - Line("#endif") + Line("#ifndef qdoc") + + Line("") + + generateBuildFunctionDefinitions(repeats) + + Line("") + + Line("#endif // qdoc") + + Line("") ); - writeFile("../../src/coroutinebuild.h", run.generate()); + writeFile("../../src/coroutinebuilddefinition_p.h", buildDefinition.generate()); Item storedFunctionCall = ( Line("/****************************************************************************") + @@ -331,29 +386,16 @@ int main() Line("#ifndef COROUTINE_STOREDFUNCTIONCALL_H") + Line("#define COROUTINE_STOREDFUNCTIONCALL_H") + Line("") + - Line("#include \"coroutine.h\"") + -// Line("#include ") + -// Line("") + -// Line("QT_BEGIN_HEADER") + -// Line("QT_BEGIN_NAMESPACE") + -// Line("") + -// Line("QT_MODULE(Core)") + -// Line("") + Line("#ifndef qdoc") + Line("") + -// Line("namespace Coroutine {") + generateSFCs(repeats) + -// Line("} //namespace Coroutine") + Line("") + Line("#endif // qdoc") + Line("") + -// Line("QT_END_NAMESPACE") + -// Line("QT_END_HEADER") + -// Line("") + Line("#endif") ); - writeFile("../../src/coroutinestoredfunctioncall.h", storedFunctionCall.generate()); + writeFile("../../src/coroutinestoredfunctioncall_p.h", storedFunctionCall.generate()); } -- cgit v1.2.3