mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-14 23:07:56 +02:00
integrated changes for 1.2.3
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
//
|
||||
// Observer.h
|
||||
//
|
||||
// $Id: //poco/1.2/Foundation/include/Poco/Observer.h#1 $
|
||||
// $Id: //poco/1.2/Foundation/include/Poco/Observer.h#2 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Notifications
|
||||
// Module: NotificationCenter
|
||||
//
|
||||
// Definition of the Observer class.
|
||||
// Definition of the Observer class template.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
@@ -41,30 +41,12 @@
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/Notification.h"
|
||||
#include "Poco/AbstractObserver.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
class Foundation_API AbstractObserver
|
||||
/// The base class for all instantiations of
|
||||
/// the Observer template class.
|
||||
{
|
||||
public:
|
||||
AbstractObserver();
|
||||
AbstractObserver(const AbstractObserver& observer);
|
||||
virtual ~AbstractObserver();
|
||||
|
||||
AbstractObserver& operator = (const AbstractObserver& observer);
|
||||
|
||||
virtual void notify(Notification* pNf) const = 0;
|
||||
virtual bool equals(const AbstractObserver& observer) const = 0;
|
||||
virtual bool accepts(Notification* pNf) const = 0;
|
||||
virtual AbstractObserver* clone() const = 0;
|
||||
};
|
||||
|
||||
|
||||
template <class C, class N>
|
||||
class Observer: public AbstractObserver
|
||||
/// This template class implements an adapter that sits between
|
||||
@@ -74,6 +56,11 @@ class Observer: public AbstractObserver
|
||||
/// specific additional methods.
|
||||
/// See the NotificationCenter class for information on how
|
||||
/// to use this template class.
|
||||
///
|
||||
/// Instead of the Observer class template, you might want to
|
||||
/// use the NObserver class template, which uses an AutoPtr to
|
||||
/// pass the Notification to the callback function, thus freeing
|
||||
/// you from memory management issues.
|
||||
{
|
||||
public:
|
||||
typedef void (C::*Callback)(N*);
|
||||
|
Reference in New Issue
Block a user