Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
Poco::DefaultStrategy< void, TDelegate > Class Template Reference

#include <DefaultStrategy.h>

+ Inheritance diagram for Poco::DefaultStrategy< void, TDelegate >:
+ Collaboration diagram for Poco::DefaultStrategy< void, TDelegate >:

Public Types

using DelegateHandle = TDelegate*
 
using DelegatePtr = SharedPtr<TDelegate>
 
using Delegates = std::vector<DelegatePtr>
 
using Iterator = typename Delegates::iterator
 
- Public Types inherited from Poco::NotificationStrategy< void, TDelegate >
using DelegateHandle = TDelegate*
 

Public Member Functions

 DefaultStrategy ()
 
 DefaultStrategy (const DefaultStrategy &s)
 
 ~DefaultStrategy ()
 
void notify (const void *sender)
 
DelegateHandle add (const TDelegate &delegate)
 Sends a notification to all registered delegates.
 
void remove (const TDelegate &delegate)
 Adds a delegate to the strategy.
 
void remove (DelegateHandle delegateHandle)
 
DefaultStrategyoperator= (const DefaultStrategy &s)
 
void clear ()
 
bool empty () const
 Removes all delegates from the strategy.
 
- Public Member Functions inherited from Poco::NotificationStrategy< void, TDelegate >
 NotificationStrategy ()
 
virtual ~NotificationStrategy ()
 

Protected Attributes

Delegates _delegates
 

Detailed Description

template<class TDelegate>
class Poco::DefaultStrategy< void, TDelegate >

Default notification strategy.

Internally, a std::vector<> is used to store
delegate objects. Delegates are invoked in the
order in which they have been registered. 

Definition at line 127 of file DefaultStrategy.h.

Member Typedef Documentation

◆ DelegateHandle

template<class TDelegate >
using Poco::DefaultStrategy< void, TDelegate >::DelegateHandle = TDelegate*

Definition at line 135 of file DefaultStrategy.h.

◆ DelegatePtr

template<class TDelegate >
using Poco::DefaultStrategy< void, TDelegate >::DelegatePtr = SharedPtr<TDelegate>

Definition at line 136 of file DefaultStrategy.h.

◆ Delegates

template<class TDelegate >
using Poco::DefaultStrategy< void, TDelegate >::Delegates = std::vector<DelegatePtr>

Definition at line 137 of file DefaultStrategy.h.

◆ Iterator

template<class TDelegate >
using Poco::DefaultStrategy< void, TDelegate >::Iterator = typename Delegates::iterator

Definition at line 138 of file DefaultStrategy.h.

Constructor & Destructor Documentation

◆ DefaultStrategy() [1/2]

template<class TDelegate >
Poco::DefaultStrategy< void, TDelegate >::DefaultStrategy ( )
inline

Definition at line 141 of file DefaultStrategy.h.

◆ DefaultStrategy() [2/2]

template<class TDelegate >
Poco::DefaultStrategy< void, TDelegate >::DefaultStrategy ( const DefaultStrategy< void, TDelegate > & s)
inline

Definition at line 145 of file DefaultStrategy.h.

◆ ~DefaultStrategy()

template<class TDelegate >
Poco::DefaultStrategy< void, TDelegate >::~DefaultStrategy ( )
inline

Definition at line 150 of file DefaultStrategy.h.

Member Function Documentation

◆ add()

template<class TDelegate >
DelegateHandle Poco::DefaultStrategy< void, TDelegate >::add ( const TDelegate & delegate)
inlinevirtual

Sends a notification to all registered delegates.

Implements Poco::NotificationStrategy< void, TDelegate >.

Definition at line 162 of file DefaultStrategy.h.

◆ clear()

template<class TDelegate >
void Poco::DefaultStrategy< void, TDelegate >::clear ( )
inlinevirtual

Removes a delegate from the strategy, if found. Does nothing if the delegate has not been added.

Implements Poco::NotificationStrategy< void, TDelegate >.

Definition at line 204 of file DefaultStrategy.h.

◆ empty()

template<class TDelegate >
bool Poco::DefaultStrategy< void, TDelegate >::empty ( ) const
inlinevirtual

Removes all delegates from the strategy.

Implements Poco::NotificationStrategy< void, TDelegate >.

Definition at line 213 of file DefaultStrategy.h.

◆ notify()

template<class TDelegate >
void Poco::DefaultStrategy< void, TDelegate >::notify ( const void * sender)
inlinevirtual

Implements Poco::NotificationStrategy< void, TDelegate >.

Definition at line 154 of file DefaultStrategy.h.

◆ operator=()

template<class TDelegate >
DefaultStrategy & Poco::DefaultStrategy< void, TDelegate >::operator= ( const DefaultStrategy< void, TDelegate > & s)
inline

Definition at line 195 of file DefaultStrategy.h.

◆ remove() [1/2]

template<class TDelegate >
void Poco::DefaultStrategy< void, TDelegate >::remove ( const TDelegate & delegate)
inlinevirtual

Adds a delegate to the strategy.

Implements Poco::NotificationStrategy< void, TDelegate >.

Definition at line 169 of file DefaultStrategy.h.

◆ remove() [2/2]

template<class TDelegate >
void Poco::DefaultStrategy< void, TDelegate >::remove ( DelegateHandle delegateHandle)
inlinevirtual

Removes a delegate from the strategy, if found. Does nothing if the delegate has not been added.

Implements Poco::NotificationStrategy< void, TDelegate >.

Definition at line 182 of file DefaultStrategy.h.

Member Data Documentation

◆ _delegates

template<class TDelegate >
Delegates Poco::DefaultStrategy< void, TDelegate >::_delegates
protected

Definition at line 219 of file DefaultStrategy.h.


The documentation for this class was generated from the following file: