StateMachine.RaiseGotoStateEvent method (1 of 2)
Raise a special event that performs a goto state operation at the end of the current action.
protected void RaiseGotoStateEvent(Type state)
parameter | description |
---|---|
state | Type of the state. |
Remarks
Goto state pops the current State
and pushes the specified State
on the active state stack. This is shorthand for the following code:
class Event E { }
[OnEventGotoState(typeof(E), typeof(S))]
this.RaiseEvent(new E());
This event is not handled until the action that calls this method returns control back to the Coyote runtime. It is handled before any other events are dequeued from the inbox. Only one of the following can be called per action: RaiseEvent
, RaiseGotoStateEvent
, RaisePushStateEvent
or RaisePopStateEvent
and RaiseHaltEvent
. An Assert is raised if you accidentally try and do two of these operations in a single action.
See Also
- class StateMachine
- namespace Microsoft.Coyote.Actors
- assembly Microsoft.Coyote.Actors
StateMachine.RaiseGotoStateEvent<TState> method (2 of 2)
Raise a special event that performs a goto state operation at the end of the current action.
protected void RaiseGotoStateEvent<TState>()
where TState : State
parameter | description |
---|---|
TState | Type of the state. |
Remarks
Goto state pops the current State
and pushes the specified State
on the active state stack. This is shorthand for the following code:
class Event E { }
[OnEventGotoState(typeof(E), typeof(S))]
this.RaiseEvent(new E());
This event is not handled until the action that calls this method returns control back to the Coyote runtime. It is handled before any other events are dequeued from the inbox. Only one of the following can be called per action: RaiseEvent
, RaiseGotoStateEvent
, RaisePushStateEvent
or RaisePopStateEvent
and RaiseHaltEvent
. An Assert is raised if you accidentally try and do two of these operations in a single action.
See Also
- class State
- class StateMachine
- namespace Microsoft.Coyote.Actors
- assembly Microsoft.Coyote.Actors