From bbf2e88755838c482b0d95c85690a65343014c2e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 31 Jul 2014 16:13:08 +0200 Subject: [PATCH] qtconcurrent/generaterun: adapt to earlier changes in qtconcurrentrun.h Except for the license header and the new auto return functions, the qtconcurrentrun.h header is now reproduced faithfully again. Change-Id: Ib3b1ec10e75ddfb8e4bd8f7d765ce9d2fc1fc4f9 Reviewed-by: Olivier Goffart --- src/qtconcurrent/generaterun/main.cpp | 47 ++++++++++++++++------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/src/qtconcurrent/generaterun/main.cpp b/src/qtconcurrent/generaterun/main.cpp index 174a4b1..a2e26a0 100644 --- a/src/qtconcurrent/generaterun/main.cpp +++ b/src/qtconcurrent/generaterun/main.cpp @@ -103,8 +103,8 @@ Item generateRunFunctions(int repeats, bool withExplicitPoolArg) Repeater functions = Line ("template ") + Line ("QFuture run(" + pool + functionPointerParameter + functionParameters + ")") + Line("{") + - Line(" return (new QT_TYPENAME SelectStoredFunctorCall" + Counter() + "::type(functionPointer" + arguments + "))->start(" + startArg + ");") + + Line(" return (new StoredFunctorCall" + Counter() + "(functionPointer" + arguments + "))->start(" + startArg + ");") + Line("}"); functions.setRepeatCount(repeats); @@ -112,9 +112,9 @@ Item generateRunFunctions(int repeats, bool withExplicitPoolArg) Repeater functionObjects = Line ("template ") + Line ("QFuture run(" + pool + "FunctionObject functionObject" + functionParameters + ")") + Line("{") + - Line(" return (new QT_TYPENAME SelectStoredFunctorCall" + Counter() + - "::type(functionObject" + arguments + "))->start(" + startArg + ");") + + Line(" return (new StoredFunctorCall" + Counter() + + "(functionObject" + arguments + "))->start(" + startArg + ");") + Line("}"); functionObjects.setRepeatCount(repeats); @@ -122,8 +122,8 @@ Item generateRunFunctions(int repeats, bool withExplicitPoolArg) Repeater functionObjectsPointer = Line ("template ") + Line ("QFuture run(" + pool + "FunctionObject *functionObject" + functionParameters + ")") + Line("{") + - Line(" return (new QT_TYPENAME SelectStoredFunctorPointerCall" + Counter() + - "::type(functionObject" + arguments + "))->start(" + startArg + ");") + Line("}"); functionObjectsPointer.setRepeatCount(repeats); @@ -132,7 +132,7 @@ Item generateRunFunctions(int repeats, bool withExplicitPoolArg) Repeater memberFunction = Line ("template ") + Line ("QFuture run(" + pool + "const Class &object, T (Class::*fn)(" + parameterTypesNoPrefix + ")" + functionParameters + ")") + Line("{") + - Line(" return (new QT_TYPENAME SelectStoredMemberFunctionCall" + Counter() + + Line(" return (new typename SelectStoredMemberFunctionCall" + Counter() + "::type(fn, object" + arguments + "))->start(" + startArg + ");") + Line("}"); @@ -142,7 +142,7 @@ Item generateRunFunctions(int repeats, bool withExplicitPoolArg) Repeater constMemberFunction = Line ("template ") + Line ("QFuture run(" + pool + "const Class &object, T (Class::*fn)(" + parameterTypesNoPrefix + ") const" + functionParameters + ")") + Line("{") + - Line(" return (new QT_TYPENAME SelectStoredConstMemberFunctionCall" + Counter() + + Line(" return (new typename SelectStoredConstMemberFunctionCall" + Counter() + "::type(fn, object" + arguments + "))->start(" + startArg + ");") + Line("}"); @@ -152,7 +152,7 @@ Item generateRunFunctions(int repeats, bool withExplicitPoolArg) Repeater memberFunctionPointer = Line ("template ") + Line ("QFuture run(" + pool + "Class *object, T (Class::*fn)(" + parameterTypesNoPrefix + ")" + functionParameters + ")") + Line("{") + - Line(" return (new QT_TYPENAME SelectStoredMemberFunctionPointerCall" + Counter() + + Line(" return (new typename SelectStoredMemberFunctionPointerCall" + Counter() + "::type(fn, object" + arguments + "))->start(" + startArg + ");") + Line("}"); @@ -162,7 +162,7 @@ Item generateRunFunctions(int repeats, bool withExplicitPoolArg) Repeater constMemberFunctionPointer = Line ("template ") + Line ("QFuture run(" + pool + "const Class *object, T (Class::*fn)(" + parameterTypesNoPrefix + ") const" + functionParameters + ")") + Line("{") + - Line(" return (new QT_TYPENAME SelectStoredConstMemberFunctionPointerCall" + Counter() + + Line(" return (new typename SelectStoredConstMemberFunctionPointerCall" + Counter() + "::type(fn, object" + arguments + "))->start(" + startArg + ");") + Line("}"); @@ -348,17 +348,17 @@ int main(int argc, char *argv[]) Line("#ifndef QTCONCURRENT_RUN_H") + Line("#define QTCONCURRENT_RUN_H") + Line("") + + Line("#include ") + + Line("") + Line("#ifndef QT_NO_CONCURRENT") + Line("") + - Line("#include ") + - Line("#include ") + + Line("#include ") + + Line("#include ") + Line("") + - Line("QT_BEGIN_HEADER") + Line("QT_BEGIN_NAMESPACE") + Line("") + - Line("QT_MODULE(Core)") + Line("") + - Line("#ifdef qdoc") + + Line("#ifdef Q_QDOC") + Line("") + Line("namespace QtConcurrent {") + Line("") + @@ -379,10 +379,11 @@ int main(int argc, char *argv[]) generateRunFunctions(repeats, true) + Line("} //namespace QtConcurrent") + Line("") + - Line("#endif // qdoc") + + Line("#endif // Q_QDOC") + Line("") + Line("QT_END_NAMESPACE") + - Line("QT_END_HEADER") + + Line("") + + Line("#endif // QT_NO_CONCURRENT") + Line("") + Line("#endif") ); @@ -406,23 +407,19 @@ int main(int argc, char *argv[]) Line("#include ") + Line("") + Line("#ifndef QT_NO_CONCURRENT") + - Line("#include ") + + Line("#include ") + Line("") + - Line("QT_BEGIN_HEADER") + Line("QT_BEGIN_NAMESPACE") + Line("") + - Line("QT_MODULE(Core)") + - Line("") + - Line("#ifndef qdoc") + + Line("#ifndef Q_QDOC") + Line("") + Line("namespace QtConcurrent {") + generateSFCs(repeats) + Line("} //namespace QtConcurrent") + Line("") + - Line("#endif // qdoc") + + Line("#endif // Q_QDOC") + Line("") + Line("QT_END_NAMESPACE") + - Line("QT_END_HEADER") + Line("") + Line("#endif // QT_NO_CONCURRENT") + Line("") + -- 2.7.4