Logo Search packages:      
Sourcecode: poco version File versions  Download package

template<class TArgs, class TStrategy, class TDelegate>
ActiveResult<TArgs> Poco::AbstractEvent< TArgs, TStrategy, TDelegate >::notifyAsync ( const void *  pSender,
const TArgs &  args 
) [inline, inherited]

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 seperate 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 one of the delegates throws an exception, the execution is aborted and the exception is reported to the caller.

Definition at line 233 of file AbstractEvent.h.

            NotifyAsyncParams params(pSender, args);

                  FastMutex::ScopedLock lock(_mutex);

                  // thread-safeness: 
                  // copy should be faster and safer than blocking until
                  // execution ends
                  // make a copy of the strategy here to guarantee that
                  // between notifyAsync and the execution of the method no changes can occur
                  params.ptrStrat = SharedPtr<TStrategy>(new TStrategy(_strategy));
                  params.enabled  = _enabled;

            ActiveResult<TArgs> result = _executeAsync(params);
            return result;

Generated by  Doxygen 1.6.0   Back to index