Ark Server API (ASE) - Wiki
|
#include <AbstractEvent.h>
Classes | |
struct | NotifyAsyncParams |
Public Types | |
typedef TDelegate * | DelegateHandle |
Public Member Functions | |
AbstractEvent () | |
AbstractEvent (const TStrategy &strat) | |
virtual | ~AbstractEvent () |
void | operator+= (const TDelegate &aDelegate) |
void | operator-= (const TDelegate &aDelegate) |
DelegateHandle | add (const TDelegate &aDelegate) |
void | remove (DelegateHandle delegateHandle) |
void | operator() (const void *pSender) |
Shortcut for notify(pSender, args);. | |
void | operator() () |
Shortcut for notify(args). | |
void | notify (const void *pSender) |
ActiveResult< void > | notifyAsync (const void *pSender) |
void | enable () |
Enables the event. | |
void | disable () |
bool | isEnabled () const |
void | clear () |
Removes all delegates. | |
bool | empty () const |
Checks if any delegates are registered at the delegate. | |
Protected Member Functions | |
void | executeAsyncImpl (const NotifyAsyncParams &par) |
Protected Attributes | |
ActiveMethod< void, NotifyAsyncParams, AbstractEvent > | _executeAsync |
TStrategy | _strategy |
bool | _enabled |
The strategy used to notify observers. | |
TMutex | _mutex |
Private Member Functions | |
AbstractEvent (const AbstractEvent &other) | |
AbstractEvent & | operator= (const AbstractEvent &other) |
Definition at line 359 of file AbstractEvent.h.
typedef TDelegate* Poco::AbstractEvent< void, TStrategy, TDelegate, TMutex >::DelegateHandle |
Definition at line 362 of file AbstractEvent.h.
|
inline |
Definition at line 364 of file AbstractEvent.h.
|
inline |
Definition at line 370 of file AbstractEvent.h.
|
inlinevirtual |
Definition at line 377 of file AbstractEvent.h.
|
private |
|
inline |
Adds a delegate to the event.
Exact behavior is determined by the TStrategy.
Returns a DelegateHandle which can be used in call to remove() to remove the delegate.
Definition at line 399 of file AbstractEvent.h.
|
inline |
Removes all delegates.
Definition at line 506 of file AbstractEvent.h.
|
inline |
Disables the event. notify and notifyAsnyc will be ignored, but adding/removing delegates is still allowed.
Definition at line 492 of file AbstractEvent.h.
|
inline |
Checks if any delegates are registered at the delegate.
Definition at line 513 of file AbstractEvent.h.
|
inline |
Enables the event.
Definition at line 485 of file AbstractEvent.h.
|
inlineprotected |
Definition at line 535 of file AbstractEvent.h.
|
inline |
Definition at line 500 of file AbstractEvent.h.
|
inline |
Sends a notification to all registered delegates. The order is determined by the TStrategy. This method is blocking. While executing, the list of delegates may be modified. These changes don't influence the current active notifications but are activated with the next notify. If a delegate is removed during a notify(), the delegate will no longer be invoked (unless it has already been invoked prior to removal). If one of the delegates throws an exception, the notify method is immediately aborted and the exception is propagated to the caller.
Definition at line 433 of file AbstractEvent.h.
|
inline |
Sends a notification to all registered delegates. The order is determined by the TStrategy. This method is not blocking and will immediately return. The delegates are invoked in a separate thread. Call activeResult.wait() to wait until the notification has ended. While executing, other objects can change the delegate list. These changes don't influence the current active notifications but are activated with the next notify. If a delegate is removed during a notify(), the delegate will no longer be invoked (unless it has already been invoked prior to removal). If one of the delegates throws an exception, the execution is aborted and the exception is propagated to the caller.
Definition at line 456 of file AbstractEvent.h.
|
inline |
Shortcut for notify(args).
Definition at line 427 of file AbstractEvent.h.
|
inline |
Shortcut for notify(pSender, args);.
Definition at line 421 of file AbstractEvent.h.
|
inline |
Adds a delegate to the event.
Exact behavior is determined by the TStrategy.
Definition at line 381 of file AbstractEvent.h.
|
inline |
Removes a delegate from the event.
If the delegate is not found, this function does nothing.
Definition at line 390 of file AbstractEvent.h.
|
private |
|
inline |
Removes a delegate from the event using a DelegateHandle returned by add().
If the delegate is not found, this function does nothing.
Definition at line 411 of file AbstractEvent.h.
|
protected |
The strategy used to notify observers.
Definition at line 548 of file AbstractEvent.h.
|
protected |
Definition at line 533 of file AbstractEvent.h.
|
mutableprotected |
Stores if an event is enabled. Notifies on disabled events have no effect but it is possible to change the observers.
Definition at line 550 of file AbstractEvent.h.
|
protected |
Definition at line 547 of file AbstractEvent.h.