transitioner

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package transitioner defines the Transitioner interface, as well as its implementations in order to translate between internal O² state machine states and events, and the states and events of some other process state machine (such as the FairMQ Device state machine).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direct

type Direct struct {
	DoTransition DoTransitionFunc
}

func NewDirectTransitioner

func NewDirectTransitioner(transitionFunc DoTransitionFunc) *Direct

func (*Direct) Commit

func (cm *Direct) Commit(evt string, src string, dst string, args map[string]string) (finalState string, err error)

func (*Direct) FromDeviceState

func (cm *Direct) FromDeviceState(state string) string

type DoTransitionFunc

type DoTransitionFunc func(ei EventInfo) (newState string, err error)

type EventInfo

type EventInfo struct {
	Evt  string
	Src  string
	Dst  string
	Args map[string]string
}

type FairMQ

type FairMQ struct {
	DoTransition DoTransitionFunc
	// contains filtered or unexported fields
}

func NewFairMQTransitioner

func NewFairMQTransitioner(transitionFunc DoTransitionFunc) *FairMQ

func (*FairMQ) Commit

func (cm *FairMQ) Commit(evt string, src string, dst string, args map[string]string) (finalState string, err error)

func (*FairMQ) FromDeviceState

func (cm *FairMQ) FromDeviceState(state string) string

type Transitioner

type Transitioner interface {
	Commit(evt string, src string, dst string, args map[string]string) (finalState string, err error)
	FromDeviceState(state string) string
}

func NewTransitioner

func NewTransitioner(cm controlmode.ControlMode, transitionFunc DoTransitionFunc) Transitioner

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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