2016-05-26 13:26:58 +00:00
|
|
|
// automatically generated by the FlatBuffers compiler, do not modify
|
2015-08-11 16:01:43 +00:00
|
|
|
|
|
|
|
package Example
|
|
|
|
|
|
|
|
import (
|
|
|
|
flatbuffers "github.com/google/flatbuffers/go"
|
|
|
|
)
|
2016-07-07 10:55:36 +00:00
|
|
|
|
2015-08-11 16:01:43 +00:00
|
|
|
type TestSimpleTableWithEnum struct {
|
|
|
|
_tab flatbuffers.Table
|
|
|
|
}
|
|
|
|
|
2015-11-22 00:49:33 +00:00
|
|
|
func GetRootAsTestSimpleTableWithEnum(buf []byte, offset flatbuffers.UOffsetT) *TestSimpleTableWithEnum {
|
|
|
|
n := flatbuffers.GetUOffsetT(buf[offset:])
|
|
|
|
x := &TestSimpleTableWithEnum{}
|
2016-07-07 10:55:36 +00:00
|
|
|
x.Init(buf, n+offset)
|
2015-11-22 00:49:33 +00:00
|
|
|
return x
|
|
|
|
}
|
|
|
|
|
2015-08-11 16:01:43 +00:00
|
|
|
func (rcv *TestSimpleTableWithEnum) Init(buf []byte, i flatbuffers.UOffsetT) {
|
|
|
|
rcv._tab.Bytes = buf
|
|
|
|
rcv._tab.Pos = i
|
|
|
|
}
|
|
|
|
|
2016-07-07 10:46:39 +00:00
|
|
|
func (rcv *TestSimpleTableWithEnum) Table() flatbuffers.Table {
|
|
|
|
return rcv._tab
|
|
|
|
}
|
|
|
|
|
2015-08-11 16:01:43 +00:00
|
|
|
func (rcv *TestSimpleTableWithEnum) Color() int8 {
|
|
|
|
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
|
|
|
|
if o != 0 {
|
|
|
|
return rcv._tab.GetInt8(o + rcv._tab.Pos)
|
|
|
|
}
|
|
|
|
return 2
|
|
|
|
}
|
|
|
|
|
2016-07-20 17:28:22 +00:00
|
|
|
func (rcv *TestSimpleTableWithEnum) MutateColor(n int8) bool {
|
|
|
|
return rcv._tab.MutateInt8Slot(4, n)
|
|
|
|
}
|
|
|
|
|
2016-07-07 10:55:36 +00:00
|
|
|
func TestSimpleTableWithEnumStart(builder *flatbuffers.Builder) {
|
|
|
|
builder.StartObject(1)
|
|
|
|
}
|
|
|
|
func TestSimpleTableWithEnumAddColor(builder *flatbuffers.Builder, color int8) {
|
|
|
|
builder.PrependInt8Slot(0, color, 2)
|
|
|
|
}
|
|
|
|
func TestSimpleTableWithEnumEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
|
|
|
|
return builder.EndObject()
|
|
|
|
}
|