summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/coroutine.cpp15
-rw-r--r--src/coroutine.h3
-rw-r--r--src/coroutinebuilddeclaration_p.h8
-rw-r--r--src/coroutinebuilddefinition_p.h4
-rw-r--r--src/coroutinestoredfunctioncall_p.h4
5 files changed, 11 insertions, 23 deletions
diff --git a/src/coroutine.cpp b/src/coroutine.cpp
index 35aaa94..d14bacf 100644
--- a/src/coroutine.cpp
+++ b/src/coroutine.cpp
@@ -11,7 +11,7 @@
Coroutines, also known as fibers, allow managing multiple stacks in the same
thread.
- New coroutines are made from functions, functors, etc by invoking Coroutine::build
+ New coroutines are made from functions, functors, etc by invoking Coroutine::build()
on them. Alternatively, it is possible to derive from Coroutine and overriding
the run() method.
@@ -20,7 +20,7 @@
At that point, the call to cont() returns. Subsequent calls to cont() will
continue execution of the coroutine just after the yield().
- Example:
+ \code
void myCoroutine()
{
qDebug() << "1";
@@ -33,6 +33,7 @@
c.cont(); // prints 1
qDebug() << "1.5";
c.cont(); // prints 2
+ \endcode
By default, a Coroutine will create its own stack space using createStack()
with the default argument. To manage the stack memory manually or to use
@@ -41,11 +42,11 @@
*/
/*!
- \fn Coroutine *Coroutine::build(Function function, ...)
+ \fn static Coroutine *Coroutine::build(Function function, ...)
Creates a new Coroutine from a callable object.
- The callable object, Function, can be a function pointer, functor or
+ The callable object, \a function, can be a function pointer, functor or
pointer to functor, object and member function pointer, or pointer to object
and member function pointer. In the case of passing functor pointers or
object pointers, the Coroutine object doesn't take ownership.
@@ -102,7 +103,7 @@ Coroutine::~Coroutine()
}
/*!
- Creates a stack of the given size for the coroutine.
+ Creates a stack of the given \a size for the coroutine.
The memory is owned by the Coroutine object and will be deleted on destruction.
Calling this function is only valid when in the NotStarted state.
@@ -121,8 +122,8 @@ void Coroutine::createStack(int size)
}
/*!
- Initializes the given area of memory to serve as the stack for the coroutine.
- The Coroutine object does not take ownership.
+ Initializes the area given by \a memory and \a size to serve as the stack
+ for the coroutine. The Coroutine object does not take ownership.
Calling this function is only valid when in the NotStarted state.
diff --git a/src/coroutine.h b/src/coroutine.h
index 4e9e959..5beb274 100644
--- a/src/coroutine.h
+++ b/src/coroutine.h
@@ -27,6 +27,9 @@ public:
static Coroutine *currentCoroutine();
+#ifdef qdoc
+ static Coroutine* build(Function function, ...);
+#endif
// add declarations for static build(...) function
#include "coroutinebuilddeclaration_p.h"
diff --git a/src/coroutinebuilddeclaration_p.h b/src/coroutinebuilddeclaration_p.h
index 2a58820..c588a71 100644
--- a/src/coroutinebuilddeclaration_p.h
+++ b/src/coroutinebuilddeclaration_p.h
@@ -9,12 +9,6 @@
// Generated code, do not edit! Use generator at tools/generatebuild/
-#ifdef qdoc
-
- static Coroutine* build(Function function, ...);
-
-#else
-
static Coroutine* build(void (*functionPointer)());
template <typename Param1, typename Arg1>
@@ -107,5 +101,3 @@ template <typename Class, typename Param1, typename Arg1, typename Param2, typen
static Coroutine* build(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
index b97291d..d7595c7 100644
--- a/src/coroutinebuilddefinition_p.h
+++ b/src/coroutinebuilddefinition_p.h
@@ -11,8 +11,6 @@
#include "coroutinestoredfunctioncall_p.h"
-#ifndef qdoc
-
Coroutine* Coroutine::build(void (*functionPointer)())
{
@@ -231,5 +229,3 @@ Coroutine* Coroutine::build(const Class *object, void (Class::*fn)(Param1, Param
}
-#endif // qdoc
-
diff --git a/src/coroutinestoredfunctioncall_p.h b/src/coroutinestoredfunctioncall_p.h
index bf55271..f900a9e 100644
--- a/src/coroutinestoredfunctioncall_p.h
+++ b/src/coroutinestoredfunctioncall_p.h
@@ -11,8 +11,6 @@
#ifndef COROUTINE_STOREDFUNCTIONCALL_H
#define COROUTINE_STOREDFUNCTIONCALL_H
-#ifndef qdoc
-
template <typename FunctionPointer>
struct StoredFunctorCall0: public Coroutine
{
@@ -530,6 +528,4 @@ private:
Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5;
};
-#endif // qdoc
-
#endif