...

Source file src/github.com/google/flatbuffers/tests/MyGame/Example/StructOfStructsOfStructs.go

Documentation: github.com/google/flatbuffers/tests/MyGame/Example

     1  // Code generated by the FlatBuffers compiler. DO NOT EDIT.
     2  
     3  package Example
     4  
     5  import (
     6  	flatbuffers "github.com/google/flatbuffers/go"
     7  )
     8  
     9  type StructOfStructsOfStructsT struct {
    10  	A *StructOfStructsT `json:"a"`
    11  }
    12  
    13  func (t *StructOfStructsOfStructsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
    14  	if t == nil {
    15  		return 0
    16  	}
    17  	return CreateStructOfStructsOfStructs(builder, t.A.A.Id, t.A.A.Distance, t.A.B.A, t.A.B.B, t.A.C.Id, t.A.C.Distance)
    18  }
    19  func (rcv *StructOfStructsOfStructs) UnPackTo(t *StructOfStructsOfStructsT) {
    20  	t.A = rcv.A(nil).UnPack()
    21  }
    22  
    23  func (rcv *StructOfStructsOfStructs) UnPack() *StructOfStructsOfStructsT {
    24  	if rcv == nil {
    25  		return nil
    26  	}
    27  	t := &StructOfStructsOfStructsT{}
    28  	rcv.UnPackTo(t)
    29  	return t
    30  }
    31  
    32  type StructOfStructsOfStructs struct {
    33  	_tab flatbuffers.Struct
    34  }
    35  
    36  func (rcv *StructOfStructsOfStructs) Init(buf []byte, i flatbuffers.UOffsetT) {
    37  	rcv._tab.Bytes = buf
    38  	rcv._tab.Pos = i
    39  }
    40  
    41  func (rcv *StructOfStructsOfStructs) Table() flatbuffers.Table {
    42  	return rcv._tab.Table
    43  }
    44  
    45  func (rcv *StructOfStructsOfStructs) A(obj *StructOfStructs) *StructOfStructs {
    46  	if obj == nil {
    47  		obj = new(StructOfStructs)
    48  	}
    49  	obj.Init(rcv._tab.Bytes, rcv._tab.Pos+0)
    50  	return obj
    51  }
    52  
    53  func CreateStructOfStructsOfStructs(builder *flatbuffers.Builder, a_a_id uint32, a_a_distance uint32, a_b_a int16, a_b_b int8, a_c_id uint32, a_c_distance uint32) flatbuffers.UOffsetT {
    54  	builder.Prep(4, 20)
    55  	builder.Prep(4, 20)
    56  	builder.Prep(4, 8)
    57  	builder.PrependUint32(a_c_distance)
    58  	builder.PrependUint32(a_c_id)
    59  	builder.Prep(2, 4)
    60  	builder.Pad(1)
    61  	builder.PrependInt8(a_b_b)
    62  	builder.PrependInt16(a_b_a)
    63  	builder.Prep(4, 8)
    64  	builder.PrependUint32(a_a_distance)
    65  	builder.PrependUint32(a_a_id)
    66  	return builder.Offset()
    67  }
    68  

View as plain text