aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/ValueBroker.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/ValueBroker.h')
-rw-r--r--src/crepe/ValueBroker.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/crepe/ValueBroker.h b/src/crepe/ValueBroker.h
new file mode 100644
index 0000000..c3359a1
--- /dev/null
+++ b/src/crepe/ValueBroker.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <functional>
+
+namespace crepe {
+
+template <typename T>
+class ValueBroker {
+public:
+ virtual void set(const T &);
+ virtual const T & get();
+
+ typedef std::function<void(const T & target)> setter_t;
+ typedef std::function<const T & ()> getter_t;
+private:
+ setter_t setter;
+ getter_t getter;
+public:
+ ValueBroker(const setter_t &, const getter_t &);
+ ValueBroker(T &);
+};
+
+}
+
+#include "ValueBroker.hpp"
+