aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/observable.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-20 13:17:16 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:56 +0200
commit78f5d8cf644383adf20933ad64c160c07c2c54fb (patch)
tree2a348d90f8f150665c379bf2f3741731999dd679 /src/interfaces/observable.hpp
parentb6061eff99907495de282f611e8389e6468a1fb0 (diff)
refactor: improve input configuring structure
Diffstat (limited to 'src/interfaces/observable.hpp')
-rw-r--r--src/interfaces/observable.hpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/interfaces/observable.hpp b/src/interfaces/observable.hpp
index 1777b7d..21fed76 100644
--- a/src/interfaces/observable.hpp
+++ b/src/interfaces/observable.hpp
@@ -1,8 +1,9 @@
#pragma once
-#include <functional>
+#include "interfaces/command.hpp"
-using Callback = std::function<void()>;
+#include <functional>
+#include <memory>
template <typename Event>
class IObservable
@@ -12,7 +13,8 @@ public:
virtual void listen() const noexcept = 0;
- virtual void attach(const Event &event, Callback callback) noexcept = 0;
+ virtual void attach(const char &event,
+ const std::shared_ptr<ICommand> &command) noexcept = 0;
virtual void notify(const Event &event) const noexcept = 0;
};