<reponame>tuananhle7/pyprob
# automatically generated by the FlatBuffers compiler, do not modify

# namespace: protocol

import flatbuffers

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

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

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

    # Trace
    def Observes(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .NDArray import NDArray
            obj = NDArray()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Trace
    def Samples(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .Sample import Sample
            obj = Sample()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

def TraceStart(builder): builder.StartObject(2)
def TraceAddObserves(builder, observes): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(observes), 0)
def TraceAddSamples(builder, samples): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(samples), 0)
def TraceStartSamplesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def TraceEnd(builder): return builder.EndObject()

# automatically generated by the FlatBuffers compiler, do not modify

# namespace: protocol

import flatbuffers

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

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

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

    # Trace
    def Observes(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .NDArray import NDArray
            obj = NDArray()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Trace
    def Samples(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .Sample import Sample
            obj = Sample()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

def TraceStart(builder): builder.StartObject(2)
def TraceAddObserves(builder, observes): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(observes), 0)
def TraceAddSamples(builder, samples): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(samples), 0)
def TraceStartSamplesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def TraceEnd(builder): return builder.EndObject()
# automatically generated by the FlatBuffers compiler, do not modify # namespace: protocol # Trace # Trace # Trace # Trace