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

#include <DefaultStrategy.h>

+ Inheritance diagram for Poco::DefaultStrategy< TArgs, TDelegate >:
+ Collaboration diagram for Poco::DefaultStrategy< TArgs, 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< TArgs, TDelegate >
using DelegateHandle = TDelegate*
 

Public Member Functions

 DefaultStrategy ()
 
 DefaultStrategy (const DefaultStrategy &s)
 
 ~DefaultStrategy ()
 
void notify (const void *sender, TArgs &arguments)
 
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< TArgs, TDelegate >
 NotificationStrategy ()
 
virtual ~NotificationStrategy ()
 

Protected Attributes

Delegates _delegates
 

Detailed Description

template<class TArgs, class TDelegate>
class Poco::DefaultStrategy< TArgs, 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 30 of file DefaultStrategy.h.

Member Typedef Documentation

◆ DelegateHandle

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

Definition at line 38 of file DefaultStrategy.h.

◆ DelegatePtr

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

Definition at line 39 of file DefaultStrategy.h.

◆ Delegates

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

Definition at line 40 of file DefaultStrategy.h.

◆ Iterator

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

Definition at line 41 of file DefaultStrategy.h.

Constructor & Destructor Documentation

◆ DefaultStrategy() [1/2]

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

Definition at line 44 of file DefaultStrategy.h.

◆ DefaultStrategy() [2/2]

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

Definition at line 48 of file DefaultStrategy.h.

◆ ~DefaultStrategy()

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

Definition at line 53 of file DefaultStrategy.h.

Member Function Documentation

◆ add()

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

Sends a notification to all registered delegates.

Implements Poco::NotificationStrategy< TArgs, TDelegate >.

Definition at line 65 of file DefaultStrategy.h.

◆ clear()

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

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

Implements Poco::NotificationStrategy< TArgs, TDelegate >.

Definition at line 107 of file DefaultStrategy.h.

◆ empty()

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

Removes all delegates from the strategy.

Implements Poco::NotificationStrategy< TArgs, TDelegate >.

Definition at line 116 of file DefaultStrategy.h.

◆ notify()

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

Implements Poco::NotificationStrategy< TArgs, TDelegate >.

Definition at line 57 of file DefaultStrategy.h.

◆ operator=()

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

Definition at line 98 of file DefaultStrategy.h.

◆ remove() [1/2]

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

Adds a delegate to the strategy.

Implements Poco::NotificationStrategy< TArgs, TDelegate >.

Definition at line 72 of file DefaultStrategy.h.

◆ remove() [2/2]

template<class TArgs , class TDelegate >
void Poco::DefaultStrategy< TArgs, 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< TArgs, TDelegate >.

Definition at line 85 of file DefaultStrategy.h.

Member Data Documentation

◆ _delegates

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

Definition at line 122 of file DefaultStrategy.h.


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