diff options
Diffstat (limited to 'src/crepe/util/Proxy.h')
-rw-r--r-- | src/crepe/util/Proxy.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/crepe/util/Proxy.h b/src/crepe/util/Proxy.h new file mode 100644 index 0000000..789144a --- /dev/null +++ b/src/crepe/util/Proxy.h @@ -0,0 +1,34 @@ +#pragma once + +#include "ValueBroker.h" + +namespace crepe { + +/** + * \brief Utility wrapper for \c ValueBroker + * + * This class can be used to to wrap a ValueBroker instance so it behaves like a regular + * variable. + * + * \tparam T Type of the underlying variable + */ +template <typename T> +class Proxy { +public: + //! Set operator + Proxy & operator=(Proxy &); + //! Set operator + Proxy & operator=(const T &); + //! Get operator + operator const T &(); + +public: + Proxy(ValueBroker<T>); + +private: + ValueBroker<T> broker; +}; + +} // namespace crepe + +#include "Proxy.hpp" |