testcmd

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package testcmd provides fake commands used for testing.

Index

Constants

This section is empty.

Variables

View Source
var (
	APIID = api.ID{1, 2, 3}

	P = &X{
		Str:  "aaa",
		Sli:  []bool{true, false, true},
		Ref:  &Struct{Str: "ccc", Ref: &Struct{Str: "ddd"}},
		Ptr:  Pointer{0x123, 0x456},
		Map:  StringːString{map[string]string{"cat": "meow", "dog": "woof"}},
		PMap: IntːStructPtr{map[int]*Struct{}},
		RMap: map[string]string{"eyes": "see", "nose": "smells"},
	}

	Q = &X{
		Str: "xyz",
		Sli: []bool{false, true, false},
		Ptr: Pointer{0x321, 0x654},
		Map: StringːString{map[string]string{"bird": "tweet", "fox": "?"}},
		PMap: IntːStructPtr{map[int]*Struct{
			100: &Struct{Str: "baldrick"},
		}},
		RMap: map[string]string{"ears": "hear", "tongue": "taste"},
	}
)

Functions

This section is empty.

Types

type A

type A struct {
	ID    api.CmdID
	Flags api.CmdFlags
}

func (*A) API

func (a *A) API() api.API

func (*A) Caller added in v0.6.0

func (a *A) Caller() api.CmdID

func (*A) CmdFlags

func (a *A) CmdFlags(context.Context, api.CmdID, *api.GlobalState) api.CmdFlags

func (*A) CmdName

func (a *A) CmdName() string

func (*A) Extras

func (a *A) Extras() *api.CmdExtras

func (*A) Mutate

func (*A) SetCaller added in v0.6.0

func (a *A) SetCaller(api.CmdID)

func (*A) SetThread

func (a *A) SetThread(uint64)

func (*A) Thread

func (a *A) Thread() uint64

type API

type API struct{}

func (API) ConstantSets

func (API) ConstantSets() *constset.Pack

func (API) Context

func (API) Context(*api.GlobalState, uint64) api.Context

func (API) CreateCmd

func (API) CreateCmd(name string) api.Cmd

func (API) GetFramebufferAttachmentInfo

func (API) GetFramebufferAttachmentInfo(
	ctx context.Context,
	after []uint64,
	state *api.GlobalState,
	thread uint64,
	attachment api.FramebufferAttachment) (width, height, index uint32, format *image.Format, err error)

func (API) ID

func (API) ID() api.ID

func (API) Index

func (API) Index() uint8

func (API) Name

func (API) Name() string

type B

type B struct {
	ID   api.CmdID
	Bool bool
}

func (*B) API

func (*B) API() api.API

func (*B) Caller added in v0.6.0

func (*B) Caller() api.CmdID

func (*B) CmdFlags

func (*B) CmdName

func (*B) CmdName() string

func (*B) Extras

func (*B) Extras() *api.CmdExtras

func (*B) Mutate

func (*B) SetCaller added in v0.6.0

func (*B) SetCaller(api.CmdID)

func (*B) SetThread

func (*B) SetThread(uint64)

func (*B) Thread

func (*B) Thread() uint64

type CmdAndID

type CmdAndID struct {
	Cmd api.Cmd
	Id  api.CmdID
}

type CmdAndIDList

type CmdAndIDList []CmdAndID

func List

func List(cmds ...interface{}) CmdAndIDList

List takes a mix of Cmds and CmdIDsAndCmd and returns a CmdIDListAndCmd. Cmds are transformed into CmdIDsAndCmd by using the ID field as the command id.

func (*CmdAndIDList) Write

func (l *CmdAndIDList) Write(ctx context.Context, id api.CmdID, c api.Cmd)

type IntːStructPtr

type IntːStructPtr struct{ M map[int]*Struct }

func (*IntːStructPtr) Assign added in v0.9.0

func (m *IntːStructPtr) Assign(v interface{}) bool

func (IntːStructPtr) Dictionary added in v0.9.0

func (m IntːStructPtr) Dictionary() dictionary.I

type Pointer

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

func (Pointer) APointer added in v1.0.1

func (p Pointer) APointer()

func (Pointer) Address

func (p Pointer) Address() uint64

func (*Pointer) Assign

func (p *Pointer) Assign(o interface{}) bool

func (Pointer) ElementSize

func (p Pointer) ElementSize(m *device.MemoryLayout) uint64

func (Pointer) ElementType

func (p Pointer) ElementType() reflect.Type

func (Pointer) ISlice

func (p Pointer) ISlice(start, end uint64, m *device.MemoryLayout) memory.Slice

func (Pointer) IsNullptr

func (p Pointer) IsNullptr() bool

func (Pointer) Offset

func (p Pointer) Offset(n uint64) memory.Pointer

func (Pointer) Pool

func (p Pointer) Pool() memory.PoolID

func (Pointer) String

func (p Pointer) String() string

type RawIntːStructPtr added in v0.9.0

type RawIntːStructPtr map[string]string

type StringːString

type StringːString struct{ M map[string]string }

func (*StringːString) Assign added in v0.9.0

func (m *StringːString) Assign(v interface{}) bool

func (StringːString) Dictionary added in v0.9.0

func (m StringːString) Dictionary() dictionary.I

type Struct

type Struct struct {
	Str string
	Ref *Struct
}

type Writer

type Writer struct {
	S          *api.GlobalState
	Cmds       []api.Cmd
	CmdsAndIDs []CmdAndID
}

Writer is a transform.Writer that record all commands that pass through it.

func (*Writer) MutateAndWrite

func (w *Writer) MutateAndWrite(ctx context.Context, id api.CmdID, cmd api.Cmd)

func (*Writer) State

func (w *Writer) State() *api.GlobalState

type X

type X struct {
	Str  string           `param:"Str"`
	Sli  []bool           `param:"Sli"`
	Ref  *Struct          `param:"Ref"`
	Ptr  Pointer          `param:"Ptr"`
	Map  StringːString    `param:"Map"`
	PMap IntːStructPtr    `param:"PMap"`
	RMap RawIntːStructPtr `param:"RMap"`
}

func (X) API

func (X) API() api.API

func (X) Caller added in v0.6.0

func (X) Caller() api.CmdID

func (X) CmdFlags

func (X) CmdName

func (X) CmdName() string

func (X) Extras

func (X) Extras() *api.CmdExtras

func (X) SetCaller added in v0.6.0

func (X) SetCaller(api.CmdID)

func (X) SetThread

func (X) SetThread(uint64)

func (X) Thread

func (X) Thread() uint64

Directories

Path Synopsis
Package test_pb describes the serialization format for the test api.
Package test_pb describes the serialization format for the test api.

Jump to

Keyboard shortcuts

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