AbstractObserver.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // AbstractObserver.h
  3. //
  4. // Library: Foundation
  5. // Package: Notifications
  6. // Module: NotificationCenter
  7. //
  8. // Definition of the AbstractObserver class.
  9. //
  10. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #ifndef Foundation_AbstractObserver_INCLUDED
  16. #define Foundation_AbstractObserver_INCLUDED
  17. #include "Poco/Foundation.h"
  18. #include "Poco/Notification.h"
  19. namespace Poco {
  20. class Foundation_API AbstractObserver
  21. /// The base class for all instantiations of
  22. /// the Observer and NObserver template classes.
  23. {
  24. public:
  25. AbstractObserver();
  26. AbstractObserver(const AbstractObserver& observer);
  27. virtual ~AbstractObserver();
  28. AbstractObserver& operator = (const AbstractObserver& observer);
  29. virtual void notify(Notification* pNf) const = 0;
  30. virtual bool equals(const AbstractObserver& observer) const = 0;
  31. virtual bool accepts(Notification* pNf) const = 0;
  32. virtual AbstractObserver* clone() const = 0;
  33. virtual void disable() = 0;
  34. };
  35. } // namespace Poco
  36. #endif // Foundation_AbstractObserver_INCLUDED