Poco

template < class C, class N >

class AsyncObserver

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

Description

AsyncObserver notifies subscribers in a dedicated thread (as opposed to (N)Observer classes, which notify subscribers synchronously). In order to become active and process notifications, the start() method must be called.

This class is meant to be used with the NotificationCenter only. Notification processing thread can be started only once, and copying should be done before start() is called.

Inheritance

Direct Base Classes: NObserver < C, N >

All Base Classes: NObserver < C, N >

Member Summary

Member Functions: backlog, clone, disable, notify, operator =, start

Types Aliases

Handler

using Handler = typename NObserver < C, N >::Handler;

Matcher

using Matcher = typename NObserver < C, N >::Matcher;

NotificationPtr

using NotificationPtr = typename NObserver < C, N >::NotificationPtr;

Type

using Type = AsyncObserver < C, N >;

Constructors

AsyncObserver

AsyncObserver() = delete;

AsyncObserver inline

AsyncObserver(
    const AsyncObserver & observer
);

AsyncObserver inline

AsyncObserver(
    C & object,
    Handler handler,
    Matcher matcher = nullptr
);

Destructor

~AsyncObserver inline

~AsyncObserver();

Member Functions

backlog virtual inline

virtual int backlog() const;

clone virtual inline

virtual AbstractObserver * clone() const;

disable virtual inline

virtual void disable();

notify virtual inline

virtual void notify(
    Notification * pNf
) const;

operator = inline

AsyncObserver & operator = (
    const AsyncObserver & observer
);

start virtual inline

virtual void start();