• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// automatically generated by the FlatBuffers compiler, do not modify
2
3import * as NS8755221360535654258 from "./namespace_test1_generated";
4/**
5 * @constructor
6 */
7export namespace NamespaceA{
8export class TableInFirstNS {
9  bb: flatbuffers.ByteBuffer|null = null;
10
11  bb_pos:number = 0;
12/**
13 * @param number i
14 * @param flatbuffers.ByteBuffer bb
15 * @returns TableInFirstNS
16 */
17__init(i:number, bb:flatbuffers.ByteBuffer):TableInFirstNS {
18  this.bb_pos = i;
19  this.bb = bb;
20  return this;
21};
22
23/**
24 * @param flatbuffers.ByteBuffer bb
25 * @param TableInFirstNS= obj
26 * @returns TableInFirstNS
27 */
28static getRootAsTableInFirstNS(bb:flatbuffers.ByteBuffer, obj?:TableInFirstNS):TableInFirstNS {
29  return (obj || new TableInFirstNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
30};
31
32/**
33 * @param NamespaceA.NamespaceB.TableInNestedNS= obj
34 * @returns NamespaceA.NamespaceB.TableInNestedNS|null
35 */
36fooTable(obj?:NS8755221360535654258.NamespaceA.NamespaceB.TableInNestedNS):NS8755221360535654258.NamespaceA.NamespaceB.TableInNestedNS|null {
37  var offset = this.bb!.__offset(this.bb_pos, 4);
38  return offset ? (obj || new NS8755221360535654258.NamespaceA.NamespaceB.TableInNestedNS).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
39};
40
41/**
42 * @returns NamespaceA.NamespaceB.EnumInNestedNS
43 */
44fooEnum():NS8755221360535654258.NamespaceA.NamespaceB.EnumInNestedNS {
45  var offset = this.bb!.__offset(this.bb_pos, 6);
46  return offset ? /**  */ (this.bb!.readInt8(this.bb_pos + offset)) : NS8755221360535654258.NamespaceA.NamespaceB.EnumInNestedNS.A;
47};
48
49/**
50 * @param NamespaceA.NamespaceB.EnumInNestedNS value
51 * @returns boolean
52 */
53mutate_foo_enum(value:NS8755221360535654258.NamespaceA.NamespaceB.EnumInNestedNS):boolean {
54  var offset = this.bb!.__offset(this.bb_pos, 6);
55
56  if (offset === 0) {
57    return false;
58  }
59
60  this.bb!.writeInt8(this.bb_pos + offset, value);
61  return true;
62};
63
64/**
65 * @param NamespaceA.NamespaceB.StructInNestedNS= obj
66 * @returns NamespaceA.NamespaceB.StructInNestedNS|null
67 */
68fooStruct(obj?:NS8755221360535654258.NamespaceA.NamespaceB.StructInNestedNS):NS8755221360535654258.NamespaceA.NamespaceB.StructInNestedNS|null {
69  var offset = this.bb!.__offset(this.bb_pos, 8);
70  return offset ? (obj || new NS8755221360535654258.NamespaceA.NamespaceB.StructInNestedNS).__init(this.bb_pos + offset, this.bb!) : null;
71};
72
73/**
74 * @param flatbuffers.Builder builder
75 */
76static startTableInFirstNS(builder:flatbuffers.Builder) {
77  builder.startObject(3);
78};
79
80/**
81 * @param flatbuffers.Builder builder
82 * @param flatbuffers.Offset fooTableOffset
83 */
84static addFooTable(builder:flatbuffers.Builder, fooTableOffset:flatbuffers.Offset) {
85  builder.addFieldOffset(0, fooTableOffset, 0);
86};
87
88/**
89 * @param flatbuffers.Builder builder
90 * @param NamespaceA.NamespaceB.EnumInNestedNS fooEnum
91 */
92static addFooEnum(builder:flatbuffers.Builder, fooEnum:NS8755221360535654258.NamespaceA.NamespaceB.EnumInNestedNS) {
93  builder.addFieldInt8(1, fooEnum, NS8755221360535654258.NamespaceA.NamespaceB.EnumInNestedNS.A);
94};
95
96/**
97 * @param flatbuffers.Builder builder
98 * @param flatbuffers.Offset fooStructOffset
99 */
100static addFooStruct(builder:flatbuffers.Builder, fooStructOffset:flatbuffers.Offset) {
101  builder.addFieldStruct(2, fooStructOffset, 0);
102};
103
104/**
105 * @param flatbuffers.Builder builder
106 * @returns flatbuffers.Offset
107 */
108static endTableInFirstNS(builder:flatbuffers.Builder):flatbuffers.Offset {
109  var offset = builder.endObject();
110  return offset;
111};
112
113static createTableInFirstNS(builder:flatbuffers.Builder, fooTableOffset:flatbuffers.Offset, fooEnum:NS8755221360535654258.NamespaceA.NamespaceB.EnumInNestedNS, fooStructOffset:flatbuffers.Offset):flatbuffers.Offset {
114  TableInFirstNS.startTableInFirstNS(builder);
115  TableInFirstNS.addFooTable(builder, fooTableOffset);
116  TableInFirstNS.addFooEnum(builder, fooEnum);
117  TableInFirstNS.addFooStruct(builder, fooStructOffset);
118  return TableInFirstNS.endTableInFirstNS(builder);
119}
120}
121}
122/**
123 * @constructor
124 */
125export namespace NamespaceC{
126export class TableInC {
127  bb: flatbuffers.ByteBuffer|null = null;
128
129  bb_pos:number = 0;
130/**
131 * @param number i
132 * @param flatbuffers.ByteBuffer bb
133 * @returns TableInC
134 */
135__init(i:number, bb:flatbuffers.ByteBuffer):TableInC {
136  this.bb_pos = i;
137  this.bb = bb;
138  return this;
139};
140
141/**
142 * @param flatbuffers.ByteBuffer bb
143 * @param TableInC= obj
144 * @returns TableInC
145 */
146static getRootAsTableInC(bb:flatbuffers.ByteBuffer, obj?:TableInC):TableInC {
147  return (obj || new TableInC).__init(bb.readInt32(bb.position()) + bb.position(), bb);
148};
149
150/**
151 * @param NamespaceA.TableInFirstNS= obj
152 * @returns NamespaceA.TableInFirstNS|null
153 */
154referToA1(obj?:NamespaceA.TableInFirstNS):NamespaceA.TableInFirstNS|null {
155  var offset = this.bb!.__offset(this.bb_pos, 4);
156  return offset ? (obj || new NamespaceA.TableInFirstNS).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
157};
158
159/**
160 * @param NamespaceA.SecondTableInA= obj
161 * @returns NamespaceA.SecondTableInA|null
162 */
163referToA2(obj?:NamespaceA.SecondTableInA):NamespaceA.SecondTableInA|null {
164  var offset = this.bb!.__offset(this.bb_pos, 6);
165  return offset ? (obj || new NamespaceA.SecondTableInA).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
166};
167
168/**
169 * @param flatbuffers.Builder builder
170 */
171static startTableInC(builder:flatbuffers.Builder) {
172  builder.startObject(2);
173};
174
175/**
176 * @param flatbuffers.Builder builder
177 * @param flatbuffers.Offset referToA1Offset
178 */
179static addReferToA1(builder:flatbuffers.Builder, referToA1Offset:flatbuffers.Offset) {
180  builder.addFieldOffset(0, referToA1Offset, 0);
181};
182
183/**
184 * @param flatbuffers.Builder builder
185 * @param flatbuffers.Offset referToA2Offset
186 */
187static addReferToA2(builder:flatbuffers.Builder, referToA2Offset:flatbuffers.Offset) {
188  builder.addFieldOffset(1, referToA2Offset, 0);
189};
190
191/**
192 * @param flatbuffers.Builder builder
193 * @returns flatbuffers.Offset
194 */
195static endTableInC(builder:flatbuffers.Builder):flatbuffers.Offset {
196  var offset = builder.endObject();
197  return offset;
198};
199
200static createTableInC(builder:flatbuffers.Builder, referToA1Offset:flatbuffers.Offset, referToA2Offset:flatbuffers.Offset):flatbuffers.Offset {
201  TableInC.startTableInC(builder);
202  TableInC.addReferToA1(builder, referToA1Offset);
203  TableInC.addReferToA2(builder, referToA2Offset);
204  return TableInC.endTableInC(builder);
205}
206}
207}
208/**
209 * @constructor
210 */
211export namespace NamespaceA{
212export class SecondTableInA {
213  bb: flatbuffers.ByteBuffer|null = null;
214
215  bb_pos:number = 0;
216/**
217 * @param number i
218 * @param flatbuffers.ByteBuffer bb
219 * @returns SecondTableInA
220 */
221__init(i:number, bb:flatbuffers.ByteBuffer):SecondTableInA {
222  this.bb_pos = i;
223  this.bb = bb;
224  return this;
225};
226
227/**
228 * @param flatbuffers.ByteBuffer bb
229 * @param SecondTableInA= obj
230 * @returns SecondTableInA
231 */
232static getRootAsSecondTableInA(bb:flatbuffers.ByteBuffer, obj?:SecondTableInA):SecondTableInA {
233  return (obj || new SecondTableInA).__init(bb.readInt32(bb.position()) + bb.position(), bb);
234};
235
236/**
237 * @param NamespaceC.TableInC= obj
238 * @returns NamespaceC.TableInC|null
239 */
240referToC(obj?:NamespaceC.TableInC):NamespaceC.TableInC|null {
241  var offset = this.bb!.__offset(this.bb_pos, 4);
242  return offset ? (obj || new NamespaceC.TableInC).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
243};
244
245/**
246 * @param flatbuffers.Builder builder
247 */
248static startSecondTableInA(builder:flatbuffers.Builder) {
249  builder.startObject(1);
250};
251
252/**
253 * @param flatbuffers.Builder builder
254 * @param flatbuffers.Offset referToCOffset
255 */
256static addReferToC(builder:flatbuffers.Builder, referToCOffset:flatbuffers.Offset) {
257  builder.addFieldOffset(0, referToCOffset, 0);
258};
259
260/**
261 * @param flatbuffers.Builder builder
262 * @returns flatbuffers.Offset
263 */
264static endSecondTableInA(builder:flatbuffers.Builder):flatbuffers.Offset {
265  var offset = builder.endObject();
266  return offset;
267};
268
269static createSecondTableInA(builder:flatbuffers.Builder, referToCOffset:flatbuffers.Offset):flatbuffers.Offset {
270  SecondTableInA.startSecondTableInA(builder);
271  SecondTableInA.addReferToC(builder, referToCOffset);
272  return SecondTableInA.endSecondTableInA(builder);
273}
274}
275}
276