diff options
Diffstat (limited to 'src/crepe/ValueBroker.h')
-rw-r--r-- | src/crepe/ValueBroker.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/crepe/ValueBroker.h b/src/crepe/ValueBroker.h new file mode 100644 index 0000000..9d30a2e --- /dev/null +++ b/src/crepe/ValueBroker.h @@ -0,0 +1,27 @@ +#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(T & value, const T & target)> setter_t; + typedef std::function<const T & (T & value)> getter_t; +private: + T & value; + setter_t setter; + getter_t getter; +public: + ValueBroker(T &, const setter_t &, const getter_t &); + ValueBroker(T &); +}; + +} + +#include "ValueBroker.hpp" + |