summaryrefslogtreecommitdiffhomepage
path: root/pkg/ilist/ilist_state_autogen.go
blob: 378b7a895f154489b2b1178844c993a2ff03bf08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// automatically generated by stateify.

package ilist

import (
	"gvisor.dev/gvisor/pkg/state"
)

func (l *List) StateTypeName() string {
	return "pkg/ilist.List"
}

func (l *List) StateFields() []string {
	return []string{
		"head",
		"tail",
	}
}

func (l *List) beforeSave() {}

func (l *List) StateSave(stateSinkObject state.Sink) {
	l.beforeSave()
	stateSinkObject.Save(0, &l.head)
	stateSinkObject.Save(1, &l.tail)
}

func (l *List) afterLoad() {}

func (l *List) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &l.head)
	stateSourceObject.Load(1, &l.tail)
}

func (e *Entry) StateTypeName() string {
	return "pkg/ilist.Entry"
}

func (e *Entry) StateFields() []string {
	return []string{
		"next",
		"prev",
	}
}

func (e *Entry) beforeSave() {}

func (e *Entry) StateSave(stateSinkObject state.Sink) {
	e.beforeSave()
	stateSinkObject.Save(0, &e.next)
	stateSinkObject.Save(1, &e.prev)
}

func (e *Entry) afterLoad() {}

func (e *Entry) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &e.next)
	stateSourceObject.Load(1, &e.prev)
}

func init() {
	state.Register((*List)(nil))
	state.Register((*Entry)(nil))
}