diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-27 16:50:20 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-27 16:50:20 +0100 |
commit | ecc5761fa78ccb57db958467c3fc999aceadd409 (patch) | |
tree | 8e5f24133473de3f122d59262727a9f0a3a806c9 /src/crepe/util/Proxy.hpp | |
parent | e0b1ddae296037376948a4c6f200d89e6d1ba81e (diff) |
fix valuebroker/proxy system
Diffstat (limited to 'src/crepe/util/Proxy.hpp')
-rw-r--r-- | src/crepe/util/Proxy.hpp | 22 |
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..5738d9c --- /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(); +} + +} + |