File: StructOfStructsOfStructs.go

package info (click to toggle)
golang-github-google-flatbuffers 24.3.25-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 17,356 kB
  • sloc: cpp: 49,726; python: 6,901; cs: 5,566; java: 4,370; ansic: 2,512; php: 1,460; javascript: 1,053; xml: 1,016; sh: 870; makefile: 13
file content (67 lines) | stat: -rw-r--r-- 1,728 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Code generated by the FlatBuffers compiler. DO NOT EDIT.

package Example

import (
	flatbuffers "github.com/google/flatbuffers/go"
)

type StructOfStructsOfStructsT struct {
	A *StructOfStructsT `json:"a"`
}

func (t *StructOfStructsOfStructsT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	if t == nil {
		return 0
	}
	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)
}
func (rcv *StructOfStructsOfStructs) UnPackTo(t *StructOfStructsOfStructsT) {
	t.A = rcv.A(nil).UnPack()
}

func (rcv *StructOfStructsOfStructs) UnPack() *StructOfStructsOfStructsT {
	if rcv == nil {
		return nil
	}
	t := &StructOfStructsOfStructsT{}
	rcv.UnPackTo(t)
	return t
}

type StructOfStructsOfStructs struct {
	_tab flatbuffers.Struct
}

func (rcv *StructOfStructsOfStructs) Init(buf []byte, i flatbuffers.UOffsetT) {
	rcv._tab.Bytes = buf
	rcv._tab.Pos = i
}

func (rcv *StructOfStructsOfStructs) Table() flatbuffers.Table {
	return rcv._tab.Table
}

func (rcv *StructOfStructsOfStructs) A(obj *StructOfStructs) *StructOfStructs {
	if obj == nil {
		obj = new(StructOfStructs)
	}
	obj.Init(rcv._tab.Bytes, rcv._tab.Pos+0)
	return obj
}

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 {
	builder.Prep(4, 20)
	builder.Prep(4, 20)
	builder.Prep(4, 8)
	builder.PrependUint32(a_c_distance)
	builder.PrependUint32(a_c_id)
	builder.Prep(2, 4)
	builder.Pad(1)
	builder.PrependInt8(a_b_b)
	builder.PrependInt16(a_b_a)
	builder.Prep(4, 8)
	builder.PrependUint32(a_a_distance)
	builder.PrependUint32(a_a_id)
	return builder.Offset()
}