# Poco

# class AbstractObserver

Library: Foundation
Package: Notifications
Header: Poco/AbstractObserver.h

## Description

The base class for all instantiations of the Observer and NObserver template classes.

## Inheritance

Known Derived Classes: NObserver, Observer, Poco::Net::HTTPObserver

## Member Summary

Member Functions: accepts, acceptsSync, backlog, clone, disable, equals, notify, notifySync, operator =, start

## Constructors

### AbstractObserver

AbstractObserver();

### AbstractObserver

AbstractObserver(
const AbstractObserver & observer
);

### AbstractObserver

AbstractObserver(
AbstractObserver && observer
);

## Destructor

### ~AbstractObserver

virtual ~AbstractObserver();

## Member Functions

### accepts

virtual bool accepts(
Notification * pNf,
const char * pName
) const = 0;

### accepts

virtual bool accepts(
const Notification::Ptr & pNf
) const = 0;

### acceptsSync

virtual bool acceptsSync() const;

Returns true if this observer supports synchronous notification processing.

### backlog

virtual int backlog() const;

Returns number of queued messages that this Observer has. For non-active (synchronous) observers, always returns zero.

### clone

virtual AbstractObserver * clone() const = 0;

### disable

virtual void disable() = 0;

### equals

virtual bool equals(
const AbstractObserver & observer
) const = 0;

### notify

virtual void notify(
Notification * pNf
) const = 0;

### notifySync

virtual NotificationResult notifySync(
Notification * pNf
) const;

Synchronous notification processing. Blocks and returns a result. Default implementation throws NotImplementedException.

### operator =

AbstractObserver & operator = (
const AbstractObserver & observer
);

### operator =

AbstractObserver & operator = (
AbstractObserver && observer
);

### start

virtual void start();

No-op. This method can be implemented by inheriting classes which require explicit start in order to begin processing notifications.