1 // <auto-generated> 2 // automatically generated by the FlatBuffers compiler, do not modify 3 // </auto-generated> 4 5 namespace NamespaceA 6 { 7 8 using global::System; 9 using global::System.Collections.Generic; 10 using global::FlatBuffers; 11 12 public struct TableInFirstNS : IFlatbufferObject 13 { 14 private Table __p; 15 public ByteBuffer ByteBuffer { get { return __p.bb; } } ValidateVersionNamespaceA.TableInFirstNS16 public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_2_0_0(); } GetRootAsTableInFirstNSNamespaceA.TableInFirstNS17 public static TableInFirstNS GetRootAsTableInFirstNS(ByteBuffer _bb) { return GetRootAsTableInFirstNS(_bb, new TableInFirstNS()); } GetRootAsTableInFirstNSNamespaceA.TableInFirstNS18 public static TableInFirstNS GetRootAsTableInFirstNS(ByteBuffer _bb, TableInFirstNS obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } __initNamespaceA.TableInFirstNS19 public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } __assignNamespaceA.TableInFirstNS20 public TableInFirstNS __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } 21 22 public NamespaceA.NamespaceB.TableInNestedNS? FooTable { get { int o = __p.__offset(4); return o != 0 ? (NamespaceA.NamespaceB.TableInNestedNS?)(new NamespaceA.NamespaceB.TableInNestedNS()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } } 23 public NamespaceA.NamespaceB.EnumInNestedNS FooEnum { get { int o = __p.__offset(6); return o != 0 ? (NamespaceA.NamespaceB.EnumInNestedNS)__p.bb.GetSbyte(o + __p.bb_pos) : NamespaceA.NamespaceB.EnumInNestedNS.A; } } MutateFooEnumNamespaceA.TableInFirstNS24 public bool MutateFooEnum(NamespaceA.NamespaceB.EnumInNestedNS foo_enum) { int o = __p.__offset(6); if (o != 0) { __p.bb.PutSbyte(o + __p.bb_pos, (sbyte)foo_enum); return true; } else { return false; } } 25 public NamespaceA.NamespaceB.UnionInNestedNS FooUnionType { get { int o = __p.__offset(8); return o != 0 ? (NamespaceA.NamespaceB.UnionInNestedNS)__p.bb.Get(o + __p.bb_pos) : NamespaceA.NamespaceB.UnionInNestedNS.NONE; } } 26 public TTable? FooUnion<TTable>() where TTable : struct, IFlatbufferObject { int o = __p.__offset(10); return o != 0 ? (TTable?)__p.__union<TTable>(o + __p.bb_pos) : null; } FooUnionAsTableInNestedNSNamespaceA.TableInFirstNS27 public NamespaceA.NamespaceB.TableInNestedNS FooUnionAsTableInNestedNS() { return FooUnion<NamespaceA.NamespaceB.TableInNestedNS>().Value; } 28 public NamespaceA.NamespaceB.StructInNestedNS? FooStruct { get { int o = __p.__offset(12); return o != 0 ? (NamespaceA.NamespaceB.StructInNestedNS?)(new NamespaceA.NamespaceB.StructInNestedNS()).__assign(o + __p.bb_pos, __p.bb) : null; } } 29 CreateTableInFirstNSNamespaceA.TableInFirstNS30 public static Offset<NamespaceA.TableInFirstNS> CreateTableInFirstNS(FlatBufferBuilder builder, 31 Offset<NamespaceA.NamespaceB.TableInNestedNS> foo_tableOffset = default(Offset<NamespaceA.NamespaceB.TableInNestedNS>), 32 NamespaceA.NamespaceB.EnumInNestedNS foo_enum = NamespaceA.NamespaceB.EnumInNestedNS.A, 33 NamespaceA.NamespaceB.UnionInNestedNS foo_union_type = NamespaceA.NamespaceB.UnionInNestedNS.NONE, 34 int foo_unionOffset = 0, 35 NamespaceA.NamespaceB.StructInNestedNST foo_struct = null) { 36 builder.StartTable(5); 37 TableInFirstNS.AddFooStruct(builder, NamespaceA.NamespaceB.StructInNestedNS.Pack(builder, foo_struct)); 38 TableInFirstNS.AddFooUnion(builder, foo_unionOffset); 39 TableInFirstNS.AddFooTable(builder, foo_tableOffset); 40 TableInFirstNS.AddFooUnionType(builder, foo_union_type); 41 TableInFirstNS.AddFooEnum(builder, foo_enum); 42 return TableInFirstNS.EndTableInFirstNS(builder); 43 } 44 StartTableInFirstNSNamespaceA.TableInFirstNS45 public static void StartTableInFirstNS(FlatBufferBuilder builder) { builder.StartTable(5); } AddFooTableNamespaceA.TableInFirstNS46 public static void AddFooTable(FlatBufferBuilder builder, Offset<NamespaceA.NamespaceB.TableInNestedNS> fooTableOffset) { builder.AddOffset(0, fooTableOffset.Value, 0); } AddFooEnumNamespaceA.TableInFirstNS47 public static void AddFooEnum(FlatBufferBuilder builder, NamespaceA.NamespaceB.EnumInNestedNS fooEnum) { builder.AddSbyte(1, (sbyte)fooEnum, 0); } AddFooUnionTypeNamespaceA.TableInFirstNS48 public static void AddFooUnionType(FlatBufferBuilder builder, NamespaceA.NamespaceB.UnionInNestedNS fooUnionType) { builder.AddByte(2, (byte)fooUnionType, 0); } AddFooUnionNamespaceA.TableInFirstNS49 public static void AddFooUnion(FlatBufferBuilder builder, int fooUnionOffset) { builder.AddOffset(3, fooUnionOffset, 0); } AddFooStructNamespaceA.TableInFirstNS50 public static void AddFooStruct(FlatBufferBuilder builder, Offset<NamespaceA.NamespaceB.StructInNestedNS> fooStructOffset) { builder.AddStruct(4, fooStructOffset.Value, 0); } EndTableInFirstNSNamespaceA.TableInFirstNS51 public static Offset<NamespaceA.TableInFirstNS> EndTableInFirstNS(FlatBufferBuilder builder) { 52 int o = builder.EndTable(); 53 return new Offset<NamespaceA.TableInFirstNS>(o); 54 } UnPackNamespaceA.TableInFirstNS55 public TableInFirstNST UnPack() { 56 var _o = new TableInFirstNST(); 57 this.UnPackTo(_o); 58 return _o; 59 } UnPackToNamespaceA.TableInFirstNS60 public void UnPackTo(TableInFirstNST _o) { 61 _o.FooTable = this.FooTable.HasValue ? this.FooTable.Value.UnPack() : null; 62 _o.FooEnum = this.FooEnum; 63 _o.FooUnion = new NamespaceA.NamespaceB.UnionInNestedNSUnion(); 64 _o.FooUnion.Type = this.FooUnionType; 65 switch (this.FooUnionType) { 66 default: break; 67 case NamespaceA.NamespaceB.UnionInNestedNS.TableInNestedNS: 68 _o.FooUnion.Value = this.FooUnion<NamespaceA.NamespaceB.TableInNestedNS>().HasValue ? this.FooUnion<NamespaceA.NamespaceB.TableInNestedNS>().Value.UnPack() : null; 69 break; 70 } 71 _o.FooStruct = this.FooStruct.HasValue ? this.FooStruct.Value.UnPack() : null; 72 } PackNamespaceA.TableInFirstNS73 public static Offset<NamespaceA.TableInFirstNS> Pack(FlatBufferBuilder builder, TableInFirstNST _o) { 74 if (_o == null) return default(Offset<NamespaceA.TableInFirstNS>); 75 var _foo_table = _o.FooTable == null ? default(Offset<NamespaceA.NamespaceB.TableInNestedNS>) : NamespaceA.NamespaceB.TableInNestedNS.Pack(builder, _o.FooTable); 76 var _foo_union_type = _o.FooUnion == null ? NamespaceA.NamespaceB.UnionInNestedNS.NONE : _o.FooUnion.Type; 77 var _foo_union = _o.FooUnion == null ? 0 : NamespaceA.NamespaceB.UnionInNestedNSUnion.Pack(builder, _o.FooUnion); 78 return CreateTableInFirstNS( 79 builder, 80 _foo_table, 81 _o.FooEnum, 82 _foo_union_type, 83 _foo_union, 84 _o.FooStruct); 85 } 86 }; 87 88 public class TableInFirstNST 89 { 90 [Newtonsoft.Json.JsonProperty("foo_table")] 91 public NamespaceA.NamespaceB.TableInNestedNST FooTable { get; set; } 92 [Newtonsoft.Json.JsonProperty("foo_enum")] 93 public NamespaceA.NamespaceB.EnumInNestedNS FooEnum { get; set; } 94 [Newtonsoft.Json.JsonProperty("foo_union_type")] 95 private NamespaceA.NamespaceB.UnionInNestedNS FooUnionType { 96 get { 97 return this.FooUnion != null ? this.FooUnion.Type : NamespaceA.NamespaceB.UnionInNestedNS.NONE; 98 } 99 set { 100 this.FooUnion = new NamespaceA.NamespaceB.UnionInNestedNSUnion(); 101 this.FooUnion.Type = value; 102 } 103 } 104 [Newtonsoft.Json.JsonProperty("foo_union")] 105 [Newtonsoft.Json.JsonConverter(typeof(NamespaceA.NamespaceB.UnionInNestedNSUnion_JsonConverter))] 106 public NamespaceA.NamespaceB.UnionInNestedNSUnion FooUnion { get; set; } 107 [Newtonsoft.Json.JsonProperty("foo_struct")] 108 public NamespaceA.NamespaceB.StructInNestedNST FooStruct { get; set; } 109 TableInFirstNST()110 public TableInFirstNST() { 111 this.FooTable = null; 112 this.FooEnum = NamespaceA.NamespaceB.EnumInNestedNS.A; 113 this.FooUnion = null; 114 this.FooStruct = new NamespaceA.NamespaceB.StructInNestedNST(); 115 } 116 } 117 118 119 } 120