# automatically generated by the FlatBuffers compiler, do not modify

# namespace: dv

import flatbuffers

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

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

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

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

    # FileDataDefinition
    def PacketInfo(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = o + self._tab.Pos
            from .PacketHeader import PacketHeader
            obj = PacketHeader()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

    # FileDataDefinition
    def TimestampStart(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # FileDataDefinition
    def TimestampEnd(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

def FileDataDefinitionStart(builder): builder.StartObject(5)
def FileDataDefinitionAddByteOffset(builder, ByteOffset): builder.PrependInt64Slot(0, ByteOffset, 0)
def FileDataDefinitionAddPacketInfo(builder, PacketInfo): builder.PrependStructSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(PacketInfo), 0)
def FileDataDefinitionAddNumElements(builder, NumElements): builder.PrependInt64Slot(2, NumElements, 0)
def FileDataDefinitionAddTimestampStart(builder, TimestampStart): builder.PrependInt64Slot(3, TimestampStart, 0)
def FileDataDefinitionAddTimestampEnd(builder, TimestampEnd): builder.PrependInt64Slot(4, TimestampEnd, 0)
def FileDataDefinitionEnd(builder): return builder.EndObject()
