ByTypeRouter

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

typeMap

maps a QObject type id to its receiver

default

the receiver used when the instance's type is not in the map

Constructors

Link copied to clipboard
constructor(typeMap: Map<Int, QObjectReceiverIfc>, default: QObjectReceiverIfc)

Functions

Link copied to clipboard
open override fun destinations(): List<QObjectReceiverIfc>

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.