Library: Foundation
Package: Notifications
Header: Poco/NObserver.h
This template class implements an adapter that sits between a NotificationCenter and an object receiving notifications from it. It is quite similar in concept to the RunnableAdapter, but provides some NotificationCenter specific additional methods. See the NotificationCenter class for information on how to use this template class.
This class template is quite similar to the Observer class template. The only difference is that the NObserver expects the callback function to accept a const AutoPtr& instead of a plain pointer as argument, thus simplifying memory management.
Direct Base Classes: AbstractObserver
All Base Classes: AbstractObserver
Member Functions: accepts, clone, disable, equals, notify, operator =
Inherited Functions: accepts, clone, disable, equals, notify, operator =
typedef AutoPtr < N > NotificationPtr;
typedef void (C::* Callback)(const NotificationPtr &);
NObserver(
const NObserver & observer
);
NObserver(
C & object,
Callback method
);
~NObserver();
bool accepts(
Notification * pNf
) const;
See also: Poco::AbstractObserver::accepts()
AbstractObserver * clone() const;
See also: Poco::AbstractObserver::clone()
void disable();
See also: Poco::AbstractObserver::disable()
bool equals(
const AbstractObserver & abstractObserver
) const;
See also: Poco::AbstractObserver::equals()
void notify(
Notification * pNf
) const;
See also: Poco::AbstractObserver::notify()
NObserver & operator = (
const NObserver & observer
);