#include <nnevent.h>
Inheritance diagram for NewNet::Event< T >:

Public Member Functions | |
| Event () | |
| Constructor. | |
| Event (const Event &that) | |
| Copy constructor. | |
| virtual | ~Event () |
| Destructor. | |
| void | clear () |
| Empty the event callback list. | |
| Callback * | connect (Callback *callback) |
| Connect a callback to the event. | |
| template<class ObjectType, typename MethodType> | |
| Callback * | connect (ObjectType *object, MethodType method) |
| Connect callback to a method of an object to the event. | |
| void | disconnect (Callback *callback) |
| Disconnect a callback from the event. | |
| void | operator() (T t) |
| Emit the event. | |
Static Public Member Functions | |
| template<class ObjectType, typename MethodType> | |
| static Callback * | bind (ObjectType *object, MethodType method) |
| Create a callback to a bound method. | |
Classes | |
| class | Callback |
| Abstract callback type for Event. More... | |
Definition at line 35 of file nnevent.h.
| NewNet::Event< T >::Event | ( | ) | [inline] |
| NewNet::Event< T >::Event | ( | const Event< T > & | that | ) | [inline] |
| virtual NewNet::Event< T >::~Event | ( | ) | [inline, virtual] |
| void NewNet::Event< T >::clear | ( | ) | [inline] |
Call this to remove all the callbacks from this event. Note: the event stores a RefPtr to all the callbacks registered. Clearing the event may delete the callback if there are no other references to it.
Definition at line 193 of file nnevent.h.
Referenced by NewNet::Event< ClientType * >::~Event().
| Callback* NewNet::Event< T >::connect | ( | Callback * | callback | ) | [inline] |
Add a callback to this event so that it will get invoked when the event is emitted. Note: stores a RefPtr to the callback.
Definition at line 202 of file nnevent.h.
Referenced by NewNet::Event< ClientType * >::connect(), and NewNet::Event< ClientType * >::Event().
| static Callback* NewNet::Event< T >::bind | ( | ObjectType * | object, | |
| MethodType | method | |||
| ) | [inline, static] |
This will construct a callback object that will invoke a method of an object.
Definition at line 217 of file nnevent.h.
Referenced by NewNet::Reactor::addTimeout(), and NewNet::Event< ClientType * >::connect().
| Callback* NewNet::Event< T >::connect | ( | ObjectType * | object, | |
| MethodType | method | |||
| ) | [inline] |
| void NewNet::Event< T >::disconnect | ( | Callback * | callback | ) | [inline] |
Remove a callback from the invocation list. Note: the event stores a RefPtr to the callback. If the event holds the last RefPtr, the callback will be deleted.
Definition at line 236 of file nnevent.h.
Referenced by NewNet::Event< ClientType * >::clear().
| void NewNet::Event< T >::operator() | ( | T | t | ) | [inline] |
Emit the event, invokes the Callback::operator()(T t) method of all registered callbacks.
1.5.1