# automatically generated by the FlatBuffers compiler, do not modify

# namespace: 

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

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

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

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

    # NodeAlive
    def Links(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 32
            from .NodeJoined import NodeJoined
            obj = NodeJoined()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # NodeAlive
    def LinksLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # NodeAlive
    def LinksIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        return o == 0

    # NodeAlive
    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

def NodeAliveStart(builder): builder.StartObject(2)
def Start(builder):
    return NodeAliveStart(builder)
def NodeAliveAddLinks(builder, links): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(links), 0)
def AddLinks(builder, links):
    return NodeAliveAddLinks(builder, links)
def NodeAliveStartLinksVector(builder, numElems): return builder.StartVector(32, numElems, 1)
def StartLinksVector(builder, numElems):
    return NodeAliveStartLinksVector(builder, numElems)
def NodeAliveAddEndpoint(builder, endpoint): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(endpoint), 0)
def AddEndpoint(builder, endpoint):
    return NodeAliveAddEndpoint(builder, endpoint)
def NodeAliveEnd(builder): return builder.EndObject()
def End(builder):
    return NodeAliveEnd(builder)