RestrictedSignal.connect

Direct connection to an object.

Use this method if you want to connect directly to an objects method matching the signature of this signal. The connection will have weak reference semantics, meaning if you drop all references to the object the garbage collector will collect it and this connection will be removed.

Preconditions: obj must not be null. mixin("&obj."~method) must be valid and compatible.

  1. void connect(ClassType obj)
    struct RestrictedSignal(Args...)
    void
    connect
    @trusted
    (
    string method
    ClassType
    )
    (
    ClassType obj
    )
    if (
    is(ClassType == class) &&
    __traits(compiles, )
    )
    in { assert (obj); }
  2. void connect(ClassType obj, void delegate(ClassType obj, Args) dg)

Parameters

obj
Type: ClassType

Some object of a class implementing a method compatible with this signal.

Meta