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

namespace NymaTypes
{

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

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

  public string ShortName { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
  public Span<byte> GetShortNameBytes() { return __p.__vector_as_span<byte>(4, 1); }
#else
  public ArraySegment<byte>? GetShortNameBytes() { return __p.__vector_as_arraysegment(4); }
#endif
  public byte[] GetShortNameArray() { return __p.__vector_as_array<byte>(4); }
  public string FullName { get { int o = __p.__offset(6); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
  public Span<byte> GetFullNameBytes() { return __p.__vector_as_span<byte>(6, 1); }
#else
  public ArraySegment<byte>? GetFullNameBytes() { return __p.__vector_as_arraysegment(6); }
#endif
  public byte[] GetFullNameArray() { return __p.__vector_as_array<byte>(6); }
  public string Description { get { int o = __p.__offset(8); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
  public Span<byte> GetDescriptionBytes() { return __p.__vector_as_span<byte>(8, 1); }
#else
  public ArraySegment<byte>? GetDescriptionBytes() { return __p.__vector_as_arraysegment(8); }
#endif
  public byte[] GetDescriptionArray() { return __p.__vector_as_array<byte>(8); }
  public NymaTypes.DeviceFlags Flags { get { int o = __p.__offset(10); return o != 0 ? (NymaTypes.DeviceFlags)__p.bb.Get(o + __p.bb_pos) : 0; } }
  public uint ByteLength { get { int o = __p.__offset(12); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } }
  public NymaTypes.NInputInfo? Inputs(int j) { int o = __p.__offset(14); return o != 0 ? (NymaTypes.NInputInfo?)(new NymaTypes.NInputInfo()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
  public int InputsLength { get { int o = __p.__offset(14); return o != 0 ? __p.__vector_len(o) : 0; } }

  public static Offset<NymaTypes.NDeviceInfo> CreateNDeviceInfo(FlatBufferBuilder builder,
      StringOffset ShortNameOffset = default(StringOffset),
      StringOffset FullNameOffset = default(StringOffset),
      StringOffset DescriptionOffset = default(StringOffset),
      NymaTypes.DeviceFlags Flags = 0,
      uint ByteLength = 0,
      VectorOffset InputsOffset = default(VectorOffset)) {
    builder.StartTable(6);
    NDeviceInfo.AddInputs(builder, InputsOffset);
    NDeviceInfo.AddByteLength(builder, ByteLength);
    NDeviceInfo.AddDescription(builder, DescriptionOffset);
    NDeviceInfo.AddFullName(builder, FullNameOffset);
    NDeviceInfo.AddShortName(builder, ShortNameOffset);
    NDeviceInfo.AddFlags(builder, Flags);
    return NDeviceInfo.EndNDeviceInfo(builder);
  }

  public static void StartNDeviceInfo(FlatBufferBuilder builder) { builder.StartTable(6); }
  public static void AddShortName(FlatBufferBuilder builder, StringOffset ShortNameOffset) { builder.AddOffset(0, ShortNameOffset.Value, 0); }
  public static void AddFullName(FlatBufferBuilder builder, StringOffset FullNameOffset) { builder.AddOffset(1, FullNameOffset.Value, 0); }
  public static void AddDescription(FlatBufferBuilder builder, StringOffset DescriptionOffset) { builder.AddOffset(2, DescriptionOffset.Value, 0); }
  public static void AddFlags(FlatBufferBuilder builder, NymaTypes.DeviceFlags Flags) { builder.AddByte(3, (byte)Flags, 0); }
  public static void AddByteLength(FlatBufferBuilder builder, uint ByteLength) { builder.AddUint(4, ByteLength, 0); }
  public static void AddInputs(FlatBufferBuilder builder, VectorOffset InputsOffset) { builder.AddOffset(5, InputsOffset.Value, 0); }
  public static VectorOffset CreateInputsVector(FlatBufferBuilder builder, Offset<NymaTypes.NInputInfo>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
  public static VectorOffset CreateInputsVectorBlock(FlatBufferBuilder builder, Offset<NymaTypes.NInputInfo>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
  public static void StartInputsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
  public static Offset<NymaTypes.NDeviceInfo> EndNDeviceInfo(FlatBufferBuilder builder) {
    int o = builder.EndTable();
    return new Offset<NymaTypes.NDeviceInfo>(o);
  }
  public NDeviceInfoT UnPack() {
    var _o = new NDeviceInfoT();
    this.UnPackTo(_o);
    return _o;
  }
  public void UnPackTo(NDeviceInfoT _o) {
    _o.ShortName = this.ShortName;
    _o.FullName = this.FullName;
    _o.Description = this.Description;
    _o.Flags = this.Flags;
    _o.ByteLength = this.ByteLength;
    _o.Inputs = new List<NymaTypes.NInputInfoT>();
    for (var _j = 0; _j < this.InputsLength; ++_j) {_o.Inputs.Add(this.Inputs(_j).HasValue ? this.Inputs(_j).Value.UnPack() : null);}
  }
  public static Offset<NymaTypes.NDeviceInfo> Pack(FlatBufferBuilder builder, NDeviceInfoT _o) {
    if (_o == null) return default(Offset<NymaTypes.NDeviceInfo>);
    var _ShortName = _o.ShortName == null ? default(StringOffset) : builder.CreateString(_o.ShortName);
    var _FullName = _o.FullName == null ? default(StringOffset) : builder.CreateString(_o.FullName);
    var _Description = _o.Description == null ? default(StringOffset) : builder.CreateString(_o.Description);
    var _Inputs = default(VectorOffset);
    if (_o.Inputs != null) {
      var __Inputs = new Offset<NymaTypes.NInputInfo>[_o.Inputs.Count];
      for (var _j = 0; _j < __Inputs.Length; ++_j) { __Inputs[_j] = NymaTypes.NInputInfo.Pack(builder, _o.Inputs[_j]); }
      _Inputs = CreateInputsVector(builder, __Inputs);
    }
    return CreateNDeviceInfo(
      builder,
      _ShortName,
      _FullName,
      _Description,
      _o.Flags,
      _o.ByteLength,
      _Inputs);
  }
};

public class NDeviceInfoT
{
  public string ShortName { get; set; }
  public string FullName { get; set; }
  public string Description { get; set; }
  public NymaTypes.DeviceFlags Flags { get; set; }
  public uint ByteLength { get; set; }
  public List<NymaTypes.NInputInfoT> Inputs { get; set; }

  public NDeviceInfoT() {
    this.ShortName = null;
    this.FullName = null;
    this.Description = null;
    this.Flags = 0;
    this.ByteLength = 0;
    this.Inputs = null;
  }
}


}
