Repository navigation
Expand file tree
/
Copy pathPizza.go
More file actions
82 lines (68 loc) · 1.63 KB
/
Copy pathPizza.go
File metadata and controls
82 lines (68 loc) · 1.63 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Code generated by the FlatBuffers compiler. DO NOT EDIT.
package Pizza
import (
flatbuffers "github.com/google/flatbuffers/go"
)
type PizzaT struct {
Size int32 `json:"size"`
}
func (t *PizzaT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
if t == nil {
return 0
}
PizzaStart(builder)
PizzaAddSize(builder, t.Size)
return PizzaEnd(builder)
}
func (rcv *Pizza) UnPackTo(t *PizzaT) {
t.Size = rcv.Size()
}
func (rcv *Pizza) UnPack() *PizzaT {
if rcv == nil {
return nil
}
t := &PizzaT{}
rcv.UnPackTo(t)
return t
}
type Pizza struct {
_tab flatbuffers.Table
}
func GetRootAsPizza(buf []byte, offset flatbuffers.UOffsetT) *Pizza {
n := flatbuffers.GetUOffsetT(buf[offset:])
x := &Pizza{}
x.Init(buf, n+offset)
return x
}
func GetSizePrefixedRootAsPizza(buf []byte, offset flatbuffers.UOffsetT) *Pizza {
n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
x := &Pizza{}
x.Init(buf, n+offset+flatbuffers.SizeUint32)
return x
}
func (rcv *Pizza) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Bytes = buf
rcv._tab.Pos = i
}
func (rcv *Pizza) Table() flatbuffers.Table {
return rcv._tab
}
func (rcv *Pizza) Size() int32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *Pizza) MutateSize(n int32) bool {
return rcv._tab.MutateInt32Slot(4, n)
}
func PizzaStart(builder *flatbuffers.Builder) {
builder.StartObject(1)
}
func PizzaAddSize(builder *flatbuffers.Builder, size int32) {
builder.PrependInt32Slot(0, size, 0)
}
func PizzaEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
return builder.EndObject()
}