# automatically generated by the FlatBuffers compiler, do not modify

# namespace: reflection

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

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

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

    @classmethod
    def GetRootAsType(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    @classmethod
    def TypeBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed)

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

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

    # Type
    def Element(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

    # Type
    def Index(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return -1

    # Type
    def FixedLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos)
        return 0

    # The size (octets) of the `base_type` field.
    # Type
    def BaseSize(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
        return 4

    # The size (octets) of the `element` field, if present.
    # Type
    def ElementSize(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
        return 0

def Start(builder): builder.StartObject(6)
def TypeStart(builder):
    """This method is deprecated. Please switch to Start."""
    return Start(builder)
def AddBaseType(builder, baseType): builder.PrependInt8Slot(0, baseType, 0)
def TypeAddBaseType(builder, baseType):
    """This method is deprecated. Please switch to AddBaseType."""
    return AddBaseType(builder, baseType)
def AddElement(builder, element): builder.PrependInt8Slot(1, element, 0)
def TypeAddElement(builder, element):
    """This method is deprecated. Please switch to AddElement."""
    return AddElement(builder, element)
def AddIndex(builder, index): builder.PrependInt32Slot(2, index, -1)
def TypeAddIndex(builder, index):
    """This method is deprecated. Please switch to AddIndex."""
    return AddIndex(builder, index)
def AddFixedLength(builder, fixedLength): builder.PrependUint16Slot(3, fixedLength, 0)
def TypeAddFixedLength(builder, fixedLength):
    """This method is deprecated. Please switch to AddFixedLength."""
    return AddFixedLength(builder, fixedLength)
def AddBaseSize(builder, baseSize): builder.PrependUint32Slot(4, baseSize, 4)
def TypeAddBaseSize(builder, baseSize):
    """This method is deprecated. Please switch to AddBaseSize."""
    return AddBaseSize(builder, baseSize)
def AddElementSize(builder, elementSize): builder.PrependUint32Slot(5, elementSize, 0)
def TypeAddElementSize(builder, elementSize):
    """This method is deprecated. Please switch to AddElementSize."""
    return AddElementSize(builder, elementSize)
def End(builder): return builder.EndObject()
def TypeEnd(builder):
    """This method is deprecated. Please switch to End."""
    return End(builder)