28 #ifndef _CEGUIEvent_h_
29 #define _CEGUIEvent_h_
31 #include "CEGUIString.h"
32 #include "CEGUIBoundSlot.h"
33 #include "CEGUISubscriberSlot.h"
34 #include "CEGUIRefCounted.h"
39 # pragma warning(push)
40 # pragma warning(disable : 4251)
100 d_connection(connection)
105 d_connection = connection;
109 bool connected()
const
110 {
return d_connection.
isValid() ? d_connection->connected() :
false; }
113 {
if (d_connection.isValid()) d_connection->disconnect(); }
156 Connection subscribe(
const Subscriber& slot);
177 Connection subscribe(Group group,
const Subscriber& slot);
211 Event& operator=(
const Event&) {
return *
this;}
213 typedef std::multimap<Group, Connection> SlotContainer;
214 SlotContainer d_slots;
220 #if defined(_MSC_VER)
221 # pragma warning(pop)
224 #endif // end of guard _CEGUIEvent_h_
const String & getName(void) const
Return the name given to this Event object when it was created.
Definition: CEGUIEvent.h:139
Event::Connection wrapper that automatically disconnects the connection when the object is deleted (o...
Definition: CEGUIEvent.h:91
Base class used as the argument to all subscribers Event object.
Definition: CEGUIEventArgs.h:52
Class that tracks a SubscriberSlot, its group, and the Event to which it was subscribed. This is effectively what gets returned from the calls to the Event::subscribe members, though BoundSlot is always wrapped in a reference counted pointer. When a BoundSlot is deleted, the connection is unsubscribed and the SubscriberSlot is deleted.
Definition: CEGUIBoundSlot.h:45
SubscriberSlot class which is used when subscribing to events.
Definition: CEGUISubscriberSlot.h:52
CEGUI::SubscriberSlot Subscriber
Subscriber object type. This is now just a typedef to SubscriberSlot, the use of the name Event::Subs...
Definition: CEGUIEvent.h:76
RefCounted< BoundSlot > Connection
Connection object. This is a thin 'smart pointer' wrapper around the actual BoundSlot that represents...
Definition: CEGUIEvent.h:68
Defines an 'event' which can be subscribed to by interested parties.
Definition: CEGUIEvent.h:58
unsigned int Group
Type for a subscriber group. You can use the subscriber group to order calls to multiple subscribers...
Definition: CEGUIEvent.h:84
void disconnect()
Disconnects the slot. Once disconnected, the slot will no longer be called when the associated signal...
String class used within the GUI system.
Definition: CEGUIString.h:57
bool isValid() const
Return whether the wrapped pointer is valid. i.e. that it is not null.
Definition: CEGUIRefCounted.h:162