1// automatically generated by the FlatBuffers compiler, do not modify 2import flatbuffers 3 4namespace MyGame_Example 5 6/// Composite components of Monster color. 7enum Color: 8 Color_Red = 1 9 /// \brief color Green 10 /// Green is bit_flag with value (1u << 1) 11 Color_Green = 2 12 /// \brief color Blue (1u << 3) 13 Color_Blue = 8 14 15enum Race: 16 Race_None = -1 17 Race_Human = 0 18 Race_Dwarf = 1 19 Race_Elf = 2 20 21enum Any: 22 Any_NONE = 0 23 Any_Monster = 1 24 Any_TestSimpleTableWithEnum = 2 25 Any_MyGame_Example2_Monster = 3 26 27enum AnyUniqueAliases: 28 AnyUniqueAliases_NONE = 0 29 AnyUniqueAliases_M = 1 30 AnyUniqueAliases_TS = 2 31 AnyUniqueAliases_M2 = 3 32 33enum AnyAmbiguousAliases: 34 AnyAmbiguousAliases_NONE = 0 35 AnyAmbiguousAliases_M1 = 1 36 AnyAmbiguousAliases_M2 = 2 37 AnyAmbiguousAliases_M3 = 3 38 39namespace MyGame 40 41class InParentNamespace 42 43namespace MyGame_Example2 44 45class Monster 46 47namespace MyGame_Example 48 49class Test 50 51class TestSimpleTableWithEnum 52 53class Vec3 54 55class Ability 56 57class Stat 58 59class Referrable 60 61class Monster 62 63class TypeAliases 64 65namespace MyGame 66 67class InParentNamespace : flatbuffers_handle 68 69def GetRootAsInParentNamespace(buf:string): return InParentNamespace { buf, buf.flatbuffers_indirect(0) } 70 71struct InParentNamespaceBuilder: 72 b_:flatbuffers_builder 73 def start(): 74 b_.StartObject(0) 75 return this 76 def end(): 77 return b_.EndObject() 78 79namespace MyGame_Example2 80 81class Monster : flatbuffers_handle 82 83def GetRootAsMonster(buf:string): return Monster { buf, buf.flatbuffers_indirect(0) } 84 85struct MonsterBuilder: 86 b_:flatbuffers_builder 87 def start(): 88 b_.StartObject(0) 89 return this 90 def end(): 91 return b_.EndObject() 92 93namespace MyGame_Example 94 95class Test : flatbuffers_handle 96 def a(): 97 return buf_.read_int16_le(pos_ + 0) 98 def b(): 99 return buf_.read_int8_le(pos_ + 2) 100 101def CreateTest(b_:flatbuffers_builder, a:int, b:int): 102 b_.Prep(2, 4) 103 b_.Pad(1) 104 b_.PrependInt8(b) 105 b_.PrependInt16(a) 106 return b_.Offset() 107 108class TestSimpleTableWithEnum : flatbuffers_handle 109 def color(): 110 return Color(buf_.flatbuffers_field_int8(pos_, 4, 2)) 111 112def GetRootAsTestSimpleTableWithEnum(buf:string): return TestSimpleTableWithEnum { buf, buf.flatbuffers_indirect(0) } 113 114struct TestSimpleTableWithEnumBuilder: 115 b_:flatbuffers_builder 116 def start(): 117 b_.StartObject(1) 118 return this 119 def add_color(color:Color): 120 b_.PrependUint8Slot(0, color, 2) 121 return this 122 def end(): 123 return b_.EndObject() 124 125class Vec3 : flatbuffers_handle 126 def x(): 127 return buf_.read_float32_le(pos_ + 0) 128 def y(): 129 return buf_.read_float32_le(pos_ + 4) 130 def z(): 131 return buf_.read_float32_le(pos_ + 8) 132 def test1(): 133 return buf_.read_float64_le(pos_ + 16) 134 def test2(): 135 return Color(buf_.read_int8_le(pos_ + 24)) 136 def test3(): 137 return MyGame_Example_Test{ buf_, pos_ + 26 } 138 139def CreateVec3(b_:flatbuffers_builder, x:float, y:float, z:float, test1:float, test2:Color, test3_a:int, test3_b:int): 140 b_.Prep(8, 32) 141 b_.Pad(2) 142 b_.Prep(2, 4) 143 b_.Pad(1) 144 b_.PrependInt8(test3_b) 145 b_.PrependInt16(test3_a) 146 b_.Pad(1) 147 b_.PrependUint8(test2) 148 b_.PrependFloat64(test1) 149 b_.Pad(4) 150 b_.PrependFloat32(z) 151 b_.PrependFloat32(y) 152 b_.PrependFloat32(x) 153 return b_.Offset() 154 155class Ability : flatbuffers_handle 156 def id(): 157 return buf_.read_int32_le(pos_ + 0) 158 def distance(): 159 return buf_.read_int32_le(pos_ + 4) 160 161def CreateAbility(b_:flatbuffers_builder, id:int, distance:int): 162 b_.Prep(4, 8) 163 b_.PrependUint32(distance) 164 b_.PrependUint32(id) 165 return b_.Offset() 166 167class Stat : flatbuffers_handle 168 def id(): 169 return buf_.flatbuffers_field_string(pos_, 4) 170 def val(): 171 return buf_.flatbuffers_field_int64(pos_, 6, 0) 172 def count(): 173 return buf_.flatbuffers_field_int16(pos_, 8, 0) 174 175def GetRootAsStat(buf:string): return Stat { buf, buf.flatbuffers_indirect(0) } 176 177struct StatBuilder: 178 b_:flatbuffers_builder 179 def start(): 180 b_.StartObject(3) 181 return this 182 def add_id(id:flatbuffers_offset): 183 b_.PrependUOffsetTRelativeSlot(0, id) 184 return this 185 def add_val(val:int): 186 b_.PrependInt64Slot(1, val, 0) 187 return this 188 def add_count(count:int): 189 b_.PrependUint16Slot(2, count, 0) 190 return this 191 def end(): 192 return b_.EndObject() 193 194class Referrable : flatbuffers_handle 195 def id(): 196 return buf_.flatbuffers_field_int64(pos_, 4, 0) 197 198def GetRootAsReferrable(buf:string): return Referrable { buf, buf.flatbuffers_indirect(0) } 199 200struct ReferrableBuilder: 201 b_:flatbuffers_builder 202 def start(): 203 b_.StartObject(1) 204 return this 205 def add_id(id:int): 206 b_.PrependUint64Slot(0, id, 0) 207 return this 208 def end(): 209 return b_.EndObject() 210 211/// an example documentation comment: "monster object" 212class Monster : flatbuffers_handle 213 def pos(): 214 let o = buf_.flatbuffers_field_struct(pos_, 4) 215 return if o: MyGame_Example_Vec3 { buf_, o } else: nil 216 def mana(): 217 return buf_.flatbuffers_field_int16(pos_, 6, 150) 218 def hp(): 219 return buf_.flatbuffers_field_int16(pos_, 8, 100) 220 def name(): 221 return buf_.flatbuffers_field_string(pos_, 10) 222 def inventory(i:int): 223 return buf_.read_int8_le(buf_.flatbuffers_field_vector(pos_, 14) + i * 1) 224 def inventory_length(): 225 return buf_.flatbuffers_field_vector_len(pos_, 14) 226 def color(): 227 return Color(buf_.flatbuffers_field_int8(pos_, 16, 8)) 228 def test_type(): 229 return Any(buf_.flatbuffers_field_int8(pos_, 18, 0)) 230 def test_as_Monster(): 231 return MyGame_Example_Monster { buf_, buf_.flatbuffers_field_table(pos_, 20) } 232 def test_as_TestSimpleTableWithEnum(): 233 return MyGame_Example_TestSimpleTableWithEnum { buf_, buf_.flatbuffers_field_table(pos_, 20) } 234 def test_as_MyGame_Example2_Monster(): 235 return MyGame_Example2_Monster { buf_, buf_.flatbuffers_field_table(pos_, 20) } 236 def test4(i:int): 237 return MyGame_Example_Test { buf_, buf_.flatbuffers_field_vector(pos_, 22) + i * 4 } 238 def test4_length(): 239 return buf_.flatbuffers_field_vector_len(pos_, 22) 240 def testarrayofstring(i:int): 241 return buf_.flatbuffers_string(buf_.flatbuffers_field_vector(pos_, 24) + i * 4) 242 def testarrayofstring_length(): 243 return buf_.flatbuffers_field_vector_len(pos_, 24) 244 /// an example documentation comment: this will end up in the generated code 245 /// multiline too 246 def testarrayoftables(i:int): 247 return MyGame_Example_Monster { buf_, buf_.flatbuffers_indirect(buf_.flatbuffers_field_vector(pos_, 26) + i * 4) } 248 def testarrayoftables_length(): 249 return buf_.flatbuffers_field_vector_len(pos_, 26) 250 def enemy(): 251 let o = buf_.flatbuffers_field_table(pos_, 28) 252 return if o: MyGame_Example_Monster { buf_, o } else: nil 253 def testnestedflatbuffer(i:int): 254 return buf_.read_int8_le(buf_.flatbuffers_field_vector(pos_, 30) + i * 1) 255 def testnestedflatbuffer_length(): 256 return buf_.flatbuffers_field_vector_len(pos_, 30) 257 def testempty(): 258 let o = buf_.flatbuffers_field_table(pos_, 32) 259 return if o: MyGame_Example_Stat { buf_, o } else: nil 260 def testbool(): 261 return buf_.flatbuffers_field_int8(pos_, 34, 0) 262 def testhashs32_fnv1(): 263 return buf_.flatbuffers_field_int32(pos_, 36, 0) 264 def testhashu32_fnv1(): 265 return buf_.flatbuffers_field_int32(pos_, 38, 0) 266 def testhashs64_fnv1(): 267 return buf_.flatbuffers_field_int64(pos_, 40, 0) 268 def testhashu64_fnv1(): 269 return buf_.flatbuffers_field_int64(pos_, 42, 0) 270 def testhashs32_fnv1a(): 271 return buf_.flatbuffers_field_int32(pos_, 44, 0) 272 def testhashu32_fnv1a(): 273 return buf_.flatbuffers_field_int32(pos_, 46, 0) 274 def testhashs64_fnv1a(): 275 return buf_.flatbuffers_field_int64(pos_, 48, 0) 276 def testhashu64_fnv1a(): 277 return buf_.flatbuffers_field_int64(pos_, 50, 0) 278 def testarrayofbools(i:int): 279 return buf_.read_int8_le(buf_.flatbuffers_field_vector(pos_, 52) + i * 1) 280 def testarrayofbools_length(): 281 return buf_.flatbuffers_field_vector_len(pos_, 52) 282 def testf(): 283 return buf_.flatbuffers_field_float32(pos_, 54, 3.14159) 284 def testf2(): 285 return buf_.flatbuffers_field_float32(pos_, 56, 3.0) 286 def testf3(): 287 return buf_.flatbuffers_field_float32(pos_, 58, 0.0) 288 def testarrayofstring2(i:int): 289 return buf_.flatbuffers_string(buf_.flatbuffers_field_vector(pos_, 60) + i * 4) 290 def testarrayofstring2_length(): 291 return buf_.flatbuffers_field_vector_len(pos_, 60) 292 def testarrayofsortedstruct(i:int): 293 return MyGame_Example_Ability { buf_, buf_.flatbuffers_field_vector(pos_, 62) + i * 8 } 294 def testarrayofsortedstruct_length(): 295 return buf_.flatbuffers_field_vector_len(pos_, 62) 296 def flex(i:int): 297 return buf_.read_int8_le(buf_.flatbuffers_field_vector(pos_, 64) + i * 1) 298 def flex_length(): 299 return buf_.flatbuffers_field_vector_len(pos_, 64) 300 def test5(i:int): 301 return MyGame_Example_Test { buf_, buf_.flatbuffers_field_vector(pos_, 66) + i * 4 } 302 def test5_length(): 303 return buf_.flatbuffers_field_vector_len(pos_, 66) 304 def vector_of_longs(i:int): 305 return buf_.read_int64_le(buf_.flatbuffers_field_vector(pos_, 68) + i * 8) 306 def vector_of_longs_length(): 307 return buf_.flatbuffers_field_vector_len(pos_, 68) 308 def vector_of_doubles(i:int): 309 return buf_.read_float64_le(buf_.flatbuffers_field_vector(pos_, 70) + i * 8) 310 def vector_of_doubles_length(): 311 return buf_.flatbuffers_field_vector_len(pos_, 70) 312 def parent_namespace_test(): 313 let o = buf_.flatbuffers_field_table(pos_, 72) 314 return if o: MyGame_InParentNamespace { buf_, o } else: nil 315 def vector_of_referrables(i:int): 316 return MyGame_Example_Referrable { buf_, buf_.flatbuffers_indirect(buf_.flatbuffers_field_vector(pos_, 74) + i * 4) } 317 def vector_of_referrables_length(): 318 return buf_.flatbuffers_field_vector_len(pos_, 74) 319 def single_weak_reference(): 320 return buf_.flatbuffers_field_int64(pos_, 76, 0) 321 def vector_of_weak_references(i:int): 322 return buf_.read_int64_le(buf_.flatbuffers_field_vector(pos_, 78) + i * 8) 323 def vector_of_weak_references_length(): 324 return buf_.flatbuffers_field_vector_len(pos_, 78) 325 def vector_of_strong_referrables(i:int): 326 return MyGame_Example_Referrable { buf_, buf_.flatbuffers_indirect(buf_.flatbuffers_field_vector(pos_, 80) + i * 4) } 327 def vector_of_strong_referrables_length(): 328 return buf_.flatbuffers_field_vector_len(pos_, 80) 329 def co_owning_reference(): 330 return buf_.flatbuffers_field_int64(pos_, 82, 0) 331 def vector_of_co_owning_references(i:int): 332 return buf_.read_int64_le(buf_.flatbuffers_field_vector(pos_, 84) + i * 8) 333 def vector_of_co_owning_references_length(): 334 return buf_.flatbuffers_field_vector_len(pos_, 84) 335 def non_owning_reference(): 336 return buf_.flatbuffers_field_int64(pos_, 86, 0) 337 def vector_of_non_owning_references(i:int): 338 return buf_.read_int64_le(buf_.flatbuffers_field_vector(pos_, 88) + i * 8) 339 def vector_of_non_owning_references_length(): 340 return buf_.flatbuffers_field_vector_len(pos_, 88) 341 def any_unique_type(): 342 return AnyUniqueAliases(buf_.flatbuffers_field_int8(pos_, 90, 0)) 343 def any_unique_as_M(): 344 return MyGame_Example_Monster { buf_, buf_.flatbuffers_field_table(pos_, 92) } 345 def any_unique_as_TS(): 346 return MyGame_Example_TestSimpleTableWithEnum { buf_, buf_.flatbuffers_field_table(pos_, 92) } 347 def any_unique_as_M2(): 348 return MyGame_Example2_Monster { buf_, buf_.flatbuffers_field_table(pos_, 92) } 349 def any_ambiguous_type(): 350 return AnyAmbiguousAliases(buf_.flatbuffers_field_int8(pos_, 94, 0)) 351 def any_ambiguous_as_M1(): 352 return MyGame_Example_Monster { buf_, buf_.flatbuffers_field_table(pos_, 96) } 353 def any_ambiguous_as_M2(): 354 return MyGame_Example_Monster { buf_, buf_.flatbuffers_field_table(pos_, 96) } 355 def any_ambiguous_as_M3(): 356 return MyGame_Example_Monster { buf_, buf_.flatbuffers_field_table(pos_, 96) } 357 def vector_of_enums(i:int): 358 return buf_.read_int8_le(buf_.flatbuffers_field_vector(pos_, 98) + i * 1) 359 def vector_of_enums_length(): 360 return buf_.flatbuffers_field_vector_len(pos_, 98) 361 def signed_enum(): 362 return Race(buf_.flatbuffers_field_int8(pos_, 100, -1)) 363 364def GetRootAsMonster(buf:string): return Monster { buf, buf.flatbuffers_indirect(0) } 365 366struct MonsterBuilder: 367 b_:flatbuffers_builder 368 def start(): 369 b_.StartObject(49) 370 return this 371 def add_pos(pos:flatbuffers_offset): 372 b_.PrependStructSlot(0, pos) 373 return this 374 def add_mana(mana:int): 375 b_.PrependInt16Slot(1, mana, 150) 376 return this 377 def add_hp(hp:int): 378 b_.PrependInt16Slot(2, hp, 100) 379 return this 380 def add_name(name:flatbuffers_offset): 381 b_.PrependUOffsetTRelativeSlot(3, name) 382 return this 383 def add_inventory(inventory:flatbuffers_offset): 384 b_.PrependUOffsetTRelativeSlot(5, inventory) 385 return this 386 def add_color(color:Color): 387 b_.PrependUint8Slot(6, color, 8) 388 return this 389 def add_test_type(test_type:Any): 390 b_.PrependUint8Slot(7, test_type, 0) 391 return this 392 def add_test(test:flatbuffers_offset): 393 b_.PrependUOffsetTRelativeSlot(8, test) 394 return this 395 def add_test4(test4:flatbuffers_offset): 396 b_.PrependUOffsetTRelativeSlot(9, test4) 397 return this 398 def add_testarrayofstring(testarrayofstring:flatbuffers_offset): 399 b_.PrependUOffsetTRelativeSlot(10, testarrayofstring) 400 return this 401 def add_testarrayoftables(testarrayoftables:flatbuffers_offset): 402 b_.PrependUOffsetTRelativeSlot(11, testarrayoftables) 403 return this 404 def add_enemy(enemy:flatbuffers_offset): 405 b_.PrependUOffsetTRelativeSlot(12, enemy) 406 return this 407 def add_testnestedflatbuffer(testnestedflatbuffer:flatbuffers_offset): 408 b_.PrependUOffsetTRelativeSlot(13, testnestedflatbuffer) 409 return this 410 def add_testempty(testempty:flatbuffers_offset): 411 b_.PrependUOffsetTRelativeSlot(14, testempty) 412 return this 413 def add_testbool(testbool:int): 414 b_.PrependBoolSlot(15, testbool, 0) 415 return this 416 def add_testhashs32_fnv1(testhashs32_fnv1:int): 417 b_.PrependInt32Slot(16, testhashs32_fnv1, 0) 418 return this 419 def add_testhashu32_fnv1(testhashu32_fnv1:int): 420 b_.PrependUint32Slot(17, testhashu32_fnv1, 0) 421 return this 422 def add_testhashs64_fnv1(testhashs64_fnv1:int): 423 b_.PrependInt64Slot(18, testhashs64_fnv1, 0) 424 return this 425 def add_testhashu64_fnv1(testhashu64_fnv1:int): 426 b_.PrependUint64Slot(19, testhashu64_fnv1, 0) 427 return this 428 def add_testhashs32_fnv1a(testhashs32_fnv1a:int): 429 b_.PrependInt32Slot(20, testhashs32_fnv1a, 0) 430 return this 431 def add_testhashu32_fnv1a(testhashu32_fnv1a:int): 432 b_.PrependUint32Slot(21, testhashu32_fnv1a, 0) 433 return this 434 def add_testhashs64_fnv1a(testhashs64_fnv1a:int): 435 b_.PrependInt64Slot(22, testhashs64_fnv1a, 0) 436 return this 437 def add_testhashu64_fnv1a(testhashu64_fnv1a:int): 438 b_.PrependUint64Slot(23, testhashu64_fnv1a, 0) 439 return this 440 def add_testarrayofbools(testarrayofbools:flatbuffers_offset): 441 b_.PrependUOffsetTRelativeSlot(24, testarrayofbools) 442 return this 443 def add_testf(testf:float): 444 b_.PrependFloat32Slot(25, testf, 3.14159) 445 return this 446 def add_testf2(testf2:float): 447 b_.PrependFloat32Slot(26, testf2, 3.0) 448 return this 449 def add_testf3(testf3:float): 450 b_.PrependFloat32Slot(27, testf3, 0.0) 451 return this 452 def add_testarrayofstring2(testarrayofstring2:flatbuffers_offset): 453 b_.PrependUOffsetTRelativeSlot(28, testarrayofstring2) 454 return this 455 def add_testarrayofsortedstruct(testarrayofsortedstruct:flatbuffers_offset): 456 b_.PrependUOffsetTRelativeSlot(29, testarrayofsortedstruct) 457 return this 458 def add_flex(flex:flatbuffers_offset): 459 b_.PrependUOffsetTRelativeSlot(30, flex) 460 return this 461 def add_test5(test5:flatbuffers_offset): 462 b_.PrependUOffsetTRelativeSlot(31, test5) 463 return this 464 def add_vector_of_longs(vector_of_longs:flatbuffers_offset): 465 b_.PrependUOffsetTRelativeSlot(32, vector_of_longs) 466 return this 467 def add_vector_of_doubles(vector_of_doubles:flatbuffers_offset): 468 b_.PrependUOffsetTRelativeSlot(33, vector_of_doubles) 469 return this 470 def add_parent_namespace_test(parent_namespace_test:flatbuffers_offset): 471 b_.PrependUOffsetTRelativeSlot(34, parent_namespace_test) 472 return this 473 def add_vector_of_referrables(vector_of_referrables:flatbuffers_offset): 474 b_.PrependUOffsetTRelativeSlot(35, vector_of_referrables) 475 return this 476 def add_single_weak_reference(single_weak_reference:int): 477 b_.PrependUint64Slot(36, single_weak_reference, 0) 478 return this 479 def add_vector_of_weak_references(vector_of_weak_references:flatbuffers_offset): 480 b_.PrependUOffsetTRelativeSlot(37, vector_of_weak_references) 481 return this 482 def add_vector_of_strong_referrables(vector_of_strong_referrables:flatbuffers_offset): 483 b_.PrependUOffsetTRelativeSlot(38, vector_of_strong_referrables) 484 return this 485 def add_co_owning_reference(co_owning_reference:int): 486 b_.PrependUint64Slot(39, co_owning_reference, 0) 487 return this 488 def add_vector_of_co_owning_references(vector_of_co_owning_references:flatbuffers_offset): 489 b_.PrependUOffsetTRelativeSlot(40, vector_of_co_owning_references) 490 return this 491 def add_non_owning_reference(non_owning_reference:int): 492 b_.PrependUint64Slot(41, non_owning_reference, 0) 493 return this 494 def add_vector_of_non_owning_references(vector_of_non_owning_references:flatbuffers_offset): 495 b_.PrependUOffsetTRelativeSlot(42, vector_of_non_owning_references) 496 return this 497 def add_any_unique_type(any_unique_type:AnyUniqueAliases): 498 b_.PrependUint8Slot(43, any_unique_type, 0) 499 return this 500 def add_any_unique(any_unique:flatbuffers_offset): 501 b_.PrependUOffsetTRelativeSlot(44, any_unique) 502 return this 503 def add_any_ambiguous_type(any_ambiguous_type:AnyAmbiguousAliases): 504 b_.PrependUint8Slot(45, any_ambiguous_type, 0) 505 return this 506 def add_any_ambiguous(any_ambiguous:flatbuffers_offset): 507 b_.PrependUOffsetTRelativeSlot(46, any_ambiguous) 508 return this 509 def add_vector_of_enums(vector_of_enums:flatbuffers_offset): 510 b_.PrependUOffsetTRelativeSlot(47, vector_of_enums) 511 return this 512 def add_signed_enum(signed_enum:Race): 513 b_.PrependInt8Slot(48, signed_enum, -1) 514 return this 515 def end(): 516 return b_.EndObject() 517 518def MonsterStartInventoryVector(b_:flatbuffers_builder, n_:int): 519 b_.StartVector(1, n_, 1) 520def MonsterCreateInventoryVector(b_:flatbuffers_builder, v_:[int]): 521 b_.StartVector(1, v_.length, 1) 522 reverse(v_) e_: b_.PrependUint8(e_) 523 return b_.EndVector(v_.length) 524 525def MonsterStartTest4Vector(b_:flatbuffers_builder, n_:int): 526 b_.StartVector(4, n_, 2) 527 528def MonsterStartTestarrayofstringVector(b_:flatbuffers_builder, n_:int): 529 b_.StartVector(4, n_, 4) 530def MonsterCreateTestarrayofstringVector(b_:flatbuffers_builder, v_:[flatbuffers_offset]): 531 b_.StartVector(4, v_.length, 4) 532 reverse(v_) e_: b_.PrependUOffsetTRelative(e_) 533 return b_.EndVector(v_.length) 534 535def MonsterStartTestarrayoftablesVector(b_:flatbuffers_builder, n_:int): 536 b_.StartVector(4, n_, 4) 537def MonsterCreateTestarrayoftablesVector(b_:flatbuffers_builder, v_:[flatbuffers_offset]): 538 b_.StartVector(4, v_.length, 4) 539 reverse(v_) e_: b_.PrependUOffsetTRelative(e_) 540 return b_.EndVector(v_.length) 541 542def MonsterStartTestnestedflatbufferVector(b_:flatbuffers_builder, n_:int): 543 b_.StartVector(1, n_, 1) 544def MonsterCreateTestnestedflatbufferVector(b_:flatbuffers_builder, v_:[int]): 545 b_.StartVector(1, v_.length, 1) 546 reverse(v_) e_: b_.PrependUint8(e_) 547 return b_.EndVector(v_.length) 548 549def MonsterStartTestarrayofboolsVector(b_:flatbuffers_builder, n_:int): 550 b_.StartVector(1, n_, 1) 551def MonsterCreateTestarrayofboolsVector(b_:flatbuffers_builder, v_:[int]): 552 b_.StartVector(1, v_.length, 1) 553 reverse(v_) e_: b_.PrependBool(e_) 554 return b_.EndVector(v_.length) 555 556def MonsterStartTestarrayofstring2Vector(b_:flatbuffers_builder, n_:int): 557 b_.StartVector(4, n_, 4) 558def MonsterCreateTestarrayofstring2Vector(b_:flatbuffers_builder, v_:[flatbuffers_offset]): 559 b_.StartVector(4, v_.length, 4) 560 reverse(v_) e_: b_.PrependUOffsetTRelative(e_) 561 return b_.EndVector(v_.length) 562 563def MonsterStartTestarrayofsortedstructVector(b_:flatbuffers_builder, n_:int): 564 b_.StartVector(8, n_, 4) 565 566def MonsterStartFlexVector(b_:flatbuffers_builder, n_:int): 567 b_.StartVector(1, n_, 1) 568def MonsterCreateFlexVector(b_:flatbuffers_builder, v_:[int]): 569 b_.StartVector(1, v_.length, 1) 570 reverse(v_) e_: b_.PrependUint8(e_) 571 return b_.EndVector(v_.length) 572 573def MonsterStartTest5Vector(b_:flatbuffers_builder, n_:int): 574 b_.StartVector(4, n_, 2) 575 576def MonsterStartVectorOfLongsVector(b_:flatbuffers_builder, n_:int): 577 b_.StartVector(8, n_, 8) 578def MonsterCreateVectorOfLongsVector(b_:flatbuffers_builder, v_:[int]): 579 b_.StartVector(8, v_.length, 8) 580 reverse(v_) e_: b_.PrependInt64(e_) 581 return b_.EndVector(v_.length) 582 583def MonsterStartVectorOfDoublesVector(b_:flatbuffers_builder, n_:int): 584 b_.StartVector(8, n_, 8) 585def MonsterCreateVectorOfDoublesVector(b_:flatbuffers_builder, v_:[float]): 586 b_.StartVector(8, v_.length, 8) 587 reverse(v_) e_: b_.PrependFloat64(e_) 588 return b_.EndVector(v_.length) 589 590def MonsterStartVectorOfReferrablesVector(b_:flatbuffers_builder, n_:int): 591 b_.StartVector(4, n_, 4) 592def MonsterCreateVectorOfReferrablesVector(b_:flatbuffers_builder, v_:[flatbuffers_offset]): 593 b_.StartVector(4, v_.length, 4) 594 reverse(v_) e_: b_.PrependUOffsetTRelative(e_) 595 return b_.EndVector(v_.length) 596 597def MonsterStartVectorOfWeakReferencesVector(b_:flatbuffers_builder, n_:int): 598 b_.StartVector(8, n_, 8) 599def MonsterCreateVectorOfWeakReferencesVector(b_:flatbuffers_builder, v_:[int]): 600 b_.StartVector(8, v_.length, 8) 601 reverse(v_) e_: b_.PrependUint64(e_) 602 return b_.EndVector(v_.length) 603 604def MonsterStartVectorOfStrongReferrablesVector(b_:flatbuffers_builder, n_:int): 605 b_.StartVector(4, n_, 4) 606def MonsterCreateVectorOfStrongReferrablesVector(b_:flatbuffers_builder, v_:[flatbuffers_offset]): 607 b_.StartVector(4, v_.length, 4) 608 reverse(v_) e_: b_.PrependUOffsetTRelative(e_) 609 return b_.EndVector(v_.length) 610 611def MonsterStartVectorOfCoOwningReferencesVector(b_:flatbuffers_builder, n_:int): 612 b_.StartVector(8, n_, 8) 613def MonsterCreateVectorOfCoOwningReferencesVector(b_:flatbuffers_builder, v_:[int]): 614 b_.StartVector(8, v_.length, 8) 615 reverse(v_) e_: b_.PrependUint64(e_) 616 return b_.EndVector(v_.length) 617 618def MonsterStartVectorOfNonOwningReferencesVector(b_:flatbuffers_builder, n_:int): 619 b_.StartVector(8, n_, 8) 620def MonsterCreateVectorOfNonOwningReferencesVector(b_:flatbuffers_builder, v_:[int]): 621 b_.StartVector(8, v_.length, 8) 622 reverse(v_) e_: b_.PrependUint64(e_) 623 return b_.EndVector(v_.length) 624 625def MonsterStartVectorOfEnumsVector(b_:flatbuffers_builder, n_:int): 626 b_.StartVector(1, n_, 1) 627def MonsterCreateVectorOfEnumsVector(b_:flatbuffers_builder, v_:[Color]): 628 b_.StartVector(1, v_.length, 1) 629 reverse(v_) e_: b_.PrependUint8(e_) 630 return b_.EndVector(v_.length) 631 632class TypeAliases : flatbuffers_handle 633 def i8(): 634 return buf_.flatbuffers_field_int8(pos_, 4, 0) 635 def u8(): 636 return buf_.flatbuffers_field_int8(pos_, 6, 0) 637 def i16(): 638 return buf_.flatbuffers_field_int16(pos_, 8, 0) 639 def u16(): 640 return buf_.flatbuffers_field_int16(pos_, 10, 0) 641 def i32(): 642 return buf_.flatbuffers_field_int32(pos_, 12, 0) 643 def u32(): 644 return buf_.flatbuffers_field_int32(pos_, 14, 0) 645 def i64(): 646 return buf_.flatbuffers_field_int64(pos_, 16, 0) 647 def u64(): 648 return buf_.flatbuffers_field_int64(pos_, 18, 0) 649 def f32(): 650 return buf_.flatbuffers_field_float32(pos_, 20, 0.0) 651 def f64(): 652 return buf_.flatbuffers_field_float64(pos_, 22, 0.0) 653 def v8(i:int): 654 return buf_.read_int8_le(buf_.flatbuffers_field_vector(pos_, 24) + i * 1) 655 def v8_length(): 656 return buf_.flatbuffers_field_vector_len(pos_, 24) 657 def vf64(i:int): 658 return buf_.read_float64_le(buf_.flatbuffers_field_vector(pos_, 26) + i * 8) 659 def vf64_length(): 660 return buf_.flatbuffers_field_vector_len(pos_, 26) 661 662def GetRootAsTypeAliases(buf:string): return TypeAliases { buf, buf.flatbuffers_indirect(0) } 663 664struct TypeAliasesBuilder: 665 b_:flatbuffers_builder 666 def start(): 667 b_.StartObject(12) 668 return this 669 def add_i8(i8:int): 670 b_.PrependInt8Slot(0, i8, 0) 671 return this 672 def add_u8(u8:int): 673 b_.PrependUint8Slot(1, u8, 0) 674 return this 675 def add_i16(i16:int): 676 b_.PrependInt16Slot(2, i16, 0) 677 return this 678 def add_u16(u16:int): 679 b_.PrependUint16Slot(3, u16, 0) 680 return this 681 def add_i32(i32:int): 682 b_.PrependInt32Slot(4, i32, 0) 683 return this 684 def add_u32(u32:int): 685 b_.PrependUint32Slot(5, u32, 0) 686 return this 687 def add_i64(i64:int): 688 b_.PrependInt64Slot(6, i64, 0) 689 return this 690 def add_u64(u64:int): 691 b_.PrependUint64Slot(7, u64, 0) 692 return this 693 def add_f32(f32:float): 694 b_.PrependFloat32Slot(8, f32, 0.0) 695 return this 696 def add_f64(f64:float): 697 b_.PrependFloat64Slot(9, f64, 0.0) 698 return this 699 def add_v8(v8:flatbuffers_offset): 700 b_.PrependUOffsetTRelativeSlot(10, v8) 701 return this 702 def add_vf64(vf64:flatbuffers_offset): 703 b_.PrependUOffsetTRelativeSlot(11, vf64) 704 return this 705 def end(): 706 return b_.EndObject() 707 708def TypeAliasesStartV8Vector(b_:flatbuffers_builder, n_:int): 709 b_.StartVector(1, n_, 1) 710def TypeAliasesCreateV8Vector(b_:flatbuffers_builder, v_:[int]): 711 b_.StartVector(1, v_.length, 1) 712 reverse(v_) e_: b_.PrependInt8(e_) 713 return b_.EndVector(v_.length) 714 715def TypeAliasesStartVf64Vector(b_:flatbuffers_builder, n_:int): 716 b_.StartVector(8, n_, 8) 717def TypeAliasesCreateVf64Vector(b_:flatbuffers_builder, v_:[float]): 718 b_.StartVector(8, v_.length, 8) 719 reverse(v_) e_: b_.PrependFloat64(e_) 720 return b_.EndVector(v_.length) 721 722