27 #ifndef _CEGUIEvent_h_
28 #define _CEGUIEvent_h_
30 #include "CEGUI/String.h"
31 #include "CEGUI/BoundSlot.h"
32 #include "CEGUI/SubscriberSlot.h"
33 #include "CEGUI/RefCounted.h"
38 # pragma warning(push)
39 # pragma warning(disable : 4251)
57 class CEGUIEXPORT Event :
58 public AllocatedObject<Event>
102 d_connection(connection)
107 d_connection = connection;
111 bool connected()
const
113 return d_connection.
isValid() ? d_connection->connected() :
false;
118 if (d_connection.isValid()) d_connection->disconnect();
164 Connection subscribe(
const Subscriber& slot);
185 Connection subscribe(Group group,
const Subscriber& slot);
219 Event& operator=(
const Event&)
224 typedef std::multimap<Group, Connection, std::less<Group>
225 CEGUI_MULTIMAP_ALLOC(Group, Connection)> SlotContainer;
226 SlotContainer d_slots;
232 #if defined(_MSC_VER)
233 # pragma warning(pop)
236 #endif // end of guard _CEGUIEvent_h_
const String & getName(void) const
Return the name given to this Event object when it was created.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Event.h:145
Main namespace for Crazy Eddie's GUI Library.
Definition: cegui/include/CEGUI/Affector.h:42
Event::Connection wrapper that automatically disconnects the connection when the object is deleted (o...
Definition: cegui/include/CEGUI/Event.h:91
Base class used as the argument to all subscribers Event object.
Definition: cegui/include/CEGUI/EventArgs.h:49
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: cegui/include/CEGUI/BoundSlot.h:44
SubscriberSlot class which is used when subscribing to events.
Definition: cegui/include/CEGUI/SubscriberSlot.h:51
CEGUI::SubscriberSlot Subscriber
Subscriber object type. This is now just a typedef to SubscriberSlot, the use of the name Event::Subs...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Event.h:76
RefCounted< BoundSlot > Connection
Connection object. This is a thin 'smart pointer' wrapper around the actual BoundSlot that represents...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Event.h:68
Defines an 'event' which can be subscribed to by interested parties.
Definition: cegui/include/CEGUI/Event.h:57
unsigned int Group
Type for a subscriber group. You can use the subscriber group to order calls to multiple subscribers...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Event.h:84
void disconnect()
Disconnects the slot. Once disconnected, the slot will no longer be called when the associated signal...
Definition: BoundSlot.cpp:82
String class used within the GUI system.
Definition: cegui/include/CEGUI/String.h:62
bool isValid() const
Return whether the wrapped pointer is valid. i.e. that it is not null.
Definition: cegui/include/CEGUI/RefCounted.h:165