# automatically generated by the FlatBuffers compiler, do not modify

# namespace: 

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class ProfileSpec(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAs(cls, buf, offset=0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = ProfileSpec()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def GetRootAsProfileSpec(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # ProfileSpec
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # ProfileSpec
    def Name(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # ProfileSpec
    def KMin(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # ProfileSpec
    def KMinAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

    # ProfileSpec
    def KMinLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # ProfileSpec
    def KMinIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        return o == 0

    # ProfileSpec
    def KOpt(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # ProfileSpec
    def KOptAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

    # ProfileSpec
    def KOptLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # ProfileSpec
    def KOptIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        return o == 0

    # ProfileSpec
    def KMax(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # ProfileSpec
    def KMaxAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

    # ProfileSpec
    def KMaxLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # ProfileSpec
    def KMaxIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        return o == 0

def ProfileSpecStart(builder): builder.StartObject(4)
def Start(builder):
    return ProfileSpecStart(builder)
def ProfileSpecAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
def AddName(builder, name):
    return ProfileSpecAddName(builder, name)
def ProfileSpecAddKMin(builder, kMin): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(kMin), 0)
def AddKMin(builder, kMin):
    return ProfileSpecAddKMin(builder, kMin)
def ProfileSpecStartKMinVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartKMinVector(builder, numElems):
    return ProfileSpecStartKMinVector(builder, numElems)
def ProfileSpecAddKOpt(builder, kOpt): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(kOpt), 0)
def AddKOpt(builder, kOpt):
    return ProfileSpecAddKOpt(builder, kOpt)
def ProfileSpecStartKOptVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartKOptVector(builder, numElems):
    return ProfileSpecStartKOptVector(builder, numElems)
def ProfileSpecAddKMax(builder, kMax): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(kMax), 0)
def AddKMax(builder, kMax):
    return ProfileSpecAddKMax(builder, kMax)
def ProfileSpecStartKMaxVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartKMaxVector(builder, numElems):
    return ProfileSpecStartKMaxVector(builder, numElems)
def ProfileSpecEnd(builder): return builder.EndObject()
def End(builder):
    return ProfileSpecEnd(builder)