1// automatically generated by the FlatBuffers compiler, do not modify
2// ignore_for_file: unused_import, unused_field, unused_local_variable
3
4library namespace_a.namespace_b;
5
6import 'dart:typed_data' show Uint8List;
7import 'package:flat_buffers/flat_buffers.dart' as fb;
8
9
10class EnumInNestedNS {
11  final int value;
12  const EnumInNestedNS._(this.value);
13
14  factory EnumInNestedNS.fromValue(int value) {
15    if (value == null) value = 0;
16    if (!values.containsKey(value)) {
17      throw new StateError('Invalid value $value for bit flag enum EnumInNestedNS');
18    }
19    return values[value];
20  }
21
22  static const int minValue = 0;
23  static const int maxValue = 2;
24  static bool containsValue(int value) => values.containsKey(value);
25
26  static const EnumInNestedNS A = const EnumInNestedNS._(0);
27  static const EnumInNestedNS B = const EnumInNestedNS._(1);
28  static const EnumInNestedNS C = const EnumInNestedNS._(2);
29  static get values => {0: A,1: B,2: C,};
30
31  static const fb.Reader<EnumInNestedNS> reader = const _EnumInNestedNSReader();
32
33  @override
34  String toString() {
35    return 'EnumInNestedNS{value: $value}';
36  }
37}
38
39class _EnumInNestedNSReader extends fb.Reader<EnumInNestedNS> {
40  const _EnumInNestedNSReader();
41
42  @override
43  int get size => 1;
44
45  @override
46  EnumInNestedNS read(fb.BufferContext bc, int offset) =>
47      new EnumInNestedNS.fromValue(const fb.Int8Reader().read(bc, offset));
48}
49
50class TableInNestedNS {
51  TableInNestedNS._(this._bc, this._bcOffset);
52  factory TableInNestedNS(List<int> bytes) {
53    fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
54    return reader.read(rootRef, 0);
55  }
56
57  static const fb.Reader<TableInNestedNS> reader = const _TableInNestedNSReader();
58
59  final fb.BufferContext _bc;
60  final int _bcOffset;
61
62  int get foo => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 4, 0);
63
64  @override
65  String toString() {
66    return 'TableInNestedNS{foo: $foo}';
67  }
68}
69
70class _TableInNestedNSReader extends fb.TableReader<TableInNestedNS> {
71  const _TableInNestedNSReader();
72
73  @override
74  TableInNestedNS createObject(fb.BufferContext bc, int offset) =>
75    new TableInNestedNS._(bc, offset);
76}
77
78class TableInNestedNSBuilder {
79  TableInNestedNSBuilder(this.fbBuilder) {
80    assert(fbBuilder != null);
81  }
82
83  final fb.Builder fbBuilder;
84
85  void begin() {
86    fbBuilder.startTable();
87  }
88
89  int addFoo(int foo) {
90    fbBuilder.addInt32(0, foo);
91    return fbBuilder.offset;
92  }
93
94  int finish() {
95    return fbBuilder.endTable();
96  }
97}
98
99class TableInNestedNSObjectBuilder extends fb.ObjectBuilder {
100  final int _foo;
101
102  TableInNestedNSObjectBuilder({
103    int foo,
104  })
105      : _foo = foo;
106
107  /// Finish building, and store into the [fbBuilder].
108  @override
109  int finish(
110    fb.Builder fbBuilder) {
111    assert(fbBuilder != null);
112
113    fbBuilder.startTable();
114    fbBuilder.addInt32(0, _foo);
115    return fbBuilder.endTable();
116  }
117
118  /// Convenience method to serialize to byte list.
119  @override
120  Uint8List toBytes([String fileIdentifier]) {
121    fb.Builder fbBuilder = new fb.Builder();
122    int offset = finish(fbBuilder);
123    return fbBuilder.finish(offset, fileIdentifier);
124  }
125}
126class StructInNestedNS {
127  StructInNestedNS._(this._bc, this._bcOffset);
128
129  static const fb.Reader<StructInNestedNS> reader = const _StructInNestedNSReader();
130
131  final fb.BufferContext _bc;
132  final int _bcOffset;
133
134  int get a => const fb.Int32Reader().read(_bc, _bcOffset + 0);
135  int get b => const fb.Int32Reader().read(_bc, _bcOffset + 4);
136
137  @override
138  String toString() {
139    return 'StructInNestedNS{a: $a, b: $b}';
140  }
141}
142
143class _StructInNestedNSReader extends fb.StructReader<StructInNestedNS> {
144  const _StructInNestedNSReader();
145
146  @override
147  int get size => 8;
148
149  @override
150  StructInNestedNS createObject(fb.BufferContext bc, int offset) =>
151    new StructInNestedNS._(bc, offset);
152}
153
154class StructInNestedNSBuilder {
155  StructInNestedNSBuilder(this.fbBuilder) {
156    assert(fbBuilder != null);
157  }
158
159  final fb.Builder fbBuilder;
160
161  int finish(int a, int b) {
162    fbBuilder.putInt32(b);
163    fbBuilder.putInt32(a);
164    return fbBuilder.offset;
165  }
166
167}
168
169class StructInNestedNSObjectBuilder extends fb.ObjectBuilder {
170  final int _a;
171  final int _b;
172
173  StructInNestedNSObjectBuilder({
174    int a,
175    int b,
176  })
177      : _a = a,
178        _b = b;
179
180  /// Finish building, and store into the [fbBuilder].
181  @override
182  int finish(
183    fb.Builder fbBuilder) {
184    assert(fbBuilder != null);
185
186    fbBuilder.putInt32(_b);
187    fbBuilder.putInt32(_a);
188    return fbBuilder.offset;
189  }
190
191  /// Convenience method to serialize to byte list.
192  @override
193  Uint8List toBytes([String fileIdentifier]) {
194    fb.Builder fbBuilder = new fb.Builder();
195    int offset = finish(fbBuilder);
196    return fbBuilder.finish(offset, fileIdentifier);
197  }
198}
199