Classes |
class | ScopedConnection |
| Event::Connection wrapper that automatically disconnects the connection when the object is deleted (or goes out of scope). More...
|
Public Types |
typedef RefCounted< BoundSlot > | Connection |
| Connection object. This is a thin 'smart pointer' wrapper around the actual BoundSlot that represents the connection. You can use this object to inspect the current connection state and also to disconnect from the event.
|
typedef CEGUI::SubscriberSlot | Subscriber |
| Subscriber object type. This is now just a typedef to SubscriberSlot, the use of the name Event::Subscriber is maintained for hostorical and compatability reasons.
|
typedef unsigned int | Group |
| Type for a subscriber group. You can use the subscriber group to order calls to multiple subscribers. Groups are called in ascending order, with subscribers with no group called last.
|
Public Member Functions |
| Event (const String &name) |
| Constructs a new Event object with the specified name.
|
| ~Event () |
| Destructor for Event objects. Note that this is non-virtual and so you should not sub-class Event.
|
const String & | getName (void) const |
| Return the name given to this Event object when it was created.
|
Connection | subscribe (const Subscriber &slot) |
| Subscribes some function or object to the Event.
|
Connection | subscribe (Group group, const Subscriber &slot) |
| Subscribes some function or object to the Event.
|
void | operator() (EventArgs &args) |
| Fires the event. All event subscribers get called in the appropriate sequence.
|
Friends |
void | CEGUI::BoundSlot::disconnect () |
Defines an 'event' which can be subscribed to by interested parties.
An Event can be subscribed by a function, a member function, or a function object. Whichever option is taken, the function signature needs to be as follows:
- bool function_name(const EventArgs& args);
- Note:
- An Event object may not be copied.