From c96fc7fcef4b415f561d5e1b6434cb708cbeb592 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Mon, 8 Aug 2016 12:18:07 -0700 Subject: Added missing generated code from previous commits. Change-Id: Ie2f1f65be451979d9f8d4da999b1c10737e867af --- .../NamespaceA/NamespaceB/EnumInNestedNS.go | 7 ++++++ .../NamespaceA/NamespaceB/StructInNestedNS.go | 26 ++++++++++++++-------- .../NamespaceA/NamespaceB/TableInNestedNS.go | 15 +++++++++---- tests/namespace_test/NamespaceA/SecondTableInA.go | 15 +++++++++---- tests/namespace_test/NamespaceA/TableInFirstNS.go | 23 ++++++++++++++----- tests/namespace_test/NamespaceC/TableInC.go | 19 +++++++++++----- 6 files changed, 77 insertions(+), 28 deletions(-) (limited to 'tests') diff --git a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go index a1fe117c..2b68991e 100644 --- a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go +++ b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go @@ -7,3 +7,10 @@ const ( EnumInNestedNSB = 1 EnumInNestedNSC = 2 ) + +var EnumNamesEnumInNestedNS = map[int]string{ + EnumInNestedNSA:"A", + EnumInNestedNSB:"B", + EnumInNestedNSC:"C", +} + diff --git a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go index f834a721..3de874b2 100644 --- a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go +++ b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go @@ -5,6 +5,7 @@ package NamespaceB import ( flatbuffers "github.com/google/flatbuffers/go" ) + type StructInNestedNS struct { _tab flatbuffers.Struct } @@ -14,16 +15,23 @@ func (rcv *StructInNestedNS) Init(buf []byte, i flatbuffers.UOffsetT) { rcv._tab.Pos = i } -func (rcv *StructInNestedNS) A() int32 { return rcv._tab.GetInt32(rcv._tab.Pos + flatbuffers.UOffsetT(0)) } -func (rcv *StructInNestedNS) MutateA(n int32) bool { return rcv._tab.MutateInt32(rcv._tab.Pos + flatbuffers.UOffsetT(0), n) } - -func (rcv *StructInNestedNS) B() int32 { return rcv._tab.GetInt32(rcv._tab.Pos + flatbuffers.UOffsetT(4)) } -func (rcv *StructInNestedNS) MutateB(n int32) bool { return rcv._tab.MutateInt32(rcv._tab.Pos + flatbuffers.UOffsetT(4), n) } +func (rcv *StructInNestedNS) A() int32 { + return rcv._tab.GetInt32(rcv._tab.Pos + flatbuffers.UOffsetT(0)) +} +func (rcv *StructInNestedNS) MutateA(n int32) bool { + return rcv._tab.MutateInt32(rcv._tab.Pos+flatbuffers.UOffsetT(0), n) +} +func (rcv *StructInNestedNS) B() int32 { + return rcv._tab.GetInt32(rcv._tab.Pos + flatbuffers.UOffsetT(4)) +} +func (rcv *StructInNestedNS) MutateB(n int32) bool { + return rcv._tab.MutateInt32(rcv._tab.Pos+flatbuffers.UOffsetT(4), n) +} func CreateStructInNestedNS(builder *flatbuffers.Builder, a int32, b int32) flatbuffers.UOffsetT { - builder.Prep(4, 8) - builder.PrependInt32(b) - builder.PrependInt32(a) - return builder.Offset() + builder.Prep(4, 8) + builder.PrependInt32(b) + builder.PrependInt32(a) + return builder.Offset() } diff --git a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go index 2d770573..a25ae7be 100644 --- a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go +++ b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go @@ -5,6 +5,7 @@ package NamespaceB import ( flatbuffers "github.com/google/flatbuffers/go" ) + type TableInNestedNS struct { _tab flatbuffers.Table } @@ -12,7 +13,7 @@ type TableInNestedNS struct { func GetRootAsTableInNestedNS(buf []byte, offset flatbuffers.UOffsetT) *TableInNestedNS { n := flatbuffers.GetUOffsetT(buf[offset:]) x := &TableInNestedNS{} - x.Init(buf, n + offset) + x.Init(buf, n+offset) return x } @@ -33,6 +34,12 @@ func (rcv *TableInNestedNS) MutateFoo(n int32) bool { return rcv._tab.MutateInt32Slot(4, n) } -func TableInNestedNSStart(builder *flatbuffers.Builder) { builder.StartObject(1) } -func TableInNestedNSAddFoo(builder *flatbuffers.Builder, foo int32) { builder.PrependInt32Slot(0, foo, 0) } -func TableInNestedNSEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } +func TableInNestedNSStart(builder *flatbuffers.Builder) { + builder.StartObject(1) +} +func TableInNestedNSAddFoo(builder *flatbuffers.Builder, foo int32) { + builder.PrependInt32Slot(0, foo, 0) +} +func TableInNestedNSEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/tests/namespace_test/NamespaceA/SecondTableInA.go b/tests/namespace_test/NamespaceA/SecondTableInA.go index 40454419..f53a1ead 100644 --- a/tests/namespace_test/NamespaceA/SecondTableInA.go +++ b/tests/namespace_test/NamespaceA/SecondTableInA.go @@ -5,6 +5,7 @@ package NamespaceA import ( flatbuffers "github.com/google/flatbuffers/go" ) + type SecondTableInA struct { _tab flatbuffers.Table } @@ -12,7 +13,7 @@ type SecondTableInA struct { func GetRootAsSecondTableInA(buf []byte, offset flatbuffers.UOffsetT) *SecondTableInA { n := flatbuffers.GetUOffsetT(buf[offset:]) x := &SecondTableInA{} - x.Init(buf, n + offset) + x.Init(buf, n+offset) return x } @@ -34,6 +35,12 @@ func (rcv *SecondTableInA) ReferToC(obj *TableInC) *TableInC { return nil } -func SecondTableInAStart(builder *flatbuffers.Builder) { builder.StartObject(1) } -func SecondTableInAAddReferToC(builder *flatbuffers.Builder, referToC flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(referToC), 0) } -func SecondTableInAEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } +func SecondTableInAStart(builder *flatbuffers.Builder) { + builder.StartObject(1) +} +func SecondTableInAAddReferToC(builder *flatbuffers.Builder, referToC flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(referToC), 0) +} +func SecondTableInAEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/tests/namespace_test/NamespaceA/TableInFirstNS.go b/tests/namespace_test/NamespaceA/TableInFirstNS.go index 5122fd7e..4820a8ae 100644 --- a/tests/namespace_test/NamespaceA/TableInFirstNS.go +++ b/tests/namespace_test/NamespaceA/TableInFirstNS.go @@ -5,6 +5,7 @@ package NamespaceA import ( flatbuffers "github.com/google/flatbuffers/go" ) + type TableInFirstNS struct { _tab flatbuffers.Table } @@ -12,7 +13,7 @@ type TableInFirstNS struct { func GetRootAsTableInFirstNS(buf []byte, offset flatbuffers.UOffsetT) *TableInFirstNS { n := flatbuffers.GetUOffsetT(buf[offset:]) x := &TableInFirstNS{} - x.Init(buf, n + offset) + x.Init(buf, n+offset) return x } @@ -59,8 +60,18 @@ func (rcv *TableInFirstNS) FooStruct(obj *StructInNestedNS) *StructInNestedNS { return nil } -func TableInFirstNSStart(builder *flatbuffers.Builder) { builder.StartObject(3) } -func TableInFirstNSAddFooTable(builder *flatbuffers.Builder, fooTable flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(fooTable), 0) } -func TableInFirstNSAddFooEnum(builder *flatbuffers.Builder, fooEnum int8) { builder.PrependInt8Slot(1, fooEnum, 0) } -func TableInFirstNSAddFooStruct(builder *flatbuffers.Builder, fooStruct flatbuffers.UOffsetT) { builder.PrependStructSlot(2, flatbuffers.UOffsetT(fooStruct), 0) } -func TableInFirstNSEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } +func TableInFirstNSStart(builder *flatbuffers.Builder) { + builder.StartObject(3) +} +func TableInFirstNSAddFooTable(builder *flatbuffers.Builder, fooTable flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(fooTable), 0) +} +func TableInFirstNSAddFooEnum(builder *flatbuffers.Builder, fooEnum int8) { + builder.PrependInt8Slot(1, fooEnum, 0) +} +func TableInFirstNSAddFooStruct(builder *flatbuffers.Builder, fooStruct flatbuffers.UOffsetT) { + builder.PrependStructSlot(2, flatbuffers.UOffsetT(fooStruct), 0) +} +func TableInFirstNSEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/tests/namespace_test/NamespaceC/TableInC.go b/tests/namespace_test/NamespaceC/TableInC.go index 81c59f17..d0d8b002 100644 --- a/tests/namespace_test/NamespaceC/TableInC.go +++ b/tests/namespace_test/NamespaceC/TableInC.go @@ -5,6 +5,7 @@ package NamespaceC import ( flatbuffers "github.com/google/flatbuffers/go" ) + type TableInC struct { _tab flatbuffers.Table } @@ -12,7 +13,7 @@ type TableInC struct { func GetRootAsTableInC(buf []byte, offset flatbuffers.UOffsetT) *TableInC { n := flatbuffers.GetUOffsetT(buf[offset:]) x := &TableInC{} - x.Init(buf, n + offset) + x.Init(buf, n+offset) return x } @@ -47,7 +48,15 @@ func (rcv *TableInC) ReferToA2(obj *SecondTableInA) *SecondTableInA { return nil } -func TableInCStart(builder *flatbuffers.Builder) { builder.StartObject(2) } -func TableInCAddReferToA1(builder *flatbuffers.Builder, referToA1 flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(referToA1), 0) } -func TableInCAddReferToA2(builder *flatbuffers.Builder, referToA2 flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(referToA2), 0) } -func TableInCEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } +func TableInCStart(builder *flatbuffers.Builder) { + builder.StartObject(2) +} +func TableInCAddReferToA1(builder *flatbuffers.Builder, referToA1 flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(referToA1), 0) +} +func TableInCAddReferToA2(builder *flatbuffers.Builder, referToA2 flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(referToA2), 0) +} +func TableInCEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} -- cgit v1.2.3