This class represents a given event that can be subscribed to and/or fired. More...
#include <event.h>
Public Types | |
typedef SlotContainer::const_iterator | ConstSlotIterator |
Const Iterator type for EventSubscriberSlot instances stored by this class. | |
typedef std::vector< EventSubscriberSlot * > | SlotContainer |
Basic container type for EventSubscriberSlot storage by this class. | |
typedef SlotContainer::iterator | SlotIterator |
Iterator type for EventSubscriberSlot instances stored by this class. | |
typedef std::pair< UInt8, EventSubscriberSlot * > | SlotPair |
An std::pair type for working with stored EventSubscriberSlot instances. | |
Public Member Functions | |
Event (const String &Name) | |
Class constructor. More... | |
~Event () | |
Class destructor. | |
void | _FireEvent (EventArgumentsPtr Args) |
Notifies all subscribers of this event that this event is firing. More... | |
const String & | GetName () const |
Gets the name of this event. More... | |
EventSubscriberSlot * | Subscribe (EventSubscriber *Subscriber) |
Adds a subscriber to this event. More... | |
EventSubscriberSlot * | Subscribe (FunctorEventSubscriber *Funct, Boole CleanUpAfter) |
Subscribes a functor object to this event. More... | |
EventSubscriberSlot * | Subscribe (CFunctionSubscriberSlot::SubscriberFunction *CFunct) |
Subscribes a C-style function to this event. More... | |
EventSubscriberSlot * | Subscribe (Scripting::iScript *SubScript) |
Subscribes a script to this event. More... | |
SlotIterator | SubscriberSlotBegin () |
Gets an iterator to the first subscriber slot in this event. More... | |
ConstSlotIterator | SubscriberSlotBegin () const |
Gets an iterator to the first subscriber slot in this event. More... | |
SlotIterator | SubscriberSlotEnd () |
Gets an iterator to one passed the last subscriber slot in this event. More... | |
ConstSlotIterator | SubscriberSlotEnd () const |
Gets an iterator to one passed the last subscriber slot in this event. More... | |
void | Unsubscribe (EventSubscriber *Subscriber) |
Unsubscribes a single subscriber from this event. More... | |
void | Unsubscribe (FunctorEventSubscriber *Funct) |
Unsubscribes a single subscriber from this event. More... | |
void | Unsubscribe (CFunctionSubscriberSlot::SubscriberFunction *CFunct) |
Unsubscribes a single subscriber from this event. More... | |
void | Unsubscribe (Scripting::iScript *SubScript) |
Unsubscribes a single subscriber from this event. More... | |
void | Unsubscribe (EventSubscriberSlot *SubSlot) |
Unsubscribes a single subscriber from this event. More... | |
Whole | UnsubscribeAll () |
Unsubscribes all subscribers from this Event. More... | |
Protected Attributes | |
const String | EventName |
The name of this Event. More... | |
SlotContainer | Slots |
A container storing all the EventSubscriberSlot instances to subscribers. More... | |
This class represents a given event that can be subscribed to and/or fired.
Mezzanine::Event::Event | ( | const String & | Name | ) |
void Mezzanine::Event::_FireEvent | ( | EventArgumentsPtr | Args | ) |
const String & Mezzanine::Event::GetName | ( | ) | const |
EventSubscriberSlot * Mezzanine::Event::Subscribe | ( | EventSubscriber * | Subscriber | ) |
EventSubscriberSlot * Mezzanine::Event::Subscribe | ( | FunctorEventSubscriber * | Funct, |
Boole | CleanUpAfter | ||
) |
Subscribes a functor object to this event.
Funct | The functor to call when the event is fired. |
CleanUpAfter | Whether or not to delete the functor when this subscriber is no longer subscribed to any events. |
EventSubscriberSlot * Mezzanine::Event::Subscribe | ( | CFunctionSubscriberSlot::SubscriberFunction * | CFunct | ) |
EventSubscriberSlot * Mezzanine::Event::Subscribe | ( | Scripting::iScript * | SubScript | ) |
Event::SlotIterator Mezzanine::Event::SubscriberSlotBegin | ( | ) |
Event::ConstSlotIterator Mezzanine::Event::SubscriberSlotBegin | ( | ) | const |
Event::SlotIterator Mezzanine::Event::SubscriberSlotEnd | ( | ) |
Event::ConstSlotIterator Mezzanine::Event::SubscriberSlotEnd | ( | ) | const |
void Mezzanine::Event::Unsubscribe | ( | EventSubscriber * | Subscriber | ) |
Unsubscribes a single subscriber from this event.
Subscriber | The EventSubscriberSlot (and the subscriber it is holding) to be removed. |
void Mezzanine::Event::Unsubscribe | ( | FunctorEventSubscriber * | Funct | ) |
void Mezzanine::Event::Unsubscribe | ( | CFunctionSubscriberSlot::SubscriberFunction * | CFunct | ) |
void Mezzanine::Event::Unsubscribe | ( | Scripting::iScript * | SubScript | ) |
void Mezzanine::Event::Unsubscribe | ( | EventSubscriberSlot * | SubSlot | ) |
Unsubscribes a single subscriber from this event.
SubSlot | The EventSubscriberSlot (and the subscriber it is holding) to be removed. |
Whole Mezzanine::Event::UnsubscribeAll | ( | ) |
|
protected |
|
protected |
A container storing all the EventSubscriberSlot instances to subscribers.