# automatically generated by the FlatBuffers compiler, do not modify

# namespace: dv

import flatbuffers

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

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

    # IOHeader
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

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

    # IOHeader
    def DataTablePosition(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return -1

    # IOHeader
    def InfoNode(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

def IOHeaderStart(builder): builder.StartObject(3)
def IOHeaderAddCompression(builder, compression): builder.PrependInt32Slot(0, compression, 0)
def IOHeaderAddDataTablePosition(builder, dataTablePosition): builder.PrependInt64Slot(1, dataTablePosition, -1)
def IOHeaderAddInfoNode(builder, infoNode): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(infoNode), 0)
def IOHeaderEnd(builder): return builder.EndObject()
