Direct connection to an object.
* Indirect connection to an object. * * Use this overload if you want to connect to an object's method * which does not match the signal's signature. You can provide * any delegate to do the parameter adaption, but make sure your * delegates' context does not contain a reference to the target * object, instead use the provided obj parameter, where the * object passed to connect will be passed to your delegate. * This is to make weak ref semantics possible, if your delegate * contains a ref to obj, the object won't be freed as long as * the connection remains. * * Preconditions: obj and dg must not be null (dg's context * may). dg's context must not be equal to obj. * * Params: * obj = The object to connect to. It will be passed to the * delegate when the signal is emitted. * * dg = A wrapper delegate which takes care of calling some * method of obj. It can do any kind of parameter adjustments * necessary.
* Disconnect an indirect connection. * * For this to work properly, dg has to be exactly the same as * the one passed to connect. So if you used a lamda you have to * keep a reference to it somewhere if you want to disconnect * the connection later on. If you want to remove all * connections to a particular object use the overload which only * takes an object paramter.
* Disconnect all connections to obj. * * All connections to obj made with calls to connect are removed.
Disconnect a direct connection.
Connect with strong ref semantics.
Disconnect a connection made with strongConnect.
The signal implementation, not providing an emit method.
The idea is to instantiate a Signal privately and provide a public accessor method for accessing the contained RestrictedSignal. You can use the signal string mixin, which does exactly that.