Implement mutators for Go

This commit is contained in:
Muhammed Thanish
2016-07-20 22:58:22 +05:30
parent ffc0d6209a
commit 53e9606ea2
9 changed files with 631 additions and 2 deletions

View File

@@ -30,6 +30,10 @@ func (rcv *Stat) Val() int64 {
return 0
}
func (rcv *Stat) MutateVal(n int64) bool {
return rcv._tab.MutateInt64Slot(6, n)
}
func (rcv *Stat) Count() uint16 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
if o != 0 {
@@ -38,6 +42,10 @@ func (rcv *Stat) Count() uint16 {
return 0
}
func (rcv *Stat) MutateCount(n uint16) bool {
return rcv._tab.MutateUint16Slot(8, n)
}
func StatStart(builder *flatbuffers.Builder) { builder.StartObject(3) }
func StatAddId(builder *flatbuffers.Builder, id flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(id), 0) }
func StatAddVal(builder *flatbuffers.Builder, val int64) { builder.PrependInt64Slot(1, val, 0) }