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

Poco::BasicEvent< TArgs > Class Template Reference

#include <BasicEvent.h>

Inheritance diagram for Poco::BasicEvent< TArgs >:

Poco::AbstractEvent< TArgs, TStrategy, TDelegate >

List of all members.

Detailed Description

template<class TArgs>
class Poco::BasicEvent< TArgs >

A BasicEvent uses internally a DefaultStrategy which invokes delegates in an arbitrary manner. Note that one object can only register one method to a BasicEvent. Subsequent registrations will overwrite the existing delegate. For example: BasicEvent<int> event; MyClass myObject; event += delegate(&myObject, &MyClass::myMethod1); event += delegate(&myObject, &MyClass::myMethod2);

The second registration will overwrite the first one. The reason is simply that function pointers can only be compared by equality but not by lower than.

Definition at line 53 of file BasicEvent.h.

Public Member Functions

void clear ()
 Removes all delegates.
void disable ()
void enable ()
 Enables the event.
bool isEnabled () const
void notify (const void *pSender, TArgs &args)
ActiveResult< TArgs > notifyAsync (const void *pSender, const TArgs &args)
void operator() (const void *pSender, TArgs &args)
void operator+= (const TDelegate &aDelegate)
void operator-= (const TDelegate &aDelegate)

Protected Member Functions

TArgs executeAsyncImpl (const NotifyAsyncParams &par)

Protected Attributes

bool _enabled
 The strategy used to notify observers.
ActiveMethod< TArgs,
FastMutex _mutex
TStrategy _strategy

Private Member Functions

 BasicEvent (const BasicEvent &e)
BasicEventoperator= (const BasicEvent &e)

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

Generated by  Doxygen 1.6.0   Back to index