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; 5 6import 'dart:typed_data' show Uint8List; 7import 'package:flat_buffers/flat_buffers.dart' as fb; 8 9import './namespace_test2_namespace_c_generated.dart' as namespace_c; 10 11class TableInFirstNS { 12 TableInFirstNS._(this._bc, this._bcOffset); 13 factory TableInFirstNS(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<TableInFirstNS> reader = const _TableInFirstNSReader(); 19 20 final fb.BufferContext _bc; 21 final int _bcOffset; 22 23 namespace_a_namespace_b.TableInNestedNS get fooTable => namespace_a_namespace_b.TableInNestedNS.reader.vTableGet(_bc, _bcOffset, 4, null); 24 EnumInNestedNS get fooEnum => new EnumInNestedNS.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 6, 0)); 25 UnionInNestedNSTypeId get fooUnionType => new UnionInNestedNSTypeId.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 8, 0)); 26 dynamic get fooUnion { 27 switch (fooUnionType?.value) { 28 case 1: return TableInNestedNS.reader.vTableGet(_bc, _bcOffset, 10, null); 29 default: return null; 30 } 31 } 32 namespace_a_namespace_b.StructInNestedNS get fooStruct => namespace_a_namespace_b.StructInNestedNS.reader.vTableGet(_bc, _bcOffset, 12, null); 33 34 @override 35 String toString() { 36 return 'TableInFirstNS{fooTable: $fooTable, fooEnum: $fooEnum, fooUnionType: $fooUnionType, fooUnion: $fooUnion, fooStruct: $fooStruct}'; 37 } 38} 39 40class _TableInFirstNSReader extends fb.TableReader<TableInFirstNS> { 41 const _TableInFirstNSReader(); 42 43 @override 44 TableInFirstNS createObject(fb.BufferContext bc, int offset) => 45 new TableInFirstNS._(bc, offset); 46} 47 48class TableInFirstNSBuilder { 49 TableInFirstNSBuilder(this.fbBuilder) { 50 assert(fbBuilder != null); 51 } 52 53 final fb.Builder fbBuilder; 54 55 void begin() { 56 fbBuilder.startTable(); 57 } 58 59 int addFooTableOffset(int offset) { 60 fbBuilder.addOffset(0, offset); 61 return fbBuilder.offset; 62 } 63 int addFooEnum(EnumInNestedNS fooEnum) { 64 fbBuilder.addInt8(1, fooEnum?.value); 65 return fbBuilder.offset; 66 } 67 int addFooUnionType(UnionInNestedNSTypeId fooUnionType) { 68 fbBuilder.addUint8(2, fooUnionType?.value); 69 return fbBuilder.offset; 70 } 71 int addFooUnionOffset(int offset) { 72 fbBuilder.addOffset(3, offset); 73 return fbBuilder.offset; 74 } 75 int addFooStruct(int offset) { 76 fbBuilder.addStruct(4, offset); 77 return fbBuilder.offset; 78 } 79 80 int finish() { 81 return fbBuilder.endTable(); 82 } 83} 84 85class TableInFirstNSObjectBuilder extends fb.ObjectBuilder { 86 final namespace_a_namespace_b.TableInNestedNSObjectBuilder _fooTable; 87 final EnumInNestedNS _fooEnum; 88 final UnionInNestedNSTypeId _fooUnionType; 89 final dynamic _fooUnion; 90 final namespace_a_namespace_b.StructInNestedNSObjectBuilder _fooStruct; 91 92 TableInFirstNSObjectBuilder({ 93 namespace_a_namespace_b.TableInNestedNSObjectBuilder fooTable, 94 EnumInNestedNS fooEnum, 95 UnionInNestedNSTypeId fooUnionType, 96 dynamic fooUnion, 97 namespace_a_namespace_b.StructInNestedNSObjectBuilder fooStruct, 98 }) 99 : _fooTable = fooTable, 100 _fooEnum = fooEnum, 101 _fooUnionType = fooUnionType, 102 _fooUnion = fooUnion, 103 _fooStruct = fooStruct; 104 105 /// Finish building, and store into the [fbBuilder]. 106 @override 107 int finish( 108 fb.Builder fbBuilder) { 109 assert(fbBuilder != null); 110 final int fooTableOffset = _fooTable?.getOrCreateOffset(fbBuilder); 111 final int fooUnionOffset = _fooUnion?.getOrCreateOffset(fbBuilder); 112 113 fbBuilder.startTable(); 114 if (fooTableOffset != null) { 115 fbBuilder.addOffset(0, fooTableOffset); 116 } 117 fbBuilder.addInt8(1, _fooEnum?.value); 118 fbBuilder.addUint8(2, _fooUnionType?.value); 119 if (fooUnionOffset != null) { 120 fbBuilder.addOffset(3, fooUnionOffset); 121 } 122 if (_fooStruct != null) { 123 fbBuilder.addStruct(4, _fooStruct.finish(fbBuilder)); 124 } 125 return fbBuilder.endTable(); 126 } 127 128 /// Convenience method to serialize to byte list. 129 @override 130 Uint8List toBytes([String fileIdentifier]) { 131 fb.Builder fbBuilder = new fb.Builder(); 132 int offset = finish(fbBuilder); 133 return fbBuilder.finish(offset, fileIdentifier); 134 } 135} 136class SecondTableInA { 137 SecondTableInA._(this._bc, this._bcOffset); 138 factory SecondTableInA(List<int> bytes) { 139 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); 140 return reader.read(rootRef, 0); 141 } 142 143 static const fb.Reader<SecondTableInA> reader = const _SecondTableInAReader(); 144 145 final fb.BufferContext _bc; 146 final int _bcOffset; 147 148 namespace_c.TableInC get referToC => namespace_c.TableInC.reader.vTableGet(_bc, _bcOffset, 4, null); 149 150 @override 151 String toString() { 152 return 'SecondTableInA{referToC: $referToC}'; 153 } 154} 155 156class _SecondTableInAReader extends fb.TableReader<SecondTableInA> { 157 const _SecondTableInAReader(); 158 159 @override 160 SecondTableInA createObject(fb.BufferContext bc, int offset) => 161 new SecondTableInA._(bc, offset); 162} 163 164class SecondTableInABuilder { 165 SecondTableInABuilder(this.fbBuilder) { 166 assert(fbBuilder != null); 167 } 168 169 final fb.Builder fbBuilder; 170 171 void begin() { 172 fbBuilder.startTable(); 173 } 174 175 int addReferToCOffset(int offset) { 176 fbBuilder.addOffset(0, offset); 177 return fbBuilder.offset; 178 } 179 180 int finish() { 181 return fbBuilder.endTable(); 182 } 183} 184 185class SecondTableInAObjectBuilder extends fb.ObjectBuilder { 186 final namespace_c.TableInCObjectBuilder _referToC; 187 188 SecondTableInAObjectBuilder({ 189 namespace_c.TableInCObjectBuilder referToC, 190 }) 191 : _referToC = referToC; 192 193 /// Finish building, and store into the [fbBuilder]. 194 @override 195 int finish( 196 fb.Builder fbBuilder) { 197 assert(fbBuilder != null); 198 final int referToCOffset = _referToC?.getOrCreateOffset(fbBuilder); 199 200 fbBuilder.startTable(); 201 if (referToCOffset != null) { 202 fbBuilder.addOffset(0, referToCOffset); 203 } 204 return fbBuilder.endTable(); 205 } 206 207 /// Convenience method to serialize to byte list. 208 @override 209 Uint8List toBytes([String fileIdentifier]) { 210 fb.Builder fbBuilder = new fb.Builder(); 211 int offset = finish(fbBuilder); 212 return fbBuilder.finish(offset, fileIdentifier); 213 } 214} 215