# automatically generated by the FlatBuffers compiler, do not modify

# namespace: schema

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

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

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

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

    # BatchDescriptor
    def Offset(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
        return 0

    # BatchDescriptor
    def Length(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
        return 0

    # BatchDescriptor
    def NumRows(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
        return 0

def BatchDescriptorStart(builder):
    builder.StartObject(3)

def Start(builder):
    BatchDescriptorStart(builder)

def BatchDescriptorAddOffset(builder, offset):
    builder.PrependUint64Slot(0, offset, 0)

def AddOffset(builder, offset):
    BatchDescriptorAddOffset(builder, offset)

def BatchDescriptorAddLength(builder, length):
    builder.PrependUint64Slot(1, length, 0)

def AddLength(builder, length):
    BatchDescriptorAddLength(builder, length)

def BatchDescriptorAddNumRows(builder, numRows):
    builder.PrependUint32Slot(2, numRows, 0)

def AddNumRows(builder, numRows):
    BatchDescriptorAddNumRows(builder, numRows)

def BatchDescriptorEnd(builder):
    return builder.EndObject()

def End(builder):
    return BatchDescriptorEnd(builder)
