aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/util/Proxy.h
blob: 789144a661250dbe5cc98c749ebf0d5740ce87ea (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
27
28
29
30
31
32
33
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"