The single-event step shared by the spades event loop and (later) the simInit
.inputObjects phase: take a recovery snapshot (recoverModePre), run the next event
via doEvent(), then record any events it added (recoverModePost). Both recovery
calls are skipped when recoverMode <= 0.
.stepEvent(
sim,
recoverMode,
allObjNames,
thisSpadesCallRandomStr,
debug,
notOlderThan,
events = NULL,
...
)The updated simList (with sim@.xData[["._rmo"]] advanced).
A simList.
Numeric/logical; > 0 enables the pre/post snapshots.
Per-module object-name list to snapshot (output objects for the
spades loop; input objects for the .inputObjects phase). Passed to
recoverModePre().
Scratch-dir token for file-backed snapshots.
Passed through to doEvent().
The recovery accumulator is kept on sim@.xData[["._rmo"]] (an environment slot)
rather than threaded as a return value. This is deliberate: recoverModePre snapshots
the state before the event, and if doEvent() then errors, this function never
returns -- so a returned accumulator would be lost exactly when recovery is needed.
Mutating the environment slot makes the pre-event snapshot visible to the caller's
on.exit handler regardless of whether the event succeeds.