Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 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; |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 9 | using global::System.Collections.Generic; |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 10 | using global::FlatBuffers; |
| 11 | |
| 12 | public struct TableInFirstNS : IFlatbufferObject |
| 13 | { |
| 14 | private Table __p; |
| 15 | public ByteBuffer ByteBuffer { get { return __p.bb; } } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 16 | public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_2_0_0(); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 17 | public static TableInFirstNS GetRootAsTableInFirstNS(ByteBuffer _bb) { return GetRootAsTableInFirstNS(_bb, new TableInFirstNS()); } |
| 18 | public static TableInFirstNS GetRootAsTableInFirstNS(ByteBuffer _bb, TableInFirstNS obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } |
| 19 | public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } |
| 20 | 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; } } |
| 24 | 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; } } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 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; } |
| 27 | 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; } } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 29 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 30 | 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, |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 33 | NamespaceA.NamespaceB.UnionInNestedNS foo_union_type = NamespaceA.NamespaceB.UnionInNestedNS.NONE, |
| 34 | int foo_unionOffset = 0, |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 35 | NamespaceA.NamespaceB.StructInNestedNST foo_struct = null) { |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 36 | builder.StartTable(5); |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 37 | TableInFirstNS.AddFooStruct(builder, NamespaceA.NamespaceB.StructInNestedNS.Pack(builder, foo_struct)); |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 38 | TableInFirstNS.AddFooUnion(builder, foo_unionOffset); |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 39 | TableInFirstNS.AddFooTable(builder, foo_tableOffset); |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 40 | TableInFirstNS.AddFooUnionType(builder, foo_union_type); |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 41 | TableInFirstNS.AddFooEnum(builder, foo_enum); |
| 42 | return TableInFirstNS.EndTableInFirstNS(builder); |
| 43 | } |
| 44 | |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 45 | public static void StartTableInFirstNS(FlatBufferBuilder builder) { builder.StartTable(5); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 46 | public static void AddFooTable(FlatBufferBuilder builder, Offset<NamespaceA.NamespaceB.TableInNestedNS> fooTableOffset) { builder.AddOffset(0, fooTableOffset.Value, 0); } |
| 47 | public static void AddFooEnum(FlatBufferBuilder builder, NamespaceA.NamespaceB.EnumInNestedNS fooEnum) { builder.AddSbyte(1, (sbyte)fooEnum, 0); } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 48 | public static void AddFooUnionType(FlatBufferBuilder builder, NamespaceA.NamespaceB.UnionInNestedNS fooUnionType) { builder.AddByte(2, (byte)fooUnionType, 0); } |
| 49 | public static void AddFooUnion(FlatBufferBuilder builder, int fooUnionOffset) { builder.AddOffset(3, fooUnionOffset, 0); } |
| 50 | public static void AddFooStruct(FlatBufferBuilder builder, Offset<NamespaceA.NamespaceB.StructInNestedNS> fooStructOffset) { builder.AddStruct(4, fooStructOffset.Value, 0); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 51 | public static Offset<NamespaceA.TableInFirstNS> EndTableInFirstNS(FlatBufferBuilder builder) { |
| 52 | int o = builder.EndTable(); |
| 53 | return new Offset<NamespaceA.TableInFirstNS>(o); |
| 54 | } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 55 | public TableInFirstNST UnPack() { |
| 56 | var _o = new TableInFirstNST(); |
| 57 | this.UnPackTo(_o); |
| 58 | return _o; |
| 59 | } |
| 60 | public void UnPackTo(TableInFirstNST _o) { |
| 61 | _o.FooTable = this.FooTable.HasValue ? this.FooTable.Value.UnPack() : null; |
| 62 | _o.FooEnum = this.FooEnum; |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 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 | } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 71 | _o.FooStruct = this.FooStruct.HasValue ? this.FooStruct.Value.UnPack() : null; |
| 72 | } |
| 73 | 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); |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 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); |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 78 | return CreateTableInFirstNS( |
| 79 | builder, |
| 80 | _foo_table, |
| 81 | _o.FooEnum, |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 82 | _foo_union_type, |
| 83 | _foo_union, |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 84 | _o.FooStruct); |
| 85 | } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 86 | } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 87 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 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; } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 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; } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 107 | [Newtonsoft.Json.JsonProperty("foo_struct")] |
| 108 | public NamespaceA.NamespaceB.StructInNestedNST FooStruct { get; set; } |
| 109 | |
| 110 | public TableInFirstNST() { |
| 111 | this.FooTable = null; |
| 112 | this.FooEnum = NamespaceA.NamespaceB.EnumInNestedNS.A; |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 113 | this.FooUnion = null; |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 114 | this.FooStruct = new NamespaceA.NamespaceB.StructInNestedNST(); |
| 115 | } |
| 116 | } |
| 117 | |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 118 | |
| 119 | } |