summaryrefslogtreecommitdiffstats
path: root/engine/flattask.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engine/flattask.cpp')
-rw-r--r--engine/flattask.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/engine/flattask.cpp b/engine/flattask.cpp
new file mode 100644
index 0000000..b71f9d7
--- /dev/null
+++ b/engine/flattask.cpp
@@ -0,0 +1,23 @@
+#include "flattask.h"
+
+/* Static variable definition */
+std::list<task_s*> task_s::tasks;
+
+task_s::task_s()
+{
+ /* Push into the public callback list */
+ tasks.push_back(this);
+}
+
+task_s::~task_s()
+{
+ /* Remove from the public callback list */
+ tasks.remove(this);
+}
+
+void task_s::executeAll()
+{
+ for (task_s * task : task_s::tasks)
+ task->exec();
+}
+