bool NotificationCenter::hasObserver(const AbstractObserver& observer) const { Mutex::ScopedLock lock(_mutex); for (ObserverList::const_iterator it = _observers.begin(); it != _observers.end(); ++it) if (observer.equals(**it)) return true; return false; }
void NotificationCenter::removeObserver(const AbstractObserver& observer) { Mutex::ScopedLock lock(_mutex); for (ObserverList::iterator it = _observers.begin(); it != _observers.end(); ++it) { if (observer.equals(**it)) { (*it)->disable(); _observers.erase(it); return; } } }