core

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeSymbol

func MakeSymbol(typ, member string) string

func SplitSymbol

func SplitSymbol(symbol string) (string, string)

Types

type Args

type Args []any

Args is a slice of arguments.

type IEngine

type IEngine interface {
	HasInterface(symbol string) bool
	InvokeOperation(symbol string, name string, params KWArgs) (any, error)
	SetProperties(symbol string, params KWArgs) error
	GetProperties(symbol string) (KWArgs, error)
	HasSequence(name string) bool
	PlaySequence(name string)
	OnChange(f OnChangeFunc)
	OnSignal(f OnSignalFunc)
}

IEngine is the interface for the simulation engine.

type KWArgs

type KWArgs map[string]any

KWArgs is a map of key-value pairs.

type MultiEngine

type MultiEngine struct {
	Notifier
	// contains filtered or unexported fields
}

func NewMultiEngine

func NewMultiEngine(entries ...IEngine) *MultiEngine

func (*MultiEngine) GetProperties

func (e *MultiEngine) GetProperties(ifaceId string) (KWArgs, error)

FetchProperties fetches the properties of the interface.

func (*MultiEngine) HasInterface

func (e *MultiEngine) HasInterface(ifaceId string) bool

HasInterface returns true if the interface is served by the simulation.

func (*MultiEngine) HasSequence

func (e *MultiEngine) HasSequence(sequencerId string) bool

func (*MultiEngine) InvokeOperation

func (e *MultiEngine) InvokeOperation(ifaceId string, name string, args KWArgs) (any, error)

InvokeOperation invokes the operation of the interface.

func (*MultiEngine) PlaySequence

func (e *MultiEngine) PlaySequence(sequenceId string)

func (*MultiEngine) SetProperties

func (e *MultiEngine) SetProperties(ifaceId string, props KWArgs) error

SetProperties sets the properties of the interface.

type Notifier

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

func (*Notifier) EmitOnChange

func (n *Notifier) EmitOnChange(symbol string, name string, value any)

func (*Notifier) EmitOnSignal

func (n *Notifier) EmitOnSignal(symbol string, name string, args KWArgs)

func (*Notifier) OnChange

func (n *Notifier) OnChange(f OnChangeFunc)

func (*Notifier) OnSignal

func (n *Notifier) OnSignal(f OnSignalFunc)

type OnChangeFunc

type OnChangeFunc func(symbol string, name string, value any)

type OnSignalFunc

type OnSignalFunc func(symbol string, name string, args KWArgs)

Jump to

Keyboard shortcuts

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