By Type Router
class ByTypeRouter(typeMap: Map<Int, QObjectReceiverIfc>, default: QObjectReceiverIfc) : Router(source)
Routes each arriving QObject to the receiver mapped to its ModelElement.QObject.qObjectType, falling back to default when the type is not present in typeMap. This is the natural routing primitive for a multi-class network, where each class follows its own path.
Parameters
type Map
maps a QObject type id to its receiver
default
the receiver used when the instance's type is not in the map
Functions
Link copied to clipboard
The possible destinations this router may select, for graph introspection.
Link copied to clipboard
Selects the receiver for the supplied qObject. Implementations must return a non-null receiver; supply a default/fallback to guarantee this.