...

Text file src/github.com/google/flatbuffers/tests/nested_namespace_test/nested_namespace_test3_generated.cs

Documentation: github.com/google/flatbuffers/tests/nested_namespace_test

     1// <auto-generated>
     2//  automatically generated by the FlatBuffers compiler, do not modify
     3// </auto-generated>
     4
     5namespace NamespaceA.NamespaceB
     6{
     7
     8using global::System;
     9using global::System.Collections.Generic;
    10using global::Google.FlatBuffers;
    11
    12public struct ColorTestTable : 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 ColorTestTable GetRootAsColorTestTable(ByteBuffer _bb) { return GetRootAsColorTestTable(_bb, new ColorTestTable()); }
    18  public static ColorTestTable GetRootAsColorTestTable(ByteBuffer _bb, ColorTestTable 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 ColorTestTable __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
    21
    22  public global::NamespaceB.Color Color { get { int o = __p.__offset(4); return o != 0 ? (global::NamespaceB.Color)__p.bb.GetSbyte(o + __p.bb_pos) : global::NamespaceB.Color.Blue; } }
    23  public bool MutateColor(global::NamespaceB.Color color) { int o = __p.__offset(4); if (o != 0) { __p.bb.PutSbyte(o + __p.bb_pos, (sbyte)color); return true; } else { return false; } }
    24
    25  public static Offset<global::NamespaceA.NamespaceB.ColorTestTable> CreateColorTestTable(FlatBufferBuilder builder,
    26      global::NamespaceB.Color color = global::NamespaceB.Color.Blue) {
    27    builder.StartTable(1);
    28    ColorTestTable.AddColor(builder, color);
    29    return ColorTestTable.EndColorTestTable(builder);
    30  }
    31
    32  public static void StartColorTestTable(FlatBufferBuilder builder) { builder.StartTable(1); }
    33  public static void AddColor(FlatBufferBuilder builder, global::NamespaceB.Color color) { builder.AddSbyte(0, (sbyte)color, 2); }
    34  public static Offset<global::NamespaceA.NamespaceB.ColorTestTable> EndColorTestTable(FlatBufferBuilder builder) {
    35    int o = builder.EndTable();
    36    return new Offset<global::NamespaceA.NamespaceB.ColorTestTable>(o);
    37  }
    38  public ColorTestTableT UnPack() {
    39    var _o = new ColorTestTableT();
    40    this.UnPackTo(_o);
    41    return _o;
    42  }
    43  public void UnPackTo(ColorTestTableT _o) {
    44    _o.Color = this.Color;
    45  }
    46  public static Offset<global::NamespaceA.NamespaceB.ColorTestTable> Pack(FlatBufferBuilder builder, ColorTestTableT _o) {
    47    if (_o == null) return default(Offset<global::NamespaceA.NamespaceB.ColorTestTable>);
    48    return CreateColorTestTable(
    49      builder,
    50      _o.Color);
    51  }
    52}
    53
    54public class ColorTestTableT
    55{
    56  [Newtonsoft.Json.JsonProperty("color")]
    57  public global::NamespaceB.Color Color { get; set; }
    58
    59  public ColorTestTableT() {
    60    this.Color = global::NamespaceB.Color.Blue;
    61  }
    62}
    63
    64
    65static public class ColorTestTableVerify
    66{
    67  static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
    68  {
    69    return verifier.VerifyTableStart(tablePos)
    70      && verifier.VerifyField(tablePos, 4 /*Color*/, 1 /*global::NamespaceB.Color*/, 1, false)
    71      && verifier.VerifyTableEnd(tablePos);
    72  }
    73}
    74
    75}

View as plain text