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