• 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_c;
5
6import 'dart:typed_data' show Uint8List;
7import 'package:flat_buffers/flat_buffers.dart' as fb;
8
9import './namespace_test2_namespace_a_generated.dart' as namespace_a;
10
11class TableInC {
12  TableInC._(this._bc, this._bcOffset);
13  factory TableInC(List<int> bytes) {
14    fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
15    return reader.read(rootRef, 0);
16  }
17
18  static const fb.Reader<TableInC> reader = const _TableInCReader();
19
20  final fb.BufferContext _bc;
21  final int _bcOffset;
22
23  namespace_a.TableInFirstNS get referToA1 => namespace_a.TableInFirstNS.reader.vTableGet(_bc, _bcOffset, 4, null);
24  namespace_a.SecondTableInA get referToA2 => namespace_a.SecondTableInA.reader.vTableGet(_bc, _bcOffset, 6, null);
25
26  @override
27  String toString() {
28    return 'TableInC{referToA1: $referToA1, referToA2: $referToA2}';
29  }
30}
31
32class _TableInCReader extends fb.TableReader<TableInC> {
33  const _TableInCReader();
34
35  @override
36  TableInC createObject(fb.BufferContext bc, int offset) =>
37    new TableInC._(bc, offset);
38}
39
40class TableInCBuilder {
41  TableInCBuilder(this.fbBuilder) {
42    assert(fbBuilder != null);
43  }
44
45  final fb.Builder fbBuilder;
46
47  void begin() {
48    fbBuilder.startTable();
49  }
50
51  int addReferToA1Offset(int offset) {
52    fbBuilder.addOffset(0, offset);
53    return fbBuilder.offset;
54  }
55  int addReferToA2Offset(int offset) {
56    fbBuilder.addOffset(1, offset);
57    return fbBuilder.offset;
58  }
59
60  int finish() {
61    return fbBuilder.endTable();
62  }
63}
64
65class TableInCObjectBuilder extends fb.ObjectBuilder {
66  final namespace_a.TableInFirstNSObjectBuilder _referToA1;
67  final namespace_a.SecondTableInAObjectBuilder _referToA2;
68
69  TableInCObjectBuilder({
70    namespace_a.TableInFirstNSObjectBuilder referToA1,
71    namespace_a.SecondTableInAObjectBuilder referToA2,
72  })
73      : _referToA1 = referToA1,
74        _referToA2 = referToA2;
75
76  /// Finish building, and store into the [fbBuilder].
77  @override
78  int finish(
79    fb.Builder fbBuilder) {
80    assert(fbBuilder != null);
81    final int referToA1Offset = _referToA1?.getOrCreateOffset(fbBuilder);
82    final int referToA2Offset = _referToA2?.getOrCreateOffset(fbBuilder);
83
84    fbBuilder.startTable();
85    if (referToA1Offset != null) {
86      fbBuilder.addOffset(0, referToA1Offset);
87    }
88    if (referToA2Offset != null) {
89      fbBuilder.addOffset(1, referToA2Offset);
90    }
91    return fbBuilder.endTable();
92  }
93
94  /// Convenience method to serialize to byte list.
95  @override
96  Uint8List toBytes([String fileIdentifier]) {
97    fb.Builder fbBuilder = new fb.Builder();
98    int offset = finish(fbBuilder);
99    return fbBuilder.finish(offset, fileIdentifier);
100  }
101}
102