44 #include "eventsubscriberslot.h"
70 if( (*Current)->GetType() == EventSubscriberSlot::ST_Custom &&
79 this->
Slots.push_back( NewSlot );
87 if( (*Current)->GetType() == EventSubscriberSlot::ST_Functor &&
96 this->
Slots.push_back( NewSlot );
104 if( (*Current)->GetType() == EventSubscriberSlot::ST_CFunction &&
113 this->
Slots.push_back( NewSlot );
121 if( (*Current)->GetType() == EventSubscriberSlot::ST_Script &&
130 this->
Slots.push_back( NewSlot );
141 if( (*Current)->GetType() == EventSubscriberSlot::ST_Custom &&
145 this->
Slots.erase(Current);
155 if( (*Current)->GetType() == EventSubscriberSlot::ST_Functor &&
159 this->
Slots.erase(Current);
169 if( (*Current)->GetType() == EventSubscriberSlot::ST_CFunction &&
173 this->
Slots.erase(Current);
183 if( (*Current)->GetType() == EventSubscriberSlot::ST_Script &&
187 this->
Slots.erase(Current);
197 if( (*Current) == SubSlot ) {
199 this->
Slots.erase(Current);
209 {
delete (*Current); }
218 {
return this->
Slots.begin(); }
221 {
return this->
Slots.end(); }
224 {
return this->
Slots.begin(); }
227 {
return this->
Slots.end(); }
236 (*SlotIt)->_NotifyEvent(Args);
Basic class definition for functors used by a FunctorSubscriberSlot.
Event(const String &Name)
Class constructor.
bool Boole
Generally acts a single bit, true or false.
This is a subscriber slot class that triggers a Free/C-style function.
This is a base class for all classes that subscribe to events.
SlotIterator SubscriberSlotEnd()
Gets an iterator to one passed the last subscriber slot in this event.
A simple reference counting pointer.
This is a subscriber slot class that passes on the event firing to a custom subscriber class...
const String EventName
The name of this Event.
SlotIterator SubscriberSlotBegin()
Gets an iterator to the first subscriber slot in this event.
SlotContainer::const_iterator ConstSlotIterator
Const Iterator type for EventSubscriberSlot instances stored by this class.
The interface for a script.
Whole UnsubscribeAll()
Unsubscribes all subscribers from this Event.
void( SubscriberFunction)(EventArgumentsPtr Args)
This is a convenience typedef for a c-style method that accepts EventArguments.
This is a subscriber slot class that triggers a provided script.
void Unsubscribe(EventSubscriber *Subscriber)
Unsubscribes a single subscriber from this event.
void _FireEvent(EventArgumentsPtr Args)
Notifies all subscribers of this event that this event is firing.
This class represents a slot in an event that can be subscribed to via subscribers, functors, or methods.
~Event()
Class destructor.
This is a subscriber slot class that makes the appropriate call on a functor.
EventSubscriberSlot * Subscribe(EventSubscriber *Subscriber)
Adds a subscriber to this event.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
SlotContainer::iterator SlotIterator
Iterator type for EventSubscriberSlot instances stored by this class.
std::string String
A datatype used to a series of characters.
SlotContainer Slots
A container storing all the EventSubscriberSlot instances to subscribers.
const String & GetName() const
Gets the name of this event.