# automatically generated by the FlatBuffers compiler, do not modify

# namespace: foxglove

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

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

    @classmethod
    def SizeOf(cls):
        return 8

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

    # Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive.
    # Duration
    def Sec(self): return self._tab.Get(flatbuffers.number_types.Int32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0))
    # if sec === 0 : -999,999,999 <= nsec <= +999,999,999
    # otherwise sign of sec must match sign of nsec or be 0 and abs(nsec) <= 999,999,999
    # Duration
    def Nsec(self): return self._tab.Get(flatbuffers.number_types.Int32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(4))

def CreateDuration(builder, sec, nsec):
    builder.Prep(4, 8)
    builder.PrependInt32(nsec)
    builder.PrependInt32(sec)
    return builder.Offset()
