util.signal - ICE 0.1 API documentation

ICE 0.1 API documentation

# 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.
    Only embedded, class/struct member functions can be connected, global functions are not supported at the moment.

    Parameters:

    Slot slot | Slot to connect.

  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:

    Slot slot | Slot to disconnect. Must already be connected.

  void disconnectAll();

    Disconnect all connected slots.

Copyright © Ferdinand Majerech 2011. | Page generated by AutoDDoc and Ddoc.