diff options
author | Nao Pross <naopross@thearcway.org> | 2019-02-03 09:40:55 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2019-02-03 09:40:55 +0100 |
commit | 73ae891dd8f0466f8866f401dcc1f0186767b2a3 (patch) | |
tree | 944c7957b160948be8ab08fd9829babc63a0fec6 | |
parent | Add release build to configure.py, fix bug in debug.hpp (diff) | |
download | flatland-73ae891dd8f0466f8866f401dcc1f0186767b2a3.tar.gz flatland-73ae891dd8f0466f8866f401dcc1f0186767b2a3.zip |
Clean up unused stuff in task, remove dead code in signal
-rw-r--r-- | engine/include/core/priority.hpp | 3 | ||||
-rw-r--r-- | engine/include/core/signal.hpp | 10 | ||||
-rw-r--r-- | engine/include/core/task.hpp | 1 | ||||
-rw-r--r-- | engine/task.cpp | 14 |
4 files changed, 10 insertions, 18 deletions
diff --git a/engine/include/core/priority.hpp b/engine/include/core/priority.hpp index 071b23c..5724d9d 100644 --- a/engine/include/core/priority.hpp +++ b/engine/include/core/priority.hpp @@ -35,6 +35,7 @@ namespace flat { bool operator()(const std::unique_ptr<const prioritized> lhs, const std::unique_ptr<const prioritized> rhs) { + // TODO: replace with a thread safe method (std::owner_less) return operator()(lhs.get(), rhs.get()); } @@ -45,6 +46,8 @@ namespace flat { if (auto r = rhs.lock()) { // if both valid, check their priority // in case they are the same, left is prioritized + + // TODO: replace with a thread safe method (std::owner_less) return operator()(l.get(), r.get()); } else { // if right is expired, left is prioritized diff --git a/engine/include/core/signal.hpp b/engine/include/core/signal.hpp index b52e789..f06a193 100644 --- a/engine/include/core/signal.hpp +++ b/engine/include/core/signal.hpp @@ -6,12 +6,10 @@ #include "labelled.hpp" #include "debug.hpp" -#include <map> #include <tuple> #include <list> #include <functional> #include <memory> -#include <cstddef> namespace flat::core @@ -239,11 +237,11 @@ namespace flat::core void broadcast(); /// connect a closure - template<typename ...Args, typename Closure> - std::shared_ptr<listener<Args...>> connect(Closure f) - { + // template<typename ...Args, typename Closure> + // std::shared_ptr<listener<Args...>> connect(Closure f) + // { // TODO: fix - } + // } /// connect a function template<typename R, typename ...Args> diff --git a/engine/include/core/task.hpp b/engine/include/core/task.hpp index d124adf..0339914 100644 --- a/engine/include/core/task.hpp +++ b/engine/include/core/task.hpp @@ -2,7 +2,6 @@ #include "priority.hpp" -#include <unordered_set> #include <functional> #include <variant> #include <memory> diff --git a/engine/task.cpp b/engine/task.cpp index d82c107..bfe0d45 100644 --- a/engine/task.cpp +++ b/engine/task.cpp @@ -1,16 +1,8 @@ #include "core/task.hpp" - -#include <functional> -#include <memory> -#include <algorithm> -#include <cassert> - -#include <vector> - -#include <iostream> #include "debug.hpp" -using namespace std; +#include <list> + namespace flat { namespace core { @@ -33,7 +25,7 @@ namespace flat { void job::invoke_tasks() { // expired tasks to remove - std::vector<job::value_type> to_erase; + std::list<job::value_type> to_erase; for (auto tp : *this) { // check that the task has not expired |