aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/ValueBroker.h
blob: c3359a18b8460ec07e11c89ae79faec103bcd781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#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(const T & target)> setter_t;
	typedef std::function<const T & ()> getter_t;
private:
	setter_t setter;
	getter_t getter;
public:
	ValueBroker(const setter_t &, const getter_t &);
	ValueBroker(T &);
};

}

#include "ValueBroker.hpp"