Poco

template < class TArgs, class TDelegate, class TCompare >

class DefaultStrategy

Library: Foundation
Package: Events
Header: Poco/DefaultStrategy.h

Description

Default notification strategy. Allows one observer to register exactly once. The observer must provide an < (less-than) operator.

Inheritance

Direct Base Classes: NotificationStrategy < TArgs, TDelegate >

All Base Classes: NotificationStrategy < TArgs, TDelegate >

Member Summary

Member Functions: add, clear, empty, notify, operator =, remove

Types

ConstIterator

typedef typename Delegates::const_iterator ConstIterator;

Delegates

typedef std::set < TDelegate *, TCompare > Delegates;

Iterator

typedef typename Delegates::iterator Iterator;

Constructors

DefaultStrategy inline

DefaultStrategy();

DefaultStrategy inline

DefaultStrategy(
    const DefaultStrategy & s
);

Destructor

~DefaultStrategy inline

~DefaultStrategy();

Member Functions

add inline

void add(
    const TDelegate & delegate
);

clear inline

void clear();

empty inline

bool empty() const;

notify inline

void notify(
    const void * sender,
    TArgs & arguments
);

operator = inline

DefaultStrategy & operator = (
    const DefaultStrategy & s
);

remove inline

void remove(
    const TDelegate & delegate
);

Variables

_observers protected

Delegates _observers;