Source code for crossbar.shell.reflection.Type
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: reflection
import flatbuffers
[docs]
class Type(object):
@classmethod
[docs]
def GetRootAsType(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Type()
x.Init(buf, n + offset)
return x
# Type
[docs]
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# Type
[docs]
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
[docs]
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
[docs]
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
[docs]
def TypeStart(builder):
builder.StartObject(3)
[docs]
def TypeAddBaseType(builder, baseType):
builder.PrependInt8Slot(0, baseType, 0)
[docs]
def TypeAddElement(builder, element):
builder.PrependInt8Slot(1, element, 0)
[docs]
def TypeAddIndex(builder, index):
builder.PrependInt32Slot(2, index, -1)
[docs]
def TypeEnd(builder):
return builder.EndObject()