Struct StateView
Read-only view of a state in an automaton, providing access to transitions from the state.
Inherited Members
Namespace: Automata.Core
Assembly: Automata.Core.dll
Syntax
public readonly ref struct StateView
Remarks
This struct uses a ReadOnlySpan which is only a view on a contiguous memory sequence of Transition(int).
Constructors
| Edit this page View SourceStateView(int, Transition[])
Initializes a new instance of the StateView struct with a specified state and unfiltered transitions.
Declaration
public StateView(int fromState, Transition[] transitions)
Parameters
Type | Name | Description |
---|---|---|
int | fromState | State from which the transitions originate. |
Transition[] | transitions | Filtered transitions from the specified state. |
StateView(int, ReadOnlySpan<Transition>)
Initializes a new instance of the StateView struct with a specified state and unfiltered transitions.
Declaration
public StateView(int fromState, ReadOnlySpan<Transition> transitions)
Parameters
Type | Name | Description |
---|---|---|
int | fromState | State from which the transitions originate. |
ReadOnlySpan<Transition> | transitions | Filtered transitions from the specified state. |
Fields
| Edit this page View SourceTransitions
Transitions from the current state.
Declaration
public readonly ReadOnlySpan<Transition> Transitions
Field Value
Type | Description |
---|---|
ReadOnlySpan<Transition> |
Properties
| Edit this page View SourceState
State from which the transitions originate.
Declaration
public int State { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceTransition(int)
Gets the transition for the specified symbol.
Declaration
public Transition Transition(int symbol)
Parameters
Type | Name | Description |
---|---|---|
int | symbol | Symbol for which to get the transition. |
Returns
Type | Description |
---|---|
Transition | Transition for the specified symbol, or Invalid if no such transition exists. |