| 56 | |
| 57 | |
| 58 | class IntT(object): |
| 59 | |
| 60 | # IntT |
| 61 | def __init__(self): |
| 62 | self.intVal = 0 # type: int |
| 63 | |
| 64 | @classmethod |
| 65 | def InitFromBuf(cls, buf, pos): |
| 66 | int = Int() |
| 67 | int.Init(buf, pos) |
| 68 | return cls.InitFromObj(int) |
| 69 | |
| 70 | @classmethod |
| 71 | def InitFromPackedBuf(cls, buf, pos=0): |
| 72 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos) |
| 73 | return cls.InitFromBuf(buf, pos+n) |
| 74 | |
| 75 | @classmethod |
| 76 | def InitFromObj(cls, int): |
| 77 | x = IntT() |
| 78 | x._UnPack(int) |
| 79 | return x |
| 80 | |
| 81 | def __eq__(self, other): |
| 82 | return type(self) == type(other) and \ |
| 83 | self.intVal == other.intVal |
| 84 | |
| 85 | # IntT |
| 86 | def _UnPack(self, int): |
| 87 | if int is None: |
| 88 | return |
| 89 | self.intVal = int.IntVal() |
| 90 | |
| 91 | # IntT |
| 92 | def Pack(self, builder): |
| 93 | IntStart(builder) |
| 94 | IntAddIntVal(builder, self.intVal) |
| 95 | int = IntEnd(builder) |
| 96 | return int |