remove function updated

This commit is contained in:
Александр 2019-08-18 17:42:18 +03:00 committed by leha-bot
parent a96e15cd51
commit 0e41fbf5e4
1 changed files with 8 additions and 8 deletions

View File

@ -46,19 +46,19 @@ public:
void set(FlagsType which) { void set(FlagsType which) {
if (auto diff = which ^ _value) { if (auto diff = which ^ _value) {
_value = which; _value = which;
updated(diff); //updated(diff);
} }
} }
void add(FlagsType which) { void add(FlagsType which) {
if (auto diff = which & ~_value) { if (auto diff = which & ~_value) {
_value |= which; _value |= which;
updated(diff); //updated(diff);
} }
} }
void remove(FlagsType which) { void remove(FlagsType which) {
if (auto diff = which & _value) { if (auto diff = which & _value) {
_value &= ~which; _value &= ~which;
updated(diff); //updated(diff);
} }
} }
FlagsType current() const { FlagsType current() const {
@ -74,11 +74,11 @@ public:
// } // }
private: private:
void updated(FlagsType diff) { // void updated(FlagsType diff) {
if ((diff &= FlagsType::from_raw(kEssential))) { // if ((diff &= FlagsType::from_raw(kEssential))) {
_changes.fire({ diff, _value }); // _changes.fire({ diff, _value });
} // }
} // }
FlagsType _value = 0; FlagsType _value = 0;
//rpl::event_stream<Change> _changes; //rpl::event_stream<Change> _changes;