blob: ad72eee482cefda6bef4c17cf0573bdcbcb2318b [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001// <auto-generated>
2// automatically generated by the FlatBuffers compiler, do not modify
3// </auto-generated>
4
5namespace NamespaceA
6{
7
8using global::System;
Austin Schuh272c6132020-11-14 16:37:52 -08009using global::System.Collections.Generic;
Austin Schuh2dd86a92022-09-14 21:19:23 -070010using global::Google.FlatBuffers;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070011
12public struct TableInFirstNS : IFlatbufferObject
13{
14 private Table __p;
15 public ByteBuffer ByteBuffer { get { return __p.bb; } }
Austin Schuh2dd86a92022-09-14 21:19:23 -070016 public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_2_0_8(); }
Austin Schuhe89fa2d2019-08-14 20:24:23 -070017 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 Kuszmaul8e62b022022-03-22 09:33:25 -070025 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 Schuhe89fa2d2019-08-14 20:24:23 -070029
Austin Schuh272c6132020-11-14 16:37:52 -080030 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 Kuszmaul8e62b022022-03-22 09:33:25 -070033 NamespaceA.NamespaceB.UnionInNestedNS foo_union_type = NamespaceA.NamespaceB.UnionInNestedNS.NONE,
34 int foo_unionOffset = 0,
Austin Schuh272c6132020-11-14 16:37:52 -080035 NamespaceA.NamespaceB.StructInNestedNST foo_struct = null) {
James Kuszmaul8e62b022022-03-22 09:33:25 -070036 builder.StartTable(5);
Austin Schuh272c6132020-11-14 16:37:52 -080037 TableInFirstNS.AddFooStruct(builder, NamespaceA.NamespaceB.StructInNestedNS.Pack(builder, foo_struct));
James Kuszmaul8e62b022022-03-22 09:33:25 -070038 TableInFirstNS.AddFooUnion(builder, foo_unionOffset);
Austin Schuh272c6132020-11-14 16:37:52 -080039 TableInFirstNS.AddFooTable(builder, foo_tableOffset);
James Kuszmaul8e62b022022-03-22 09:33:25 -070040 TableInFirstNS.AddFooUnionType(builder, foo_union_type);
Austin Schuh272c6132020-11-14 16:37:52 -080041 TableInFirstNS.AddFooEnum(builder, foo_enum);
42 return TableInFirstNS.EndTableInFirstNS(builder);
43 }
44
James Kuszmaul8e62b022022-03-22 09:33:25 -070045 public static void StartTableInFirstNS(FlatBufferBuilder builder) { builder.StartTable(5); }
Austin Schuhe89fa2d2019-08-14 20:24:23 -070046 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 Kuszmaul8e62b022022-03-22 09:33:25 -070048 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 Schuhe89fa2d2019-08-14 20:24:23 -070051 public static Offset<NamespaceA.TableInFirstNS> EndTableInFirstNS(FlatBufferBuilder builder) {
52 int o = builder.EndTable();
53 return new Offset<NamespaceA.TableInFirstNS>(o);
54 }
Austin Schuh272c6132020-11-14 16:37:52 -080055 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 Kuszmaul8e62b022022-03-22 09:33:25 -070063 _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 Schuh272c6132020-11-14 16:37:52 -080071 _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 Kuszmaul8e62b022022-03-22 09:33:25 -070076 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 Schuh272c6132020-11-14 16:37:52 -080078 return CreateTableInFirstNS(
79 builder,
80 _foo_table,
81 _o.FooEnum,
James Kuszmaul8e62b022022-03-22 09:33:25 -070082 _foo_union_type,
83 _foo_union,
Austin Schuh272c6132020-11-14 16:37:52 -080084 _o.FooStruct);
85 }
James Kuszmaul8e62b022022-03-22 09:33:25 -070086}
Austin Schuhe89fa2d2019-08-14 20:24:23 -070087
Austin Schuh272c6132020-11-14 16:37:52 -080088public 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 Kuszmaul8e62b022022-03-22 09:33:25 -070094 [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 Schuh272c6132020-11-14 16:37:52 -0800107 [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 Kuszmaul8e62b022022-03-22 09:33:25 -0700113 this.FooUnion = null;
Austin Schuh272c6132020-11-14 16:37:52 -0800114 this.FooStruct = new NamespaceA.NamespaceB.StructInNestedNST();
115 }
116}
117
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700118
119}