# automatically generated by the FlatBuffers compiler, do not modify

# namespace: dv

import flatbuffers

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

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

# /// Timestamp (µs).
    # Event
    def Timestamp(self): return self._tab.Get(flatbuffers.number_types.Int64Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0))
    # Event
    def X(self): return self._tab.Get(flatbuffers.number_types.Int16Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(8))
    # Event
    def Y(self): return self._tab.Get(flatbuffers.number_types.Int16Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(10))
    # Event
    def Polarity(self): return self._tab.Get(flatbuffers.number_types.BoolFlags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(12))

def CreateEvent(builder, timestamp, x, y, polarity):
    builder.Prep(8, 16)
    builder.Pad(3)
    builder.PrependBool(polarity)
    builder.PrependInt16(y)
    builder.PrependInt16(x)
    builder.PrependInt64(timestamp)
    return builder.Offset()
