File: Table2.cs

package info (click to toggle)
golang-github-google-flatbuffers 24.12.23-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 17,704 kB
  • sloc: cpp: 53,217; python: 6,900; cs: 5,566; java: 4,370; php: 1,460; javascript: 1,061; xml: 1,016; sh: 886; makefile: 13
file content (105 lines) | stat: -rw-r--r-- 4,375 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// <auto-generated>
//  automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>

namespace KeywordTest
{

using global::System;
using global::System.Collections.Generic;
using global::Google.FlatBuffers;

public struct Table2 : IFlatbufferObject
{
  private Table __p;
  public ByteBuffer ByteBuffer { get { return __p.bb; } }
  public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_12_23(); }
  public static Table2 GetRootAsTable2(ByteBuffer _bb) { return GetRootAsTable2(_bb, new Table2()); }
  public static Table2 GetRootAsTable2(ByteBuffer _bb, Table2 obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
  public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
  public Table2 __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  public KeywordTest.KeywordsInUnion TypeType { get { int o = __p.__offset(4); return o != 0 ? (KeywordTest.KeywordsInUnion)__p.bb.Get(o + __p.bb_pos) : KeywordTest.KeywordsInUnion.NONE; } }
  public TTable? Type<TTable>() where TTable : struct, IFlatbufferObject { int o = __p.__offset(6); return o != 0 ? (TTable?)__p.__union<TTable>(o + __p.bb_pos) : null; }
  public KeywordTest.KeywordsInTable TypeAsstatic() { return Type<KeywordTest.KeywordsInTable>().Value; }
  public KeywordTest.KeywordsInTable TypeAsinternal() { return Type<KeywordTest.KeywordsInTable>().Value; }

  public static Offset<KeywordTest.Table2> CreateTable2(FlatBufferBuilder builder,
      KeywordTest.KeywordsInUnion type_type = KeywordTest.KeywordsInUnion.NONE,
      int typeOffset = 0) {
    builder.StartTable(2);
    Table2.AddType(builder, typeOffset);
    Table2.AddTypeType(builder, type_type);
    return Table2.EndTable2(builder);
  }

  public static void StartTable2(FlatBufferBuilder builder) { builder.StartTable(2); }
  public static void AddTypeType(FlatBufferBuilder builder, KeywordTest.KeywordsInUnion typeType) { builder.AddByte(0, (byte)typeType, 0); }
  public static void AddType(FlatBufferBuilder builder, int typeOffset) { builder.AddOffset(1, typeOffset, 0); }
  public static Offset<KeywordTest.Table2> EndTable2(FlatBufferBuilder builder) {
    int o = builder.EndTable();
    return new Offset<KeywordTest.Table2>(o);
  }
  public Table2T UnPack() {
    var _o = new Table2T();
    this.UnPackTo(_o);
    return _o;
  }
  public void UnPackTo(Table2T _o) {
    _o.Type = new KeywordTest.KeywordsInUnionUnion();
    _o.Type.Type = this.TypeType;
    switch (this.TypeType) {
      default: break;
      case KeywordTest.KeywordsInUnion.static:
        _o.Type.Value = this.Type<KeywordTest.KeywordsInTable>().HasValue ? this.Type<KeywordTest.KeywordsInTable>().Value.UnPack() : null;
        break;
      case KeywordTest.KeywordsInUnion.internal:
        _o.Type.Value = this.Type<KeywordTest.KeywordsInTable>().HasValue ? this.Type<KeywordTest.KeywordsInTable>().Value.UnPack() : null;
        break;
    }
  }
  public static Offset<KeywordTest.Table2> Pack(FlatBufferBuilder builder, Table2T _o) {
    if (_o == null) return default(Offset<KeywordTest.Table2>);
    var _type_type = _o.Type == null ? KeywordTest.KeywordsInUnion.NONE : _o.Type.Type;
    var _type = _o.Type == null ? 0 : KeywordTest.KeywordsInUnionUnion.Pack(builder, _o.Type);
    return CreateTable2(
      builder,
      _type_type,
      _type);
  }
}

public class Table2T
{
  [Newtonsoft.Json.JsonProperty("type_type")]
  private KeywordTest.KeywordsInUnion TypeType {
    get {
      return this.Type != null ? this.Type.Type : KeywordTest.KeywordsInUnion.NONE;
    }
    set {
      this.Type = new KeywordTest.KeywordsInUnionUnion();
      this.Type.Type = value;
    }
  }
  [Newtonsoft.Json.JsonProperty("type")]
  [Newtonsoft.Json.JsonConverter(typeof(KeywordTest.KeywordsInUnionUnion_JsonConverter))]
  public KeywordTest.KeywordsInUnionUnion Type { get; set; }

  public Table2T() {
    this.Type = null;
  }
}


static public class Table2Verify
{
  static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
  {
    return verifier.VerifyTableStart(tablePos)
      && verifier.VerifyField(tablePos, 4 /*TypeType*/, 1 /*KeywordTest.KeywordsInUnion*/, 1, false)
      && verifier.VerifyUnion(tablePos, 4, 6 /*Type*/, KeywordTest.KeywordsInUnionVerify.Verify, false)
      && verifier.VerifyTableEnd(tablePos);
  }
}

}