-
Notifications
You must be signed in to change notification settings - Fork 0
/
CmdOptionSetSignal.go
101 lines (86 loc) · 2.7 KB
/
CmdOptionSetSignal.go
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Code generated by the FlatBuffers compiler. DO NOT EDIT.
package fbtypes
import (
flatbuffers "github.com/google/flatbuffers/go"
)
/// parameters for the command wait for signal
type CmdOptionSetSignalT struct {
PermType string `json:"permType"`
SignalId uint32 `json:"signalId"`
}
func (t *CmdOptionSetSignalT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
if t == nil { return 0 }
permTypeOffset := flatbuffers.UOffsetT(0)
if t.PermType != "" {
permTypeOffset = builder.CreateString(t.PermType)
}
CmdOptionSetSignalStart(builder)
CmdOptionSetSignalAddPermType(builder, permTypeOffset)
CmdOptionSetSignalAddSignalId(builder, t.SignalId)
return CmdOptionSetSignalEnd(builder)
}
func (rcv *CmdOptionSetSignal) UnPackTo(t *CmdOptionSetSignalT) {
t.PermType = string(rcv.PermType())
t.SignalId = rcv.SignalId()
}
func (rcv *CmdOptionSetSignal) UnPack() *CmdOptionSetSignalT {
if rcv == nil { return nil }
t := &CmdOptionSetSignalT{}
rcv.UnPackTo(t)
return t
}
type CmdOptionSetSignal struct {
_tab flatbuffers.Table
}
func GetRootAsCmdOptionSetSignal(buf []byte, offset flatbuffers.UOffsetT) *CmdOptionSetSignal {
n := flatbuffers.GetUOffsetT(buf[offset:])
x := &CmdOptionSetSignal{}
x.Init(buf, n+offset)
return x
}
func GetSizePrefixedRootAsCmdOptionSetSignal(buf []byte, offset flatbuffers.UOffsetT) *CmdOptionSetSignal {
n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
x := &CmdOptionSetSignal{}
x.Init(buf, n+offset+flatbuffers.SizeUint32)
return x
}
func (rcv *CmdOptionSetSignal) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Bytes = buf
rcv._tab.Pos = i
}
func (rcv *CmdOptionSetSignal) Table() flatbuffers.Table {
return rcv._tab
}
/// permanent type (e.g. "Once")
func (rcv *CmdOptionSetSignal) PermType() []byte {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {
return rcv._tab.ByteVector(o + rcv._tab.Pos)
}
return nil
}
/// permanent type (e.g. "Once")
/// signal Id
func (rcv *CmdOptionSetSignal) SignalId() uint32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
if o != 0 {
return rcv._tab.GetUint32(o + rcv._tab.Pos)
}
return 0
}
/// signal Id
func (rcv *CmdOptionSetSignal) MutateSignalId(n uint32) bool {
return rcv._tab.MutateUint32Slot(6, n)
}
func CmdOptionSetSignalStart(builder *flatbuffers.Builder) {
builder.StartObject(2)
}
func CmdOptionSetSignalAddPermType(builder *flatbuffers.Builder, permType flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(permType), 0)
}
func CmdOptionSetSignalAddSignalId(builder *flatbuffers.Builder, signalId uint32) {
builder.PrependUint32Slot(1, signalId, 0)
}
func CmdOptionSetSignalEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
return builder.EndObject()
}