SuperCollider CLASSES

AbstractWrappingDispatcher

A dispatcher which wraps functions to support multiple paramter matching
Inherits from: AbstractDispatcher : Object

Description

AbstractWrappingDispatcher extends AbstractDispatcher to provide the facility to wrap response functions in specialised objects (instances of subclasses of AbstractMessageMatcher to efficiently support matching of multiple parameters. Its subclasses OSCMessageDispatcher and MIDIMessageDispatcher match using a flat dictionary lookup of the 'most significant' parameter, and only attempt to match other parameters if an initial match is found. This approach is faster than others (such as multi-level dictionaries) for most configurations.

Class Methods

Inherited class methods

Instance Methods

-wrappedFuncs

Get a dictionary of all currently wrapped functions, stored using their owning responder funcs as keys.

Returns:

-add (funcProxy)

Add a responder func to this dispatcher. Subclasses should extend this to do any necessary bookkeeping. Generally this method should add this dispatcher as a dependant of the responder func, so that it can respond to any changes.

Arguments:

funcProxy

An instance of a subclass of AbstractResponderFunc to add.

-remove (funcProxy)

Remove a responder func from this dispatcher.

Arguments:

funcProxy

An instance of a subclass of AbstractResponderFunc to remove.

-updateFuncForFuncProxy (funcProxy)

This method is called within -update to update any changes to one of this dispatcher's responder funcs' function(s). Users should not call this method directly, but subclasses may need to extend this method to do additional bookkeeping.

Arguments:

funcProxy

An instance of a subclass of AbstractResponderFunc.

-wrapFunc

Subclasses should override this method to implement wrapping of functions by instances of appropriate subclasses of AbstractMessageMatcher.

-getKeysForFuncProxy (funcProxy)

Subclasses should override this to return an Array containing all the keys at which the specified responder func's functions are stored in this dispatchers active dictionary.

Arguments:

funcProxy

An instance of a subclass of AbstractResponderFunc.

Returns:

An Array.

-update (funcProxy, what)

Subclasses of AbstractResponderFunc should call update on their dispatcher whenever their function (or something else significant) changes.

Arguments:

funcProxy

An instance of a subclass of AbstractResponderFunc.

what

A Symbol indicating what has changed. Currently the only thing supported is \function.

-free

This method removes this dispatcher from its responder func's dependants dictionaries, and deactivates it. Users should only call this method if you are finished with this dispatcher.

Inherited instance methods