yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
notify.h
Go to the documentation of this file.
1#ifndef YAZE_UTIL_NOTIFY_H
2#define YAZE_UTIL_NOTIFY_H
3
4namespace yaze {
5namespace util {
6
12template <typename T>
14 public:
16 NotifyValue(const T &value)
17 : value_(value), modified_(false), temp_value_() {}
18
19 void set(const T &value) {
20 value_ = value;
21 modified_ = true;
22 }
23
24 const T &get() {
25 modified_ = false;
26 return value_;
27 }
28
30 modified_ = false;
32 return temp_value_;
33 }
34
36 if (temp_value_ != value_) {
38 modified_ = true;
39 }
40 }
41
42 void operator=(const T &value) { set(value); }
43 operator T() { return get(); }
44
45 bool modified() const { return modified_; }
46
47 private:
51};
52} // namespace util
53} // namespace yaze
54
55#endif
NotifyValue(const T &value)
Definition notify.h:16
void operator=(const T &value)
Definition notify.h:42
const T & get()
Definition notify.h:24
bool modified() const
Definition notify.h:45
void set(const T &value)
Definition notify.h:19
Main namespace for the application.
Definition controller.cc:18