RestrictedSignal

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.

Members

Functions

connect
void connect(ClassType obj)

Direct connection to an object.

connect
void connect(ClassType obj, void delegate(ClassType obj, Args) dg)

* 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
void disconnect(ClassType obj, void delegate(ClassType, T1) dg)

* 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
void disconnect(ClassType obj)

* Disconnect all connections to obj. * * All connections to obj made with calls to connect are removed.

disconnect
void disconnect(ClassType obj)

Disconnect a direct connection.

strongConnect
void strongConnect(void delegate(Args) dg)

Connect with strong ref semantics.

strongDisconnect
void strongDisconnect(void delegate(Args) dg)

Disconnect a connection made with strongConnect.

Meta