mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
The code generator was assuming all declarations for the current file sit in the same namepace. Now uses the "on demand" namespace switching we had for the forward declarations. Also fixed a bug related to namespace lookup. Change-Id: Ib54a3efbc752cbb9590302fa0707c0c73448db3d Tested: on Linux.
33 lines
912 B
Go
33 lines
912 B
Go
// automatically generated, do not modify
|
|
|
|
package NamespaceA
|
|
|
|
import (
|
|
flatbuffers "github.com/google/flatbuffers/go"
|
|
)
|
|
type SecondTableInA struct {
|
|
_tab flatbuffers.Table
|
|
}
|
|
|
|
func (rcv *SecondTableInA) Init(buf []byte, i flatbuffers.UOffsetT) {
|
|
rcv._tab.Bytes = buf
|
|
rcv._tab.Pos = i
|
|
}
|
|
|
|
func (rcv *SecondTableInA) ReferToC(obj *TableInC) *TableInC {
|
|
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
|
|
if o != 0 {
|
|
x := rcv._tab.Indirect(o + rcv._tab.Pos)
|
|
if obj == nil {
|
|
obj = new(TableInC)
|
|
}
|
|
obj.Init(rcv._tab.Bytes, x)
|
|
return obj
|
|
}
|
|
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() }
|