# automatically generated by the FlatBuffers compiler, do not modify

# namespace: dv

import flatbuffers

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

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

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

# /// Timestamp (µs).
    # Trigger
    def Timestamp(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

# /// Type of trigger that occurred.
    # Trigger
    def Type(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

def TriggerStart(builder): builder.StartObject(2)
def TriggerAddTimestamp(builder, timestamp): builder.PrependInt64Slot(0, timestamp, 0)
def TriggerAddType(builder, type): builder.PrependInt8Slot(1, type, 0)
def TriggerEnd(builder): return builder.EndObject()
