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)
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;
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: Event.h:145
SlotContainer d_slots
Collection holding ref-counted bound slots.
Definition: Event.h:226
Definition: MemoryAllocatedObject.h:109
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
Event::Connection wrapper that automatically disconnects the connection when the object is deleted (o...
Definition: Event.h:91
Base class used as the argument to all subscribers Event object.
Definition: 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: BoundSlot.h:44
SubscriberSlot class which is used when subscribing to events.
Definition: SubscriberSlot.h:51
const String d_name
Name of this event.
Definition: Event.h:227
CEGUI::SubscriberSlot Subscriber
Subscriber object type. This is now just a typedef to SubscriberSlot, the use of the name Event::Subs...
Definition: Event.h:76
RefCounted< BoundSlot > Connection
Connection object. This is a thin 'smart pointer' wrapper around the actual BoundSlot that represents...
Definition: Event.h:68
Defines an 'event' which can be subscribed to by interested parties.
Definition: Event.h:57
unsigned int Group
Type for a subscriber group. You can use the subscriber group to order calls to multiple subscribers...
Definition: Event.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: String.h:62
bool isValid() const
Return whether the wrapped pointer is valid. i.e. that it is not null.
Definition: RefCounted.h:165