MachineObserver<S, E> class
abstract
Observer interface for monitoring state machine execution.
Implement this class to hook into lifecycle events, transitions, and error handling. Default implementations are empty, so you can override only the methods you need.
- Implementers
Constructors
- MachineObserver()
-
Creates a new MachineObserver.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onEventDeferred(
HsmState< S, E> state, E event, Object? data) → void - Called when an event is deferred by a state.
-
onEventDropped(
HsmState< S, E> state, E event, Object? data) → void - Called when a deferred event is dropped.
-
onEventError(
Machine< S, E> machine, E event, Object? data, Object error, StackTrace stackTrace) → void - Called when an error occurs during event processing.
-
onEventHandled(
HsmState< S, E> state, E event, Object? data) → void - Called when an event has been successfully handled.
-
onEventHandling(
Machine< S, E> machine, E event, Object? data) → void - Called when the machine begins processing an event.
-
onEventQueued(
Machine< S, E> machine, E event, Object? data) → void - Called when an event is added to the machine's event queue.
-
onEventUnhandled(
HsmState< S, E> state, E event, Object? data) → void - Called when an event was not handled by any active state.
-
onInternalTransition(
HsmState< S, E> state, E? event, Object? data) → void - Called when an internal transition (no state change) occurs.
-
onMachineStarted(
Machine< S, E> machine) → void - Called when the machine has successfully started and entered its root state.
-
onMachineStarting(
Machine< S, E> machine) → void - Called when the machine is starting.
-
onMachineStopped(
Machine< S, E> machine) → void - Called when the machine has been stopped and all states have been exited.
-
onMachineTerminated(
Machine< S, E> machine) → void -
Called when the machine enters a
TerminateState. -
onStateEnter(
HsmState< S, E> state) → void - Called when a state is entered.
-
onStateExit(
HsmState< S, E> state) → void - Called when a state is exited.
-
onTransition(
HsmState< S, E> source, HsmState<S, E> target, E? event, Object? data, TransitionKind kind) → void - Called when a transition between two states occurs.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited