| 1 |
// automatically generated by the FlatBuffers compiler, do not modify |
| 2 |
import flatbuffers |
| 3 |
|
| 4 |
namespace optional_scalars |
| 5 |
|
| 6 |
enum OptionalByte: |
| 7 |
OptionalByte_None = 0 |
| 8 |
OptionalByte_One = 1 |
| 9 |
OptionalByte_Two = 2 |
| 10 |
|
| 11 |
class ScalarStuff |
| 12 |
|
| 13 |
class ScalarStuff : flatbuffers.handle |
| 14 |
def just_i8() -> int: |
| 15 |
return flatbuffers.field_int8(buf_, pos_, 4, 0) |
| 16 |
def maybe_i8() -> int, bool: |
| 17 |
return flatbuffers.field_int8(buf_, pos_, 6, 0), flatbuffers.field_present(buf_, pos_, 6) |
| 18 |
def default_i8() -> int: |
| 19 |
return flatbuffers.field_int8(buf_, pos_, 8, 42) |
| 20 |
def just_u8() -> int: |
| 21 |
return flatbuffers.field_uint8(buf_, pos_, 10, 0) |
| 22 |
def maybe_u8() -> int, bool: |
| 23 |
return flatbuffers.field_uint8(buf_, pos_, 12, 0), flatbuffers.field_present(buf_, pos_, 12) |
| 24 |
def default_u8() -> int: |
| 25 |
return flatbuffers.field_uint8(buf_, pos_, 14, 42) |
| 26 |
def just_i16() -> int: |
| 27 |
return flatbuffers.field_int16(buf_, pos_, 16, 0) |
| 28 |
def maybe_i16() -> int, bool: |
| 29 |
return flatbuffers.field_int16(buf_, pos_, 18, 0), flatbuffers.field_present(buf_, pos_, 18) |
| 30 |
def default_i16() -> int: |
| 31 |
return flatbuffers.field_int16(buf_, pos_, 20, 42) |
| 32 |
def just_u16() -> int: |
| 33 |
return flatbuffers.field_uint16(buf_, pos_, 22, 0) |
| 34 |
def maybe_u16() -> int, bool: |
| 35 |
return flatbuffers.field_uint16(buf_, pos_, 24, 0), flatbuffers.field_present(buf_, pos_, 24) |
| 36 |
def default_u16() -> int: |
| 37 |
return flatbuffers.field_uint16(buf_, pos_, 26, 42) |
| 38 |
def just_i32() -> int: |
| 39 |
return flatbuffers.field_int32(buf_, pos_, 28, 0) |
| 40 |
def maybe_i32() -> int, bool: |
| 41 |
return flatbuffers.field_int32(buf_, pos_, 30, 0), flatbuffers.field_present(buf_, pos_, 30) |
| 42 |
def default_i32() -> int: |
| 43 |
return flatbuffers.field_int32(buf_, pos_, 32, 42) |
| 44 |
def just_u32() -> int: |
| 45 |
return flatbuffers.field_uint32(buf_, pos_, 34, 0) |
| 46 |
def maybe_u32() -> int, bool: |
| 47 |
return flatbuffers.field_uint32(buf_, pos_, 36, 0), flatbuffers.field_present(buf_, pos_, 36) |
| 48 |
def default_u32() -> int: |
| 49 |
return flatbuffers.field_uint32(buf_, pos_, 38, 42) |
| 50 |
def just_i64() -> int: |
| 51 |
return flatbuffers.field_int64(buf_, pos_, 40, 0) |
| 52 |
def maybe_i64() -> int, bool: |
| 53 |
return flatbuffers.field_int64(buf_, pos_, 42, 0), flatbuffers.field_present(buf_, pos_, 42) |
| 54 |
def default_i64() -> int: |
| 55 |
return flatbuffers.field_int64(buf_, pos_, 44, 42) |
| 56 |
def just_u64() -> int: |
| 57 |
return flatbuffers.field_uint64(buf_, pos_, 46, 0) |
| 58 |
def maybe_u64() -> int, bool: |
| 59 |
return flatbuffers.field_uint64(buf_, pos_, 48, 0), flatbuffers.field_present(buf_, pos_, 48) |
| 60 |
def default_u64() -> int: |
| 61 |
return flatbuffers.field_uint64(buf_, pos_, 50, 42) |
| 62 |
def just_f32() -> float: |
| 63 |
return flatbuffers.field_float32(buf_, pos_, 52, 0.0) |
| 64 |
def maybe_f32() -> float, bool: |
| 65 |
return flatbuffers.field_float32(buf_, pos_, 54, 0.0), flatbuffers.field_present(buf_, pos_, 54) |
| 66 |
def default_f32() -> float: |
| 67 |
return flatbuffers.field_float32(buf_, pos_, 56, 42.0) |
| 68 |
def just_f64() -> float: |
| 69 |
return flatbuffers.field_float64(buf_, pos_, 58, 0.0) |
| 70 |
def maybe_f64() -> float, bool: |
| 71 |
return flatbuffers.field_float64(buf_, pos_, 60, 0.0), flatbuffers.field_present(buf_, pos_, 60) |
| 72 |
def default_f64() -> float: |
| 73 |
return flatbuffers.field_float64(buf_, pos_, 62, 42.0) |
| 74 |
def just_bool() -> bool: |
| 75 |
return bool(flatbuffers.field_int8(buf_, pos_, 64, 0)) |
| 76 |
def maybe_bool() -> bool, bool: |
| 77 |
return bool(flatbuffers.field_int8(buf_, pos_, 66, 0)), flatbuffers.field_present(buf_, pos_, 66) |
| 78 |
def default_bool() -> bool: |
| 79 |
return bool(flatbuffers.field_int8(buf_, pos_, 68, 1)) |
| 80 |
def just_enum() -> OptionalByte: |
| 81 |
return OptionalByte(flatbuffers.field_int8(buf_, pos_, 70, 0)) |
| 82 |
def maybe_enum() -> OptionalByte, bool: |
| 83 |
return OptionalByte(flatbuffers.field_int8(buf_, pos_, 72, 0)), flatbuffers.field_present(buf_, pos_, 72) |
| 84 |
def default_enum() -> OptionalByte: |
| 85 |
return OptionalByte(flatbuffers.field_int8(buf_, pos_, 74, 1)) |
| 86 |
|
| 87 |
def GetRootAsScalarStuff(buf:string): return ScalarStuff { buf, flatbuffers.indirect(buf, 0) } |
| 88 |
|
| 89 |
struct ScalarStuffBuilder: |
| 90 |
b_:flatbuffers.builder |
| 91 |
def start(): |
| 92 |
b_.StartObject(36) |
| 93 |
return this |
| 94 |
def add_just_i8(just_i8:int): |
| 95 |
b_.PrependInt8Slot(0, just_i8, 0) |
| 96 |
return this |
| 97 |
def add_maybe_i8(maybe_i8:int): |
| 98 |
b_.PrependInt8Slot(1, maybe_i8) |
| 99 |
return this |
| 100 |
def add_default_i8(default_i8:int): |
| 101 |
b_.PrependInt8Slot(2, default_i8, 42) |
| 102 |
return this |
| 103 |
def add_just_u8(just_u8:int): |
| 104 |
b_.PrependUint8Slot(3, just_u8, 0) |
| 105 |
return this |
| 106 |
def add_maybe_u8(maybe_u8:int): |
| 107 |
b_.PrependUint8Slot(4, maybe_u8) |
| 108 |
return this |
| 109 |
def add_default_u8(default_u8:int): |
| 110 |
b_.PrependUint8Slot(5, default_u8, 42) |
| 111 |
return this |
| 112 |
def add_just_i16(just_i16:int): |
| 113 |
b_.PrependInt16Slot(6, just_i16, 0) |
| 114 |
return this |
| 115 |
def add_maybe_i16(maybe_i16:int): |
| 116 |
b_.PrependInt16Slot(7, maybe_i16) |
| 117 |
return this |
| 118 |
def add_default_i16(default_i16:int): |
| 119 |
b_.PrependInt16Slot(8, default_i16, 42) |
| 120 |
return this |
| 121 |
def add_just_u16(just_u16:int): |
| 122 |
b_.PrependUint16Slot(9, just_u16, 0) |
| 123 |
return this |
| 124 |
def add_maybe_u16(maybe_u16:int): |
| 125 |
b_.PrependUint16Slot(10, maybe_u16) |
| 126 |
return this |
| 127 |
def add_default_u16(default_u16:int): |
| 128 |
b_.PrependUint16Slot(11, default_u16, 42) |
| 129 |
return this |
| 130 |
def add_just_i32(just_i32:int): |
| 131 |
b_.PrependInt32Slot(12, just_i32, 0) |
| 132 |
return this |
| 133 |
def add_maybe_i32(maybe_i32:int): |
| 134 |
b_.PrependInt32Slot(13, maybe_i32) |
| 135 |
return this |
| 136 |
def add_default_i32(default_i32:int): |
| 137 |
b_.PrependInt32Slot(14, default_i32, 42) |
| 138 |
return this |
| 139 |
def add_just_u32(just_u32:int): |
| 140 |
b_.PrependUint32Slot(15, just_u32, 0) |
| 141 |
return this |
| 142 |
def add_maybe_u32(maybe_u32:int): |
| 143 |
b_.PrependUint32Slot(16, maybe_u32) |
| 144 |
return this |
| 145 |
def add_default_u32(default_u32:int): |
| 146 |
b_.PrependUint32Slot(17, default_u32, 42) |
| 147 |
return this |
| 148 |
def add_just_i64(just_i64:int): |
| 149 |
b_.PrependInt64Slot(18, just_i64, 0) |
| 150 |
return this |
| 151 |
def add_maybe_i64(maybe_i64:int): |
| 152 |
b_.PrependInt64Slot(19, maybe_i64) |
| 153 |
return this |
| 154 |
def add_default_i64(default_i64:int): |
| 155 |
b_.PrependInt64Slot(20, default_i64, 42) |
| 156 |
return this |
| 157 |
def add_just_u64(just_u64:int): |
| 158 |
b_.PrependUint64Slot(21, just_u64, 0) |
| 159 |
return this |
| 160 |
def add_maybe_u64(maybe_u64:int): |
| 161 |
b_.PrependUint64Slot(22, maybe_u64) |
| 162 |
return this |
| 163 |
def add_default_u64(default_u64:int): |
| 164 |
b_.PrependUint64Slot(23, default_u64, 42) |
| 165 |
return this |
| 166 |
def add_just_f32(just_f32:float): |
| 167 |
b_.PrependFloat32Slot(24, just_f32, 0.0) |
| 168 |
return this |
| 169 |
def add_maybe_f32(maybe_f32:float): |
| 170 |
b_.PrependFloat32Slot(25, maybe_f32) |
| 171 |
return this |
| 172 |
def add_default_f32(default_f32:float): |
| 173 |
b_.PrependFloat32Slot(26, default_f32, 42.0) |
| 174 |
return this |
| 175 |
def add_just_f64(just_f64:float): |
| 176 |
b_.PrependFloat64Slot(27, just_f64, 0.0) |
| 177 |
return this |
| 178 |
def add_maybe_f64(maybe_f64:float): |
| 179 |
b_.PrependFloat64Slot(28, maybe_f64) |
| 180 |
return this |
| 181 |
def add_default_f64(default_f64:float): |
| 182 |
b_.PrependFloat64Slot(29, default_f64, 42.0) |
| 183 |
return this |
| 184 |
def add_just_bool(just_bool:bool): |
| 185 |
b_.PrependBoolSlot(30, just_bool, 0) |
| 186 |
return this |
| 187 |
def add_maybe_bool(maybe_bool:bool): |
| 188 |
b_.PrependBoolSlot(31, maybe_bool) |
| 189 |
return this |
| 190 |
def add_default_bool(default_bool:bool): |
| 191 |
b_.PrependBoolSlot(32, default_bool, 1) |
| 192 |
return this |
| 193 |
def add_just_enum(just_enum:OptionalByte): |
| 194 |
b_.PrependInt8Slot(33, just_enum, 0) |
| 195 |
return this |
| 196 |
def add_maybe_enum(maybe_enum:OptionalByte): |
| 197 |
b_.PrependInt8Slot(34, maybe_enum) |
| 198 |
return this |
| 199 |
def add_default_enum(default_enum:OptionalByte): |
| 200 |
b_.PrependInt8Slot(35, default_enum, 1) |
| 201 |
return this |
| 202 |
def end(): |
| 203 |
return b_.EndObject() |
| 204 |
|