xref: /aosp_15_r20/external/flatbuffers/tests/KeywordTest/KeywordsInTable.cs (revision 890232f25432b36107d06881e0a25aaa6b473652)
1 // <auto-generated>
2 //  automatically generated by the FlatBuffers compiler, do not modify
3 // </auto-generated>
4 
5 namespace KeywordTest
6 {
7 
8 using global::System;
9 using global::System.Collections.Generic;
10 using global::FlatBuffers;
11 
12 public struct KeywordsInTable : IFlatbufferObject
13 {
14   private Table __p;
15   public ByteBuffer ByteBuffer { get { return __p.bb; } }
ValidateVersionKeywordTest.KeywordsInTable16   public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_2_0_0(); }
GetRootAsKeywordsInTableKeywordTest.KeywordsInTable17   public static KeywordsInTable GetRootAsKeywordsInTable(ByteBuffer _bb) { return GetRootAsKeywordsInTable(_bb, new KeywordsInTable()); }
GetRootAsKeywordsInTableKeywordTest.KeywordsInTable18   public static KeywordsInTable GetRootAsKeywordsInTable(ByteBuffer _bb, KeywordsInTable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
__initKeywordTest.KeywordsInTable19   public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
__assignKeywordTest.KeywordsInTable20   public KeywordsInTable __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
21 
22   public KeywordTest.ABC Is { get { int o = __p.__offset(4); return o != 0 ? (KeywordTest.ABC)__p.bb.GetInt(o + __p.bb_pos) : KeywordTest.ABC.@void; } }
23   public bool MutateIs(KeywordTest.ABC @is) { int o = __p.__offset(4); if (o != 0) { __p.bb.PutInt(o + __p.bb_pos, (int)@is); return true; } else { return false; } }
24   public KeywordTest.@public Private { get { int o = __p.__offset(6); return o != 0 ? (KeywordTest.@public)__p.bb.GetInt(o + __p.bb_pos) : KeywordTest.@public.NONE; } }
25   public bool MutatePrivate(KeywordTest.@public @private) { int o = __p.__offset(6); if (o != 0) { __p.bb.PutInt(o + __p.bb_pos, (int)@private); return true; } else { return false; } }
26   public int Type { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
MutateTypeKeywordTest.KeywordsInTable27   public bool MutateType(int type) { int o = __p.__offset(8); if (o != 0) { __p.bb.PutInt(o + __p.bb_pos, type); return true; } else { return false; } }
28   public bool Default { get { int o = __p.__offset(10); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } }
29   public bool MutateDefault(bool @default) { int o = __p.__offset(10); if (o != 0) { __p.bb.Put(o + __p.bb_pos, (byte)(@default ? 1 : 0)); return true; } else { return false; } }
30 
CreateKeywordsInTableKeywordTest.KeywordsInTable31   public static Offset<KeywordTest.KeywordsInTable> CreateKeywordsInTable(FlatBufferBuilder builder,
32       KeywordTest.ABC @is = KeywordTest.ABC.@void,
33       KeywordTest.@public @private = KeywordTest.@public.NONE,
34       int type = 0,
35       bool @default = false) {
36     builder.StartTable(4);
37     KeywordsInTable.AddType(builder, type);
38     KeywordsInTable.AddPrivate(builder, @private);
39     KeywordsInTable.AddIs(builder, @is);
40     KeywordsInTable.AddDefault(builder, @default);
41     return KeywordsInTable.EndKeywordsInTable(builder);
42   }
43 
StartKeywordsInTableKeywordTest.KeywordsInTable44   public static void StartKeywordsInTable(FlatBufferBuilder builder) { builder.StartTable(4); }
AddIsKeywordTest.KeywordsInTable45   public static void AddIs(FlatBufferBuilder builder, KeywordTest.ABC @is) { builder.AddInt(0, (int)@is, 0); }
AddPrivateKeywordTest.KeywordsInTable46   public static void AddPrivate(FlatBufferBuilder builder, KeywordTest.@public @private) { builder.AddInt(1, (int)@private, 0); }
AddTypeKeywordTest.KeywordsInTable47   public static void AddType(FlatBufferBuilder builder, int type) { builder.AddInt(2, type, 0); }
AddDefaultKeywordTest.KeywordsInTable48   public static void AddDefault(FlatBufferBuilder builder, bool @default) { builder.AddBool(3, @default, false); }
EndKeywordsInTableKeywordTest.KeywordsInTable49   public static Offset<KeywordTest.KeywordsInTable> EndKeywordsInTable(FlatBufferBuilder builder) {
50     int o = builder.EndTable();
51     return new Offset<KeywordTest.KeywordsInTable>(o);
52   }
UnPackKeywordTest.KeywordsInTable53   public KeywordsInTableT UnPack() {
54     var _o = new KeywordsInTableT();
55     this.UnPackTo(_o);
56     return _o;
57   }
UnPackToKeywordTest.KeywordsInTable58   public void UnPackTo(KeywordsInTableT _o) {
59     _o.Is = this.Is;
60     _o.Private = this.Private;
61     _o.Type = this.Type;
62     _o.Default = this.Default;
63   }
PackKeywordTest.KeywordsInTable64   public static Offset<KeywordTest.KeywordsInTable> Pack(FlatBufferBuilder builder, KeywordsInTableT _o) {
65     if (_o == null) return default(Offset<KeywordTest.KeywordsInTable>);
66     return CreateKeywordsInTable(
67       builder,
68       _o.Is,
69       _o.Private,
70       _o.Type,
71       _o.Default);
72   }
73 }
74 
75 public class KeywordsInTableT
76 {
77   [Newtonsoft.Json.JsonProperty("is")]
78   public KeywordTest.ABC Is { get; set; }
79   [Newtonsoft.Json.JsonProperty("private")]
80   public KeywordTest.@public Private { get; set; }
81   [Newtonsoft.Json.JsonProperty("type")]
82   public int Type { get; set; }
83   [Newtonsoft.Json.JsonProperty("default")]
84   public bool Default { get; set; }
85 
KeywordsInTableT()86   public KeywordsInTableT() {
87     this.Is = KeywordTest.ABC.@void;
88     this.Private = KeywordTest.@public.NONE;
89     this.Type = 0;
90     this.Default = false;
91   }
92 }
93 
94 
95 }
96