# automatically generated by the FlatBuffers compiler, do not modify

# namespace: 

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

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

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

    @classmethod
    def GetRootAsJoinSource(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # JoinSource
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

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

    # JoinSource
    def Endpoint(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # JoinSource
    def SourceUuid(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # JoinSource
    def SourceUuidAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # JoinSource
    def SourceUuidLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # JoinSource
    def SourceUuidIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        return o == 0

    # JoinSource
    def PipelineUuid(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # JoinSource
    def PipelineUuidAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # JoinSource
    def PipelineUuidLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # JoinSource
    def PipelineUuidIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        return o == 0

def JoinSourceStart(builder): builder.StartObject(4)
def Start(builder):
    return JoinSourceStart(builder)
def JoinSourceAddMemory(builder, memory): builder.PrependUint64Slot(0, memory, 0)
def AddMemory(builder, memory):
    return JoinSourceAddMemory(builder, memory)
def JoinSourceAddEndpoint(builder, endpoint): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(endpoint), 0)
def AddEndpoint(builder, endpoint):
    return JoinSourceAddEndpoint(builder, endpoint)
def JoinSourceAddSourceUuid(builder, sourceUuid): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(sourceUuid), 0)
def AddSourceUuid(builder, sourceUuid):
    return JoinSourceAddSourceUuid(builder, sourceUuid)
def JoinSourceStartSourceUuidVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def StartSourceUuidVector(builder, numElems):
    return JoinSourceStartSourceUuidVector(builder, numElems)
def JoinSourceAddPipelineUuid(builder, pipelineUuid): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(pipelineUuid), 0)
def AddPipelineUuid(builder, pipelineUuid):
    return JoinSourceAddPipelineUuid(builder, pipelineUuid)
def JoinSourceStartPipelineUuidVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def StartPipelineUuidVector(builder, numElems):
    return JoinSourceStartPipelineUuidVector(builder, numElems)
def JoinSourceEnd(builder): return builder.EndObject()
def End(builder):
    return JoinSourceEnd(builder)