# automatically generated by the FlatBuffers compiler, do not modify

# namespace:

import flatbuffers


class timestamp(object):
    __slots__ = ["_tab"]

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

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

    # timestamp
    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

    # timestamp
    def Timestamps(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.Uint64Flags,
                a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8),
            )
        return 0

    # timestamp
    def TimestampsAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint64Flags, o)
        return 0

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

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


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


def timestampAddName(builder, name):
    builder.PrependUOffsetTRelativeSlot(
        0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0
    )


def timestampAddTimestamps(builder, timestamps):
    builder.PrependUOffsetTRelativeSlot(
        1, flatbuffers.number_types.UOffsetTFlags.py_type(timestamps), 0
    )


def timestampStartTimestampsVector(builder, numElems):
    return builder.StartVector(8, numElems, 8)


def timestampAddSequenceCounter(builder, sequenceCounter):
    builder.PrependUint64Slot(2, sequenceCounter, 0)


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