ConditionalRouter

Routes each arriving QObject to the receiver of the first cases entry whose predicate holds for that instance, falling back to default if none match. This is the QObject-aware, N-way generalization of a two-way condition sender: the predicates are evaluated against the instance being routed.

Parameters

cases

the ordered list of (predicate, receiver) cases, evaluated first-match

default

the receiver used when no case matches

Constructors

Link copied to clipboard
constructor(cases: List<RoutingCase>, 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.