Logo Search packages:      
Sourcecode: poco version File versions

void Poco::NotificationCenter::removeObserver ( const AbstractObserver observer  ) 

Registers an observer with the NotificationCenter. Usage: Observer<MyClass, MyNotification> obs(*this, &MyClass::handleNotification); notificationCenter.addObserver(obs);

Alternatively, the NObserver template class can be used instead of Observer.

Definition at line 68 of file NotificationCenter.cpp.

References Poco::AbstractObserver::equals().

Referenced by Poco::Net::SocketNotifier::removeObserver(), and Poco::TaskManager::removeObserver().

      Mutex::ScopedLock lock(_mutex);
      for (ObserverList::iterator it = _observers.begin(); it != _observers.end(); ++it)
            if (*it && observer.equals(**it))
                  delete *it;
                  *it = 0;

Generated by  Doxygen 1.6.0   Back to index