Clear unregisters every previously registered callback, erasing every map entry. After this call, the list may still contain callbacks that are currently executing, but it will be cleared when they are done executing.
| 65 | //! are currently executing, but it will be cleared when they are done |
| 66 | //! executing. |
| 67 | void Clear() |
| 68 | { |
| 69 | LOCK(m_mutex); |
| 70 | for (const auto& entry : m_map) { |
| 71 | if (!--entry.second->count) m_list.erase(entry.second); |
| 72 | } |
| 73 | m_map.clear(); |
| 74 | } |
| 75 | |
| 76 | template<typename F> void Iterate(F&& f) |
| 77 | { |
no test coverage detected