# automatically generated by the FlatBuffers compiler, do not modify

# namespace: reflection

import flatbuffers

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

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

    # 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

def TypeStart(builder): builder.StartObject(3)
def TypeAddBaseType(builder, baseType): builder.PrependInt8Slot(0, baseType, 0)
def TypeAddElement(builder, element): builder.PrependInt8Slot(1, element, 0)
def TypeAddIndex(builder, index): builder.PrependInt32Slot(2, index, -1)
def TypeEnd(builder): return builder.EndObject()
