• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 UnionInNestedNSTypeId {
11  final int value;
12  const UnionInNestedNSTypeId._(this.value);
13
14  factory UnionInNestedNSTypeId.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 UnionInNestedNSTypeId');
18    }
19    return values[value];
20  }
21
22  static const int minValue = 0;
23  static const int maxValue = 1;
24  static bool containsValue(int value) => values.containsKey(value);
25
26  static const UnionInNestedNSTypeId NONE = const UnionInNestedNSTypeId._(0);
27  static const UnionInNestedNSTypeId TableInNestedNS = const UnionInNestedNSTypeId._(1);
28  static const Map<int,UnionInNestedNSTypeId> values = {0: NONE,1: TableInNestedNS,};
29
30  static const fb.Reader<UnionInNestedNSTypeId> reader = const _UnionInNestedNSTypeIdReader();
31
32  @override
33  String toString() {
34    return 'UnionInNestedNSTypeId{value: $value}';
35  }
36}
37
38class _UnionInNestedNSTypeIdReader extends fb.Reader<UnionInNestedNSTypeId> {
39  const _UnionInNestedNSTypeIdReader();
40
41  @override
42  int get size => 1;
43
44  @override
45  UnionInNestedNSTypeId read(fb.BufferContext bc, int offset) =>
46      new UnionInNestedNSTypeId.fromValue(const fb.Uint8Reader().read(bc, offset));
47}
48
49class EnumInNestedNS {
50  final int value;
51  const EnumInNestedNS._(this.value);
52
53  factory EnumInNestedNS.fromValue(int value) {
54    if (value == null) value = 0;
55    if (!values.containsKey(value)) {
56      throw new StateError('Invalid value $value for bit flag enum EnumInNestedNS');
57    }
58    return values[value];
59  }
60
61  static const int minValue = 0;
62  static const int maxValue = 2;
63  static bool containsValue(int value) => values.containsKey(value);
64
65  static const EnumInNestedNS A = const EnumInNestedNS._(0);
66  static const EnumInNestedNS B = const EnumInNestedNS._(1);
67  static const EnumInNestedNS C = const EnumInNestedNS._(2);
68  static const Map<int,EnumInNestedNS> values = {0: A,1: B,2: C,};
69
70  static const fb.Reader<EnumInNestedNS> reader = const _EnumInNestedNSReader();
71
72  @override
73  String toString() {
74    return 'EnumInNestedNS{value: $value}';
75  }
76}
77
78class _EnumInNestedNSReader extends fb.Reader<EnumInNestedNS> {
79  const _EnumInNestedNSReader();
80
81  @override
82  int get size => 1;
83
84  @override
85  EnumInNestedNS read(fb.BufferContext bc, int offset) =>
86      new EnumInNestedNS.fromValue(const fb.Int8Reader().read(bc, offset));
87}
88
89class TableInNestedNS {
90  TableInNestedNS._(this._bc, this._bcOffset);
91  factory TableInNestedNS(List<int> bytes) {
92    fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
93    return reader.read(rootRef, 0);
94  }
95
96  static const fb.Reader<TableInNestedNS> reader = const _TableInNestedNSReader();
97
98  final fb.BufferContext _bc;
99  final int _bcOffset;
100
101  int get foo => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 4, 0);
102
103  @override
104  String toString() {
105    return 'TableInNestedNS{foo: $foo}';
106  }
107}
108
109class _TableInNestedNSReader extends fb.TableReader<TableInNestedNS> {
110  const _TableInNestedNSReader();
111
112  @override
113  TableInNestedNS createObject(fb.BufferContext bc, int offset) =>
114    new TableInNestedNS._(bc, offset);
115}
116
117class TableInNestedNSBuilder {
118  TableInNestedNSBuilder(this.fbBuilder) {
119    assert(fbBuilder != null);
120  }
121
122  final fb.Builder fbBuilder;
123
124  void begin() {
125    fbBuilder.startTable();
126  }
127
128  int addFoo(int foo) {
129    fbBuilder.addInt32(0, foo);
130    return fbBuilder.offset;
131  }
132
133  int finish() {
134    return fbBuilder.endTable();
135  }
136}
137
138class TableInNestedNSObjectBuilder extends fb.ObjectBuilder {
139  final int _foo;
140
141  TableInNestedNSObjectBuilder({
142    int foo,
143  })
144      : _foo = foo;
145
146  /// Finish building, and store into the [fbBuilder].
147  @override
148  int finish(
149    fb.Builder fbBuilder) {
150    assert(fbBuilder != null);
151
152    fbBuilder.startTable();
153    fbBuilder.addInt32(0, _foo);
154    return fbBuilder.endTable();
155  }
156
157  /// Convenience method to serialize to byte list.
158  @override
159  Uint8List toBytes([String fileIdentifier]) {
160    fb.Builder fbBuilder = new fb.Builder();
161    int offset = finish(fbBuilder);
162    return fbBuilder.finish(offset, fileIdentifier);
163  }
164}
165class StructInNestedNS {
166  StructInNestedNS._(this._bc, this._bcOffset);
167
168  static const fb.Reader<StructInNestedNS> reader = const _StructInNestedNSReader();
169
170  final fb.BufferContext _bc;
171  final int _bcOffset;
172
173  int get a => const fb.Int32Reader().read(_bc, _bcOffset + 0);
174  int get b => const fb.Int32Reader().read(_bc, _bcOffset + 4);
175
176  @override
177  String toString() {
178    return 'StructInNestedNS{a: $a, b: $b}';
179  }
180}
181
182class _StructInNestedNSReader extends fb.StructReader<StructInNestedNS> {
183  const _StructInNestedNSReader();
184
185  @override
186  int get size => 8;
187
188  @override
189  StructInNestedNS createObject(fb.BufferContext bc, int offset) =>
190    new StructInNestedNS._(bc, offset);
191}
192
193class StructInNestedNSBuilder {
194  StructInNestedNSBuilder(this.fbBuilder) {
195    assert(fbBuilder != null);
196  }
197
198  final fb.Builder fbBuilder;
199
200  int finish(int a, int b) {
201    fbBuilder.putInt32(b);
202    fbBuilder.putInt32(a);
203    return fbBuilder.offset;
204  }
205
206}
207
208class StructInNestedNSObjectBuilder extends fb.ObjectBuilder {
209  final int _a;
210  final int _b;
211
212  StructInNestedNSObjectBuilder({
213    int a,
214    int b,
215  })
216      : _a = a,
217        _b = b;
218
219  /// Finish building, and store into the [fbBuilder].
220  @override
221  int finish(
222    fb.Builder fbBuilder) {
223    assert(fbBuilder != null);
224
225    fbBuilder.putInt32(_b);
226    fbBuilder.putInt32(_a);
227    return fbBuilder.offset;
228  }
229
230  /// Convenience method to serialize to byte list.
231  @override
232  Uint8List toBytes([String fileIdentifier]) {
233    fb.Builder fbBuilder = new fb.Builder();
234    int offset = finish(fbBuilder);
235    return fbBuilder.finish(offset, fileIdentifier);
236  }
237}
238