util.signal
Qt-like signals.
- template Signal(Args...)
Signal template mixin for Qt-like signals/slots.
Signals should always be documented in header class documentation, and always disconnect all their slots (disconnectAll) at their owner classes' destructor or die() method.
Examples:Signal: public mixin Signal!() back Used to return back to parent menu.
- Slot[] slots_;
Slots of this signal.
- void emit(Args args);
Emit the signal (call all slots with specified arguments).
- void connect(Slot slot);
Connect a slot to the signal.
One slot can be connected more than once, resulting in multiple calls to that slot when the signal is emitted.
Parameters:
Only embedded, class/struct member functions can be connected, global functions are not supported at the moment.- void disconnect(Slot slot);
Disconnect a slot from the signal.
If a slot is connected more than once, it must be disconnected corresponding number of times.
Parameters:- void disconnectAll();
Disconnect all connected slots.