aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/util/Proxy.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/util/Proxy.hpp')
-rw-r--r--src/crepe/util/Proxy.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/crepe/util/Proxy.hpp b/src/crepe/util/Proxy.hpp
new file mode 100644
index 0000000..c2cae93
--- /dev/null
+++ b/src/crepe/util/Proxy.hpp
@@ -0,0 +1,22 @@
+#pragma once
+
+#include "Proxy.h"
+
+namespace crepe::util {
+
+template <typename T>
+Proxy<T>::Proxy(ValueBroker<T> broker) : broker(broker) { }
+
+template <typename T>
+Proxy<T> & Proxy<T>::operator = (const T & val) {
+ this->broker.set(val);
+ return *this;
+}
+
+template <typename T>
+Proxy<T>::operator const T & () const {
+ return this->broker.get();
+}
+
+}
+