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.hpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/crepe/util/Proxy.hpp b/src/crepe/util/Proxy.hpp
new file mode 100644
index 0000000..ef2b69f
--- /dev/null
+++ b/src/crepe/util/Proxy.hpp
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "Proxy.h"
+
+namespace crepe {
+
+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> & Proxy<T>::operator=(Proxy & proxy) {
+ this->broker.set(T(proxy));
+ return *this;
+}
+
+template <typename T>
+Proxy<T>::operator const T &() {
+ return this->broker.get();
+}
+
+} // namespace crepe