Route

class Route(val routeName: String, steps: List<QObjectReceiverIfc>)(source)

A first-class, named, ordered visitation sequence through a set of receivers (a "process plan"). A route is a reusable template: each QObject that follows the route gets its own cursor via newSender, so many instances can traverse the same route concurrently without interfering.

A route is followed by attaching its sender to the QObject (the standard per-instance routing idiom): qObject.sender(route.newSender()). As each station completes the instance, the attached sender advances it to the next step; the final step is typically a sink. This generalizes ReceiverSequence with a named, inspectable list of steps.

Register a route with its network (StationNetwork.registerRoute) when its steps are stations that are otherwise unwired (driven only by the route), so the network's validation treats them as routed rather than dangling. The DSL route(...) helper and class routes register automatically.

Parameters

routeName

a name for the route, useful for reporting and multi-class models

steps

the ordered receivers to visit, which must be non-empty

Constructors

Link copied to clipboard
constructor(routeName: String, steps: List<QObjectReceiverIfc>)

Properties

Link copied to clipboard
Link copied to clipboard
val size: Int

The number of steps in the route.

Link copied to clipboard

The ordered receivers visited by this route.

Functions

Link copied to clipboard

Returns a receiver that starts an arriving QObject on this route: it attaches a fresh per-instance sender positioned at the second step and forwards the instance to the first step. Each station then advances the instance to the next step via the attached sender. Wire a source or an upstream node to this receiver (for example, source.firstReceiver(route.entryReceiver())).

Link copied to clipboard
fun newSender(fromStep: Int = 0): QObjectSenderIfc

Creates a fresh sender that advances a single QObject through this route, beginning at fromStep. Attach the result to the instance via qObject.sender(route.newSender()). The default begins at the first step.