// <auto-generated>
//  automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>

namespace Apache.Arrow.Flatbuf
{

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

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

  public Precision Precision { get { int o = __p.__offset(4); return o != 0 ? (Precision)__p.bb.GetShort(o + __p.bb_pos) : Precision.HALF; } }

  public static Offset<FloatingPoint> CreateFloatingPoint(FlatBufferBuilder builder,
      Precision precision = Precision.HALF) {
    builder.StartTable(1);
    FloatingPoint.AddPrecision(builder, precision);
    return FloatingPoint.EndFloatingPoint(builder);
  }

  public static void StartFloatingPoint(FlatBufferBuilder builder) { builder.StartTable(1); }
  public static void AddPrecision(FlatBufferBuilder builder, Precision precision) { builder.AddShort(0, (short)precision, 0); }
  public static Offset<FloatingPoint> EndFloatingPoint(FlatBufferBuilder builder) {
    int o = builder.EndTable();
    return new Offset<FloatingPoint>(o);
  }
}


static internal class FloatingPointVerify
{
  static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
  {
    return verifier.VerifyTableStart(tablePos)
      && verifier.VerifyField(tablePos, 4 /*Precision*/, 2 /*Precision*/, 2, false)
      && verifier.VerifyTableEnd(tablePos);
  }
}

}
