fsm

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IMachine

type IMachine interface {
	Add(s *IState)
	Remove(s *IState)
	//	ID() int
	Enter(previousStateID int) error
	Update() (error, int)
	Transition() error
	Exit() error
}

type IState

type IState interface {
	ID() int
	Enter(previousStateID int) error
	Update() (error, int)
	Exit() error
}

type Machine

type Machine struct {
	// contains filtered or unexported fields
}

func MakeMachine

func MakeMachine() Machine

func NewMachine

func NewMachine() *Machine

func (*Machine) Add

func (m *Machine) Add(s *IState)

func (*Machine) Enter

func (m *Machine) Enter(startStateID int) error

func (*Machine) Exit

func (m *Machine) Exit() error

func (*Machine) Remove

func (m *Machine) Remove(s *IState)

func (*Machine) Transition

func (m *Machine) Transition() error

func (*Machine) Update

func (m *Machine) Update() (error, int)

type State

type State struct {
	// contains filtered or unexported fields
}

func MakeState

func MakeState(n string, i int) State

func NewState

func NewState(n string, i int) *State

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL