EventManager

Constructors

this
this()
Undocumented in source.

Members

Functions

connect
void connect(Class obj)
Undocumented in source. Be warned that the author may not have intended to support it.
disable
void disable()
Undocumented in source. Be warned that the author may not have intended to support it.
disconnect
void disconnect(Class obj)
Undocumented in source. Be warned that the author may not have intended to support it.
disconnect
void disconnect(StrongConnectedSlotTag slotTag)
Undocumented in source. Be warned that the author may not have intended to support it.
emit
void emit(T args, string file, size_t line, string func, string preFunc)
Undocumented in source. Be warned that the author may not have intended to support it.
emit
void emit(S sender, T args, string file, size_t line, string func, string preFunc)
Undocumented in source. Be warned that the author may not have intended to support it.
emit
void emit(FiredContext ctx, T args)
Undocumented in source. Be warned that the author may not have intended to support it.
enable
void enable()
Undocumented in source. Be warned that the author may not have intended to support it.
strongConnect
StrongConnectedSlotTag strongConnect(void function() func)
Undocumented in source. Be warned that the author may not have intended to support it.
strongConnect
StrongConnectedSlotTag strongConnect(void function(T) func)
Undocumented in source. Be warned that the author may not have intended to support it.
strongConnect
StrongConnectedSlotTag strongConnect(void function(FiredContext, T) func)
Undocumented in source. Be warned that the author may not have intended to support it.
strongConnect
StrongConnectedSlotTag strongConnect(void delegate() func)
Undocumented in source. Be warned that the author may not have intended to support it.
strongConnect
StrongConnectedSlotTag strongConnect(void delegate(T) func)
Undocumented in source. Be warned that the author may not have intended to support it.
strongConnect
StrongConnectedSlotTag strongConnect(void delegate(FiredContext, T) func)
Undocumented in source. Be warned that the author may not have intended to support it.
strongConnect
StrongConnectedSlotTag strongConnect(Callable func)
Undocumented in source. Be warned that the author may not have intended to support it.
strongDisconnect
void strongDisconnect(StrongConnectedSlotTag slotTag)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

auto event = new EventManager!int();

int sum;
auto tag1 = event.strongConnect(delegate(a){ sum += a; });

event.emit(12);
assert(sum == 12);

auto tag2 = event.strongConnect(() { sum += 2; });

event.emit(4);
assert(sum == 18);  // add 2 + 4

event.disconnect(tag1);
event.emit(12);
assert(sum == 20);  // only add 2

event.disconnect(tag2);
event.emit(5);
assert(sum == 20);

Meta