summaryrefslogtreecommitdiffstats
path: root/engine/include/core
diff options
context:
space:
mode:
authorancarola <raffaele.ancarola@epfl.ch>2019-01-25 22:05:15 +0100
committerancarola <raffaele.ancarola@epfl.ch>2019-01-25 22:05:15 +0100
commitfe75db9167f4327d2bb2353f94d84047666bb440 (patch)
treea1f67e5fff1d1f0458ae1ae4fb6e9d4ebf57b58c /engine/include/core
parentUpdate to make configure.py to build deps, instead of build.ninja (diff)
downloadflatland-fe75db9167f4327d2bb2353f94d84047666bb440.tar.gz
flatland-fe75db9167f4327d2bb2353f94d84047666bb440.zip
Core channel in flatland and signal test
Diffstat (limited to 'engine/include/core')
-rw-r--r--engine/include/core/object.hpp12
-rw-r--r--engine/include/core/signal.hpp15
2 files changed, 11 insertions, 16 deletions
diff --git a/engine/include/core/object.hpp b/engine/include/core/object.hpp
deleted file mode 100644
index cd5da5e..0000000
--- a/engine/include/core/object.hpp
+++ /dev/null
@@ -1,12 +0,0 @@
-#pragma once
-
-namespace flat
-{
- namespace core
- {
- struct object
- {
- // it exists
- };
- }
-}
diff --git a/engine/include/core/signal.hpp b/engine/include/core/signal.hpp
index 8a3d639..7d91150 100644
--- a/engine/include/core/signal.hpp
+++ b/engine/include/core/signal.hpp
@@ -4,7 +4,6 @@
#include <list>
#include <set>
#include <initializer_list>
-#include "object.hpp"
#include "task.hpp"
#include "types.hpp"
#include <functional>
@@ -14,6 +13,8 @@
namespace flat
{
+ class object;
+
namespace core
{
@@ -70,8 +71,7 @@ namespace flat
template<typename R, typename T>
static ptr create( R T::*mf,
T& obj,
- const std::initializer_list<std::string>& filters = {})
- {
+ const std::initializer_list<std::string>& filters = {}) {
return std::make_shared<listener>(std::bind(mf, obj), filters);
}
@@ -118,10 +118,17 @@ namespace flat
bool connect(listener* l);
void disconnect(listener* l);
+
+ listener::ptr connect(listener::callback f, const std::initializer_list<std::string>& filters = {});
+
+ template<typename R, typename T>
+ inline listener::ptr connect(R T::*mf, T& obj, const std::initializer_list<std::string>& filters = {}) {
+ return connect(std::bind(mf, obj));
+ }
static ptr find(const std::string&);
- static ptr create(const std::string& id, priority_t prior);
+ static ptr create(const std::string& id, priority_t prior = priority_t::none);
void check_and_call();
};