instance

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: GPL-3.0, GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package instance provides context for parallel instances of the VCS type (defined in hardware package).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {
	// the name of the instance. the name can be used to decide if an action is appropriate
	Label Label

	// any randomisation required by the emulation should be retreived through
	// this structure
	Random *random.Random

	// the prefrences of the running instance. this instance can be shared
	// with other running instances of the emulation.
	Prefs *preferences.Preferences
}

Instance defines those parts of the emulation that might change between different instantiations of the VCS type, but is not actually the VCS itself.

func NewInstance

func NewInstance(tv random.TV, prefs *preferences.Preferences) (*Instance, error)

NewInstance is the preferred method of initialisation for the Instance type.

The two arguments must be supplied. In the case of the prefs field it can by nil and a new prefs instance will be created. Providing a non-nil value allows the preferences of more than one VCS instance to be synchronised.

func (*Instance) Normalise

func (ins *Instance) Normalise()

Normalise ensures the VCS instance is in an known default state. Useful for regression testing where the initial state must be the same for every run of the test.

type Label

type Label string

Label indicates the context of the instance.

const (
	Main        Label = ""
	Thumbnailer Label = "thumbnailer"
	Comparison  Label = "comparison"
)

List of value Label values.

Jump to

Keyboard shortcuts

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