| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- # automatically generated by the FlatBuffers compiler, do not modify
- # namespace: wire_protocol
- import flatbuffers
- from flatbuffers.compat import import_numpy
- np = import_numpy()
- class CommandRequest(object):
- __slots__ = ['_tab']
- @classmethod
- def GetRootAs(cls, buf, offset=0):
- n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
- x = CommandRequest()
- x.Init(buf, n + offset)
- return x
- @classmethod
- def GetRootAsCommandRequest(cls, buf, offset=0):
- """This method is deprecated. Please switch to GetRootAs."""
- return cls.GetRootAs(buf, offset)
- # CommandRequest
- def Init(self, buf, pos):
- self._tab = flatbuffers.table.Table(buf, pos)
- # CommandRequest
- def Command(self):
- o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
- if o != 0:
- return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
- return 0
- def CommandRequestStart(builder): builder.StartObject(1)
- def Start(builder):
- return CommandRequestStart(builder)
- def CommandRequestAddCommand(builder, command): builder.PrependInt16Slot(0, command, 0)
- def AddCommand(builder, command):
- return CommandRequestAddCommand(builder, command)
- def CommandRequestEnd(builder): return builder.EndObject()
- def End(builder):
- return CommandRequestEnd(builder)
|