1// Code generated by the FlatBuffers compiler. DO NOT EDIT. 2 3package NamespaceA 4 5import ( 6 flatbuffers "github.com/google/flatbuffers/go" 7 8 NamespaceA__NamespaceB "NamespaceA/NamespaceB" 9) 10 11type TableInFirstNST struct { 12 FooTable *NamespaceA__NamespaceB.TableInNestedNST 13 FooEnum NamespaceA__NamespaceB.EnumInNestedNS 14 FooUnion *NamespaceA__NamespaceB.UnionInNestedNST 15 FooStruct *NamespaceA__NamespaceB.StructInNestedNST 16} 17 18func (t *TableInFirstNST) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 19 if t == nil { return 0 } 20 fooTableOffset := t.FooTable.Pack(builder) 21 fooUnionOffset := t.FooUnion.Pack(builder) 22 23 TableInFirstNSStart(builder) 24 TableInFirstNSAddFooTable(builder, fooTableOffset) 25 TableInFirstNSAddFooEnum(builder, t.FooEnum) 26 if t.FooUnion != nil { 27 TableInFirstNSAddFooUnionType(builder, t.FooUnion.Type) 28 } 29 TableInFirstNSAddFooUnion(builder, fooUnionOffset) 30 fooStructOffset := t.FooStruct.Pack(builder) 31 TableInFirstNSAddFooStruct(builder, fooStructOffset) 32 return TableInFirstNSEnd(builder) 33} 34 35func (rcv *TableInFirstNS) UnPackTo(t *TableInFirstNST) { 36 t.FooTable = rcv.FooTable(nil).UnPack() 37 t.FooEnum = rcv.FooEnum() 38 fooUnionTable := flatbuffers.Table{} 39 if rcv.FooUnion(&fooUnionTable) { 40 t.FooUnion = rcv.FooUnionType().UnPack(fooUnionTable) 41 } 42 t.FooStruct = rcv.FooStruct(nil).UnPack() 43} 44 45func (rcv *TableInFirstNS) UnPack() *TableInFirstNST { 46 if rcv == nil { return nil } 47 t := &TableInFirstNST{} 48 rcv.UnPackTo(t) 49 return t 50} 51 52type TableInFirstNS struct { 53 _tab flatbuffers.Table 54} 55 56func GetRootAsTableInFirstNS(buf []byte, offset flatbuffers.UOffsetT) *TableInFirstNS { 57 n := flatbuffers.GetUOffsetT(buf[offset:]) 58 x := &TableInFirstNS{} 59 x.Init(buf, n+offset) 60 return x 61} 62 63func GetSizePrefixedRootAsTableInFirstNS(buf []byte, offset flatbuffers.UOffsetT) *TableInFirstNS { 64 n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) 65 x := &TableInFirstNS{} 66 x.Init(buf, n+offset+flatbuffers.SizeUint32) 67 return x 68} 69 70func (rcv *TableInFirstNS) Init(buf []byte, i flatbuffers.UOffsetT) { 71 rcv._tab.Bytes = buf 72 rcv._tab.Pos = i 73} 74 75func (rcv *TableInFirstNS) Table() flatbuffers.Table { 76 return rcv._tab 77} 78 79func (rcv *TableInFirstNS) FooTable(obj *NamespaceA__NamespaceB.TableInNestedNS) *NamespaceA__NamespaceB.TableInNestedNS { 80 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 81 if o != 0 { 82 x := rcv._tab.Indirect(o + rcv._tab.Pos) 83 if obj == nil { 84 obj = new(NamespaceA__NamespaceB.TableInNestedNS) 85 } 86 obj.Init(rcv._tab.Bytes, x) 87 return obj 88 } 89 return nil 90} 91 92func (rcv *TableInFirstNS) FooEnum() NamespaceA__NamespaceB.EnumInNestedNS { 93 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 94 if o != 0 { 95 return NamespaceA__NamespaceB.EnumInNestedNS(rcv._tab.GetInt8(o + rcv._tab.Pos)) 96 } 97 return 0 98} 99 100func (rcv *TableInFirstNS) MutateFooEnum(n NamespaceA__NamespaceB.EnumInNestedNS) bool { 101 return rcv._tab.MutateInt8Slot(6, int8(n)) 102} 103 104func (rcv *TableInFirstNS) FooUnionType() NamespaceA__NamespaceB.UnionInNestedNS { 105 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 106 if o != 0 { 107 return NamespaceA__NamespaceB.UnionInNestedNS(rcv._tab.GetByte(o + rcv._tab.Pos)) 108 } 109 return 0 110} 111 112func (rcv *TableInFirstNS) MutateFooUnionType(n NamespaceA__NamespaceB.UnionInNestedNS) bool { 113 return rcv._tab.MutateByteSlot(8, byte(n)) 114} 115 116func (rcv *TableInFirstNS) FooUnion(obj *flatbuffers.Table) bool { 117 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 118 if o != 0 { 119 rcv._tab.Union(obj, o) 120 return true 121 } 122 return false 123} 124 125func (rcv *TableInFirstNS) FooStruct(obj *NamespaceA__NamespaceB.StructInNestedNS) *NamespaceA__NamespaceB.StructInNestedNS { 126 o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) 127 if o != 0 { 128 x := o + rcv._tab.Pos 129 if obj == nil { 130 obj = new(NamespaceA__NamespaceB.StructInNestedNS) 131 } 132 obj.Init(rcv._tab.Bytes, x) 133 return obj 134 } 135 return nil 136} 137 138func TableInFirstNSStart(builder *flatbuffers.Builder) { 139 builder.StartObject(5) 140} 141func TableInFirstNSAddFooTable(builder *flatbuffers.Builder, fooTable flatbuffers.UOffsetT) { 142 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(fooTable), 0) 143} 144func TableInFirstNSAddFooEnum(builder *flatbuffers.Builder, fooEnum NamespaceA__NamespaceB.EnumInNestedNS) { 145 builder.PrependInt8Slot(1, int8(fooEnum), 0) 146} 147func TableInFirstNSAddFooUnionType(builder *flatbuffers.Builder, fooUnionType NamespaceA__NamespaceB.UnionInNestedNS) { 148 builder.PrependByteSlot(2, byte(fooUnionType), 0) 149} 150func TableInFirstNSAddFooUnion(builder *flatbuffers.Builder, fooUnion flatbuffers.UOffsetT) { 151 builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(fooUnion), 0) 152} 153func TableInFirstNSAddFooStruct(builder *flatbuffers.Builder, fooStruct flatbuffers.UOffsetT) { 154 builder.PrependStructSlot(4, flatbuffers.UOffsetT(fooStruct), 0) 155} 156func TableInFirstNSEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 157 return builder.EndObject() 158} 159