| 40 | } |
| 41 | |
| 42 | void KeyValue::detach(KeyObserver& observer, bool sendEmptyValue) |
| 43 | { |
| 44 | // Send final empty value if requested |
| 45 | if (sendEmptyValue) |
| 46 | observer.onKeyValueChanged(_emptyValue); |
| 47 | |
| 48 | // Remove the observer if present |
| 49 | auto found = std::find(_observers.begin(), _observers.end(), &observer); |
| 50 | if (found != _observers.end()) |
| 51 | _observers.erase(found); |
| 52 | } |
| 53 | |
| 54 | const std::string& KeyValue::get() const |
| 55 | { |
no test coverage detected