summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2010-03-23 09:06:17 +0100
committerChristian Kamm <christian.d.kamm@nokia.com>2010-03-26 13:05:03 +0100
commitf05141cc12f73daf5901b5bfe5d1271b3a4f8449 (patch)
tree281effca8ca6a106ee909175f4eaad97852ef7a7
parent863b9b8710be57f8f9a11b1c837878bfa6140764 (diff)
Make build() function static inside Coroutine.
-rw-r--r--src/coroutine.h6
-rw-r--r--src/coroutinebuilddeclaration_p.h111
-rw-r--r--src/coroutinebuilddefinition_p.h (renamed from src/coroutinebuild.h)96
-rw-r--r--src/coroutinestoredfunctioncall_p.h (renamed from src/coroutinestoredfunctioncall.h)1
-rw-r--r--src/src.pro5
-rw-r--r--tests/auto/build/tst_build.cpp5
-rw-r--r--tools/generatebuild/main.cpp136
7 files changed, 255 insertions, 105 deletions
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/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 <typename Param1, typename Arg1>
+static Coroutine* build(int stackSize, void (*functionPointer)(Param1), const Arg1 &arg1);
+template <typename Param1, typename Arg1, typename Param2, typename Arg2>
+static Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2);
+template <typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
+static Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3);
+template <typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
+static Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4);
+template <typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
+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 <typename FunctionObject>
+static Coroutine* build(int stackSize, FunctionObject functionObject);
+template <typename FunctionObject, typename Arg1>
+static Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1);
+template <typename FunctionObject, typename Arg1, typename Arg2>
+static Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2);
+template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3>
+static Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3);
+template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
+static Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4);
+template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
+static Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5);
+
+template <typename FunctionObject>
+static Coroutine* build(int stackSize, FunctionObject *functionObject);
+template <typename FunctionObject, typename Arg1>
+static Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1);
+template <typename FunctionObject, typename Arg1, typename Arg2>
+static Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2);
+template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3>
+static Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3);
+template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
+static Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4);
+template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
+static Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5);
+
+template <typename Class>
+static Coroutine* build(int stackSize, const Class &object, void (Class::*fn)());
+template <typename Class, typename Param1, typename Arg1>
+static Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1), const Arg1 &arg1);
+template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
+static Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2);
+template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
+static Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3);
+template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
+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 <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
+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 <typename Class>
+static Coroutine *build(int stackSize, const Class &object, void (Class::*fn)() const);
+template <typename Class, typename Param1, typename Arg1>
+static Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1) const, const Arg1 &arg1);
+template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
+static Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2);
+template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
+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 <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
+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 <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
+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 <typename Class>
+static Coroutine* build(int stackSize, Class *object, void (Class::*fn)());
+template <typename Class, typename Param1, typename Arg1>
+static Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1), const Arg1 &arg1);
+template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
+static Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2);
+template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
+static Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3);
+template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
+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 <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
+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 <typename Class>
+static Coroutine* build(int stackSize, const Class *object, void (Class::*fn)() const);
+template <typename Class, typename Param1, typename Arg1>
+static Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1) const, const Arg1 &arg1);
+template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
+static Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2);
+template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
+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 <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
+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 <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
+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/coroutinebuild.h b/src/coroutinebuilddefinition_p.h
index ddff983..bf624c1 100644
--- a/src/coroutinebuild.h
+++ b/src/coroutinebuilddefinition_p.h
@@ -8,231 +8,224 @@
****************************************************************************/
// Generated code, do not edit! Use generator at tools/generatebuild/
-#ifndef COROUTINE_MAKE_H
-#define COROUTINE_MAKE_H
-#include "coroutine.h"
-#include "coroutinestoredfunctioncall.h"
+#include "coroutinestoredfunctioncall_p.h"
-#ifdef qdoc
+#ifndef qdoc
- Coroutine* build(Function function, ...);
-#else
-
-
-Coroutine* build(int stackSize, void (*functionPointer)())
+Coroutine* Coroutine::build(int stackSize, void (*functionPointer)())
{
return new StoredFunctorCall0<void (*)()>(stackSize, functionPointer);
}
template <typename Param1, typename Arg1>
-Coroutine* build(int stackSize, void (*functionPointer)(Param1), const Arg1 &arg1)
+Coroutine* Coroutine::build(int stackSize, void (*functionPointer)(Param1), const Arg1 &arg1)
{
return new StoredFunctorCall1<void (*)(Param1), Arg1>(stackSize, functionPointer, arg1);
}
template <typename Param1, typename Arg1, typename Param2, typename Arg2>
-Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2)
+Coroutine* Coroutine::build(int stackSize, void (*functionPointer)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2)
{
return new StoredFunctorCall2<void (*)(Param1, Param2), Arg1, Arg2>(stackSize, functionPointer, arg1, arg2);
}
template <typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
-Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
+Coroutine* Coroutine::build(int stackSize, void (*functionPointer)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
return new StoredFunctorCall3<void (*)(Param1, Param2, Param3), Arg1, Arg2, Arg3>(stackSize, functionPointer, arg1, arg2, arg3);
}
template <typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
-Coroutine* build(int stackSize, void (*functionPointer)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
+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<void (*)(Param1, Param2, Param3, Param4), Arg1, Arg2, Arg3, Arg4>(stackSize, functionPointer, arg1, arg2, arg3, arg4);
}
template <typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
-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)
+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<void (*)(Param1, Param2, Param3, Param4, Param5), Arg1, Arg2, Arg3, Arg4, Arg5>(stackSize, functionPointer, arg1, arg2, arg3, arg4, arg5);
}
template <typename FunctionObject>
-Coroutine* build(int stackSize, FunctionObject functionObject)
+Coroutine* Coroutine::build(int stackSize, FunctionObject functionObject)
{
return new StoredFunctorCall0<FunctionObject>(stackSize, functionObject);
}
template <typename FunctionObject, typename Arg1>
-Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1)
+Coroutine* Coroutine::build(int stackSize, FunctionObject functionObject, const Arg1 &arg1)
{
return new StoredFunctorCall1<FunctionObject, Arg1>(stackSize, functionObject, arg1);
}
template <typename FunctionObject, typename Arg1, typename Arg2>
-Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2)
+Coroutine* Coroutine::build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2)
{
return new StoredFunctorCall2<FunctionObject, Arg1, Arg2>(stackSize, functionObject, arg1, arg2);
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3>
-Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
+Coroutine* Coroutine::build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
return new StoredFunctorCall3<FunctionObject, Arg1, Arg2, Arg3>(stackSize, functionObject, arg1, arg2, arg3);
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
-Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
+Coroutine* Coroutine::build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
return new StoredFunctorCall4<FunctionObject, Arg1, Arg2, Arg3, Arg4>(stackSize, functionObject, arg1, arg2, arg3, arg4);
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
-Coroutine* build(int stackSize, FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
+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<FunctionObject, Arg1, Arg2, Arg3, Arg4, Arg5>(stackSize, functionObject, arg1, arg2, arg3, arg4, arg5);
}
template <typename FunctionObject>
-Coroutine* build(int stackSize, FunctionObject *functionObject)
+Coroutine* Coroutine::build(int stackSize, FunctionObject *functionObject)
{
return new StoredFunctorPointerCall0<FunctionObject>(stackSize, functionObject);
}
template <typename FunctionObject, typename Arg1>
-Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1)
+Coroutine* Coroutine::build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1)
{
return new StoredFunctorPointerCall1<FunctionObject, Arg1>(stackSize, functionObject, arg1);
}
template <typename FunctionObject, typename Arg1, typename Arg2>
-Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2)
+Coroutine* Coroutine::build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2)
{
return new StoredFunctorPointerCall2<FunctionObject, Arg1, Arg2>(stackSize, functionObject, arg1, arg2);
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3>
-Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
+Coroutine* Coroutine::build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
return new StoredFunctorPointerCall3<FunctionObject, Arg1, Arg2, Arg3>(stackSize, functionObject, arg1, arg2, arg3);
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
-Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
+Coroutine* Coroutine::build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
return new StoredFunctorPointerCall4<FunctionObject, Arg1, Arg2, Arg3, Arg4>(stackSize, functionObject, arg1, arg2, arg3, arg4);
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
-Coroutine* build(int stackSize, FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
+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<FunctionObject, Arg1, Arg2, Arg3, Arg4, Arg5>(stackSize, functionObject, arg1, arg2, arg3, arg4, arg5);
}
template <typename Class>
-Coroutine* build(int stackSize, const Class &object, void (Class::*fn)())
+Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)())
{
return new StoredMemberFunctionCall0<Class>(stackSize, fn, object);
}
template <typename Class, typename Param1, typename Arg1>
-Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1), const Arg1 &arg1)
+Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1), const Arg1 &arg1)
{
return new StoredMemberFunctionCall1<Class, Param1, Arg1>(stackSize, fn, object, arg1);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
-Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2)
+Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2)
{
return new StoredMemberFunctionCall2<Class, Param1, Arg1, Param2, Arg2>(stackSize, fn, object, arg1, arg2);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
-Coroutine* build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
+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<Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>(stackSize, fn, object, arg1, arg2, arg3);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
-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)
+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<Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>(stackSize, fn, object, arg1, arg2, arg3, arg4);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
-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)
+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<Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>(stackSize, fn, object, arg1, arg2, arg3, arg4, arg5);
}
template <typename Class>
-Coroutine *build(int stackSize, const Class &object, void (Class::*fn)() const)
+Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)() const)
{
return new StoredConstMemberFunctionCall0<Class>(stackSize, fn, object);
}
template <typename Class, typename Param1, typename Arg1>
-Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1) const, const Arg1 &arg1)
+Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1) const, const Arg1 &arg1)
{
return new StoredConstMemberFunctionCall1<Class, Param1, Arg1>(stackSize, fn, object, arg1);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
-Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2)
+Coroutine* Coroutine::build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2)
{
return new StoredConstMemberFunctionCall2<Class, Param1, Arg1, Param2, Arg2>(stackSize, fn, object, arg1, arg2);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
-Coroutine *build(int stackSize, const Class &object, void (Class::*fn)(Param1, Param2, Param3) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
+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<Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>(stackSize, fn, object, arg1, arg2, arg3);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
-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)
+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<Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>(stackSize, fn, object, arg1, arg2, arg3, arg4);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
-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)
+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<Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>(stackSize, fn, object, arg1, arg2, arg3, arg4, arg5);
}
template <typename Class>
-Coroutine* build(int stackSize, Class *object, void (Class::*fn)())
+Coroutine* Coroutine::build(int stackSize, Class *object, void (Class::*fn)())
{
return new StoredMemberFunctionPointerCall0<Class>(stackSize, fn, object);
}
template <typename Class, typename Param1, typename Arg1>
-Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1), const Arg1 &arg1)
+Coroutine* Coroutine::build(int stackSize, Class *object, void (Class::*fn)(Param1), const Arg1 &arg1)
{
return new StoredMemberFunctionPointerCall1<Class, Param1, Arg1>(stackSize, fn, object, arg1);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
-Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2)
+Coroutine* Coroutine::build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2)
{
return new StoredMemberFunctionPointerCall2<Class, Param1, Arg1, Param2, Arg2>(stackSize, fn, object, arg1, arg2);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
-Coroutine* build(int stackSize, Class *object, void (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
+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<Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>(stackSize, fn, object, arg1, arg2, arg3);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
-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)
+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<Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>(stackSize, fn, object, arg1, arg2, arg3, arg4);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
-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)
+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<Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>(stackSize, fn, object, arg1, arg2, arg3, arg4, arg5);
}
template <typename Class>
-Coroutine* build(int stackSize, const Class *object, void (Class::*fn)() const)
+Coroutine* Coroutine::build(int stackSize, const Class *object, void (Class::*fn)() const)
{
return new StoredConstMemberFunctionPointerCall0<Class>(stackSize, fn, object);
}
template <typename Class, typename Param1, typename Arg1>
-Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1) const, const Arg1 &arg1)
+Coroutine* Coroutine::build(int stackSize, const Class *object, void (Class::*fn)(Param1) const, const Arg1 &arg1)
{
return new StoredConstMemberFunctionPointerCall1<Class, Param1, Arg1>(stackSize, fn, object, arg1);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
-Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2)
+Coroutine* Coroutine::build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2)
{
return new StoredConstMemberFunctionPointerCall2<Class, Param1, Arg1, Param2, Arg2>(stackSize, fn, object, arg1, arg2);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
-Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1, Param2, Param3) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
+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<Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>(stackSize, fn, object, arg1, arg2, arg3);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
-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)
+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<Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>(stackSize, fn, object, arg1, arg2, arg3, arg4);
}
template <typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
-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)
+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<Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>(stackSize, fn, object, arg1, arg2, arg3, arg4, arg5);
}
@@ -240,4 +233,3 @@ Coroutine* build(int stackSize, const Class *object, void (Class::*fn)(Param1, P
#endif // qdoc
-#endif
diff --git a/src/coroutinestoredfunctioncall.h b/src/coroutinestoredfunctioncall_p.h
index bdcc329..73e7ddb 100644
--- a/src/coroutinestoredfunctioncall.h
+++ b/src/coroutinestoredfunctioncall_p.h
@@ -11,7 +11,6 @@
#ifndef COROUTINE_STOREDFUNCTIONCALL_H
#define COROUTINE_STOREDFUNCTIONCALL_H
-#include "coroutine.h"
#ifndef qdoc
template <typename FunctionPointer>
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 <QtTest/QtTest>
#include <coroutine.h>
-#include <coroutinebuild.h>
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 <typename FunctionObject" + typenameArgumentTypes + ">") +
- Line ("Coroutine* build(" + stackSizeParameter + "FunctionObject functionObject" + functionParameters + ")") +
+ Line (nameReturn + stackSizeParameter + "FunctionObject functionObject" + functionParameters + ")") +
Line("{") +
Line(" return new StoredFunctorCall" + Counter() +
"<FunctionObject" +
@@ -125,7 +126,7 @@ Item generateBuildFunctions(int repeats)
// function objects by pointer
Repeater functionObjectsPointer = Line ("template <typename FunctionObject" + typenameArgumentTypes + ">") +
- Line ("Coroutine* build(" + stackSizeParameter + "FunctionObject *functionObject" + functionParameters + ")") +
+ Line (nameReturn + stackSizeParameter + "FunctionObject *functionObject" + functionParameters + ")") +
Line("{") +
Line(" return new StoredFunctorPointerCall" + Counter() +
"<FunctionObject" +
@@ -135,7 +136,7 @@ Item generateBuildFunctions(int repeats)
// member functions by value
Repeater memberFunction = Line ("template <typename Class" + typenameTypes + ">") +
- 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() +
"<Class" +
@@ -145,7 +146,7 @@ Item generateBuildFunctions(int repeats)
// const member functions by value
Repeater constMemberFunction = Line ("template <typename Class" + typenameTypes + ">") +
- 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() +
"<Class" +
@@ -155,7 +156,7 @@ Item generateBuildFunctions(int repeats)
// member functions by class pointer
Repeater memberFunctionPointer = Line ("template <typename Class" + typenameTypes + ">") +
- 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() +
"<Class" +
@@ -165,7 +166,7 @@ Item generateBuildFunctions(int repeats)
// const member functions by class pointer
Repeater constMemberFunctionPointer = Line ("template <typename Class" + typenameTypes + ">") +
- 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() +
"<Class" +
@@ -180,6 +181,58 @@ Item generateBuildFunctions(int repeats)
;
}
+Item generateBuildFunctionDeclarations(int repeats)
+{
+ Item functionPointerType = "void (*)(" + parameterTypesNoPrefix + ")";
+
+ Item functionPointerParameter = "void (*functionPointer)(" + parameterTypesNoPrefix + ")";
+
+ Item stackSizeParameter = "int stackSize, ";
+ Item stackSizeArgument = "stackSize, ";
+
+
+
+ // plain functions
+ Repeater functions = Line (typenameTypesWithTemplate) +
+ Line ("static Coroutine* build(" + stackSizeParameter + functionPointerParameter + functionParameters + ");");
+ functions.setRepeatCount(repeats);
+
+ // function objects by value
+ Repeater functionObjects = Line ("template <typename FunctionObject" + typenameArgumentTypes + ">") +
+ Line ("static Coroutine* build(" + stackSizeParameter + "FunctionObject functionObject" + functionParameters + ");");
+ functionObjects.setRepeatCount(repeats);
+
+ // function objects by pointer
+ Repeater functionObjectsPointer = Line ("template <typename FunctionObject" + typenameArgumentTypes + ">") +
+ Line ("static Coroutine* build(" + stackSizeParameter + "FunctionObject *functionObject" + functionParameters + ");");
+ functionObjectsPointer.setRepeatCount(repeats);
+
+ // member functions by value
+ Repeater memberFunction = Line ("template <typename Class" + typenameTypes + ">") +
+ 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 <typename Class" + typenameTypes + ">") +
+ 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 <typename Class" + typenameTypes + ">") +
+ 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 <typename Class" + typenameTypes + ">") +
+ 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 <QtCore/qtconcurrentrunbase.h>") +
-// 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());
}