1// <auto-generated>
2// automatically generated by the FlatBuffers compiler, do not modify
3// </auto-generated>
4
5namespace NamespaceA
6{
7
8using global::System;
9using global::System.Collections.Generic;
10using global::Google.FlatBuffers;
11
12public struct TableInFirstNS : IFlatbufferObject
13{
14 private Table __p;
15 public ByteBuffer ByteBuffer { get { return __p.bb; } }
16 public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); }
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; } }
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; } }
29
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,
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
45 public static void StartTableInFirstNS(FlatBufferBuilder builder) { builder.StartTable(5); }
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); }
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); }
51 public static Offset<NamespaceA.TableInFirstNS> EndTableInFirstNS(FlatBufferBuilder builder) {
52 int o = builder.EndTable();
53 return new Offset<NamespaceA.TableInFirstNS>(o);
54 }
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;
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 }
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);
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
88public 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
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
119static public class TableInFirstNSVerify
120{
121 static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
122 {
123 return verifier.VerifyTableStart(tablePos)
124 && verifier.VerifyTable(tablePos, 4 /*FooTable*/, NamespaceA.NamespaceB.TableInNestedNSVerify.Verify, false)
125 && verifier.VerifyField(tablePos, 6 /*FooEnum*/, 1 /*NamespaceA.NamespaceB.EnumInNestedNS*/, 1, false)
126 && verifier.VerifyField(tablePos, 8 /*FooUnionType*/, 1 /*NamespaceA.NamespaceB.UnionInNestedNS*/, 1, false)
127 && verifier.VerifyUnion(tablePos, 8, 10 /*FooUnion*/, NamespaceA.NamespaceB.UnionInNestedNSVerify.Verify, false)
128 && verifier.VerifyField(tablePos, 12 /*FooStruct*/, 8 /*NamespaceA.NamespaceB.StructInNestedNS*/, 4, false)
129 && verifier.VerifyTableEnd(tablePos);
130 }
131}
132
133}
View as plain text