inet.af/netstack@v0.0.0-20220214151720-7585b01ddccf/buffer/buffer_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package buffer 4 5 import ( 6 "inet.af/netstack/state" 7 ) 8 9 func (b *buffer) StateTypeName() string { 10 return "pkg/buffer.buffer" 11 } 12 13 func (b *buffer) StateFields() []string { 14 return []string{ 15 "data", 16 "read", 17 "write", 18 "bufferEntry", 19 } 20 } 21 22 func (b *buffer) beforeSave() {} 23 24 // +checklocksignore 25 func (b *buffer) StateSave(stateSinkObject state.Sink) { 26 b.beforeSave() 27 stateSinkObject.Save(0, &b.data) 28 stateSinkObject.Save(1, &b.read) 29 stateSinkObject.Save(2, &b.write) 30 stateSinkObject.Save(3, &b.bufferEntry) 31 } 32 33 func (b *buffer) afterLoad() {} 34 35 // +checklocksignore 36 func (b *buffer) StateLoad(stateSourceObject state.Source) { 37 stateSourceObject.Load(0, &b.data) 38 stateSourceObject.Load(1, &b.read) 39 stateSourceObject.Load(2, &b.write) 40 stateSourceObject.Load(3, &b.bufferEntry) 41 } 42 43 func (l *bufferList) StateTypeName() string { 44 return "pkg/buffer.bufferList" 45 } 46 47 func (l *bufferList) StateFields() []string { 48 return []string{ 49 "head", 50 "tail", 51 } 52 } 53 54 func (l *bufferList) beforeSave() {} 55 56 // +checklocksignore 57 func (l *bufferList) StateSave(stateSinkObject state.Sink) { 58 l.beforeSave() 59 stateSinkObject.Save(0, &l.head) 60 stateSinkObject.Save(1, &l.tail) 61 } 62 63 func (l *bufferList) afterLoad() {} 64 65 // +checklocksignore 66 func (l *bufferList) StateLoad(stateSourceObject state.Source) { 67 stateSourceObject.Load(0, &l.head) 68 stateSourceObject.Load(1, &l.tail) 69 } 70 71 func (e *bufferEntry) StateTypeName() string { 72 return "pkg/buffer.bufferEntry" 73 } 74 75 func (e *bufferEntry) StateFields() []string { 76 return []string{ 77 "next", 78 "prev", 79 } 80 } 81 82 func (e *bufferEntry) beforeSave() {} 83 84 // +checklocksignore 85 func (e *bufferEntry) StateSave(stateSinkObject state.Sink) { 86 e.beforeSave() 87 stateSinkObject.Save(0, &e.next) 88 stateSinkObject.Save(1, &e.prev) 89 } 90 91 func (e *bufferEntry) afterLoad() {} 92 93 // +checklocksignore 94 func (e *bufferEntry) StateLoad(stateSourceObject state.Source) { 95 stateSourceObject.Load(0, &e.next) 96 stateSourceObject.Load(1, &e.prev) 97 } 98 99 func (p *pool) StateTypeName() string { 100 return "pkg/buffer.pool" 101 } 102 103 func (p *pool) StateFields() []string { 104 return []string{ 105 "bufferSize", 106 "embeddedStorage", 107 } 108 } 109 110 func (p *pool) beforeSave() {} 111 112 // +checklocksignore 113 func (p *pool) StateSave(stateSinkObject state.Sink) { 114 p.beforeSave() 115 stateSinkObject.Save(0, &p.bufferSize) 116 stateSinkObject.Save(1, &p.embeddedStorage) 117 } 118 119 // +checklocksignore 120 func (p *pool) StateLoad(stateSourceObject state.Source) { 121 stateSourceObject.Load(0, &p.bufferSize) 122 stateSourceObject.LoadWait(1, &p.embeddedStorage) 123 stateSourceObject.AfterLoad(p.afterLoad) 124 } 125 126 func (v *View) StateTypeName() string { 127 return "pkg/buffer.View" 128 } 129 130 func (v *View) StateFields() []string { 131 return []string{ 132 "data", 133 "size", 134 "pool", 135 } 136 } 137 138 func (v *View) beforeSave() {} 139 140 // +checklocksignore 141 func (v *View) StateSave(stateSinkObject state.Sink) { 142 v.beforeSave() 143 stateSinkObject.Save(0, &v.data) 144 stateSinkObject.Save(1, &v.size) 145 stateSinkObject.Save(2, &v.pool) 146 } 147 148 func (v *View) afterLoad() {} 149 150 // +checklocksignore 151 func (v *View) StateLoad(stateSourceObject state.Source) { 152 stateSourceObject.Load(0, &v.data) 153 stateSourceObject.Load(1, &v.size) 154 stateSourceObject.Load(2, &v.pool) 155 } 156 157 func init() { 158 state.Register((*buffer)(nil)) 159 state.Register((*bufferList)(nil)) 160 state.Register((*bufferEntry)(nil)) 161 state.Register((*pool)(nil)) 162 state.Register((*View)(nil)) 163 }