MarkingHookIfc

fun interface MarkingHookIfc(source)

A per-instance marking action applied by a SourceStation to each freshly created QObject. Use to sample a type id, attach a value object, set a priority, or attach a route — anything that varies per instance and can't be expressed as a static QObjectClass.

The network parameter exposes the built network's read-only view, so a marking hook can look up route(name) to attach a per-instance Route as the QObject's sender (the DTO route-then-mark pattern). Ignore it (use MarkingHookIfc { q, _ -> ... }) when not needed.

Mirrors the source's marking lambda parameter; the named-hook form is what the DTO/TOML layer carries (the hook name in the spec, the implementation in the builder's hook registry).

Functions

Link copied to clipboard
abstract fun mark(qObject: ModelElement.QObject, network: StationNetworkCIfc)