SeqEventManager

Constructors

this
this()
Undocumented in source.

Members

Functions

disable
void disable()
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.
opIndex
EventManager!T opIndex(size_t i)
Undocumented in source.

Examples

scope(failure) {writefln("Unittest failure :%s(%s)", __FILE__, __LINE__); stdout.flush();}
scope(success) {writefln("Unittest success :%s(%s)", __FILE__, __LINE__); stdout.flush();}

auto event = new SeqEventManager!(3, bool);

size_t cnt;
size_t[3] ns;
event[0].strongConnect(delegate(b){
    assert(b);
    ns[0] = cnt;
    ++cnt;
});

event[1].strongConnect(delegate(b){
    assert(b);
    ns[1] = cnt;
    ++cnt;
});

event[2].strongConnect(delegate(b){
    assert(b);
    ns[2] = cnt;
    ++cnt;
});

event.emit(true);
assert(cnt == 3);
assert(ns[] == [0, 1, 2]);

Meta