mirror of
https://github.com/pocoproject/poco.git
synced 2025-05-29 23:42:39 +02:00
trunk/branch integration: documentation
This commit is contained in:
parent
7b0716effa
commit
76f70d9358
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// NotificationStrategy.h
|
// NotificationStrategy.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/svn/Foundation/include/Poco/NotificationStrategy.h#2 $
|
// $Id: //poco/1.4/Foundation/include/Poco/NotificationStrategy.h#2 $
|
||||||
//
|
//
|
||||||
// Library: Foundation
|
// Library: Foundation
|
||||||
// Package: Events
|
// Package: Events
|
||||||
@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
// Definition of the NotificationStrategy interface.
|
// Definition of the NotificationStrategy interface.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@ -36,8 +36,8 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef Foundation_NotificationStrategy_INCLUDED
|
#ifndef Foundation_NotificationStrategy_INCLUDED
|
||||||
#define Foundation_NotificationStrategy_INCLUDED
|
#define Foundation_NotificationStrategy_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "Poco/Foundation.h"
|
#include "Poco/Foundation.h"
|
||||||
@ -48,31 +48,33 @@ namespace Poco {
|
|||||||
|
|
||||||
template <class TArgs, class TDelegate>
|
template <class TArgs, class TDelegate>
|
||||||
class NotificationStrategy
|
class NotificationStrategy
|
||||||
/// The interface that all notification strategies must implement.
|
/// The interface that all notification strategies must implement.
|
||||||
/// Note: Event is based on policy-driven design, so your strategy implementation
|
///
|
||||||
/// must offer all the methods from this interface (otherwise: compile errors)
|
/// Note: Event is based on policy-driven design, so every strategy implementation
|
||||||
/// but you don't need to extend from NotificationStrategy!
|
/// must provide all the methods from this interface (otherwise: compile errors)
|
||||||
|
/// but does not need to inherit from NotificationStrategy.
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NotificationStrategy()
|
NotificationStrategy()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~NotificationStrategy()
|
virtual ~NotificationStrategy()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void notify(const void* sender, TArgs& arguments) = 0;
|
virtual void notify(const void* sender, TArgs& arguments) = 0;
|
||||||
/// Sends a notification to all registered delegates,
|
/// Sends a notification to all registered delegates.
|
||||||
|
|
||||||
virtual void add(const TDelegate& pDelegate) = 0;
|
virtual void add(const TDelegate& pDelegate) = 0;
|
||||||
/// Adds a delegate to the strategy, if the delegate is not yet present
|
/// Adds a delegate to the strategy, if the delegate is not yet present
|
||||||
|
|
||||||
virtual void remove(const TDelegate& pDelegate) = 0;
|
virtual void remove(const TDelegate& delegate) = 0;
|
||||||
/// Removes a delegate from the strategy if found.
|
/// Removes a delegate from the strategy, if found.
|
||||||
|
/// Does nothing if the delegate has not been added.
|
||||||
|
|
||||||
virtual void clear() = 0;
|
virtual void clear() = 0;
|
||||||
/// Removes all delegates from the strategy.
|
/// Removes all delegates from the strategy.
|
||||||
|
|
||||||
virtual bool empty() const = 0;
|
virtual bool empty() const = 0;
|
||||||
/// Returns false if the strategy contains at least one delegate.
|
/// Returns false if the strategy contains at least one delegate.
|
||||||
@ -82,4 +84,4 @@ public:
|
|||||||
} // namespace Poco
|
} // namespace Poco
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif // Foundation_NotificationStrategy_INCLUDED
|
||||||
|
Loading…
x
Reference in New Issue
Block a user