Satisfies the promises passed to 'activate' and invokes the callback. Does nothing if 'activate' hasn't been called or 'notify' has been called already.
| 87 | // Does nothing if 'activate' hasn't been called or 'notify' has been |
| 88 | // called already. |
| 89 | void notify() { |
| 90 | if (active_) { |
| 91 | for (auto& promise : promises_) { |
| 92 | promise.setValue(); |
| 93 | } |
| 94 | promises_.clear(); |
| 95 | |
| 96 | if (callback_) { |
| 97 | callback_(); |
| 98 | } |
| 99 | |
| 100 | active_ = false; |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | private: |
| 105 | bool active_{false}; |
no test coverage detected