# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

    # WhileParam
    def CondGraph(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

    # WhileParam
    def BodyGraph(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # WhileParam
    def AliasesInputs(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            obj = StringVec()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

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

    # WhileParam
    def AliasesOutputs(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return ""

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

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

    # WhileParam
    def AliasesUpdates(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            obj = StringVec()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # WhileParam
    def AliasesUpdatesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # WhileParam
    def AliasesUpdatesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        return o == 0

def WhileParamStart(builder): builder.StartObject(5)
def Start(builder):
    return WhileParamStart(builder)
def WhileParamAddCondGraph(builder, condGraph): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(condGraph), 0)
def AddCondGraph(builder, condGraph):
    return WhileParamAddCondGraph(builder, condGraph)
def WhileParamAddBodyGraph(builder, bodyGraph): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(bodyGraph), 0)
def AddBodyGraph(builder, bodyGraph):
    return WhileParamAddBodyGraph(builder, bodyGraph)
def WhileParamAddAliasesInputs(builder, aliasesInputs): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(aliasesInputs), 0)
def AddAliasesInputs(builder, aliasesInputs):
    return WhileParamAddAliasesInputs(builder, aliasesInputs)
def WhileParamStartAliasesInputsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartAliasesInputsVector(builder, numElems):
    return WhileParamStartAliasesInputsVector(builder, numElems)
def WhileParamAddAliasesOutputs(builder, aliasesOutputs): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(aliasesOutputs), 0)
def AddAliasesOutputs(builder, aliasesOutputs):
    return WhileParamAddAliasesOutputs(builder, aliasesOutputs)
def WhileParamStartAliasesOutputsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartAliasesOutputsVector(builder, numElems):
    return WhileParamStartAliasesOutputsVector(builder, numElems)
def WhileParamAddAliasesUpdates(builder, aliasesUpdates): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(aliasesUpdates), 0)
def AddAliasesUpdates(builder, aliasesUpdates):
    return WhileParamAddAliasesUpdates(builder, aliasesUpdates)
def WhileParamStartAliasesUpdatesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartAliasesUpdatesVector(builder, numElems):
    return WhileParamStartAliasesUpdatesVector(builder, numElems)
def WhileParamEnd(builder): return builder.EndObject()
def End(builder):
    return WhileParamEnd(builder)