Automata Docs Automata Docs
Automata Docs Automata Docs

Search Results for

    Edit this page

    Struct StateView

    A fast readonly view of a state in a deterministic automaton, providing access to transitions from this specific state.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Automata.Core
    Assembly: Automata.Core.dll
    Syntax
    public readonly ref struct StateView
    Remarks

    This struct uses a ReadOnlySpan as a view on a contiguous memory sequence of Transition(int).

    Constructors

    | Edit this page View Source

    StateView(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.

    | Edit this page View Source

    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.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    If fromState is negative.

    Fields

    | Edit this page View Source

    Transitions

    Transitions from the current state.

    Declaration
    public readonly ReadOnlySpan<Transition> Transitions
    Field Value
    Type Description
    ReadOnlySpan<Transition>

    Properties

    | Edit this page View Source

    State

    State from which the transitions originate.

    Declaration
    public int State { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    Transition(int)

    State reachable from the current state on symbol.

    Declaration
    public int Transition(int symbol)
    Parameters
    Type Name Description
    int symbol

    Symbol of the transition.

    Returns
    Type Description
    int

    State reachable from the current state on symbol; InvalidState if no such transition exists.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    If symbol is negative.

    See Also
    TryTransition(int, out int)
    | Edit this page View Source

    TryTransition(int, out int)

    Tries to get the state reachable from the current state on the specified symbol.

    Declaration
    public bool TryTransition(int symbol, out int toState)
    Parameters
    Type Name Description
    int symbol

    Symbol for the transition.

    int toState

    The reachable state, or InvalidState if the method returns false.

    Returns
    Type Description
    bool

    true iff a reachable state exists.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    If symbol is negative.

    See Also
    Transition(int)