Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 1 | // automatically generated by the FlatBuffers compiler, do not modify |
| 2 | import flatbuffers |
| 3 | |
| 4 | namespace NamespaceA |
| 5 | |
| 6 | class TableInFirstNS |
| 7 | |
| 8 | namespace NamespaceC |
| 9 | |
| 10 | class TableInC |
| 11 | |
| 12 | namespace NamespaceA |
| 13 | |
| 14 | class SecondTableInA |
| 15 | |
| 16 | class TableInFirstNS : flatbuffers_handle |
| 17 | def foo_table(): |
| 18 | let o = buf_.flatbuffers_field_table(pos_, 4) |
| 19 | return if o: NamespaceA_NamespaceB_TableInNestedNS { buf_, o } else: nil |
| 20 | def foo_enum(): |
| 21 | return EnumInNestedNS(buf_.flatbuffers_field_int8(pos_, 6, 0)) |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 22 | def foo_union_type(): |
| 23 | return UnionInNestedNS(buf_.flatbuffers_field_int8(pos_, 8, 0)) |
| 24 | def foo_union_as_TableInNestedNS(): |
| 25 | return NamespaceA_NamespaceB_TableInNestedNS { buf_, buf_.flatbuffers_field_table(pos_, 10) } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 26 | def foo_struct(): |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 27 | let o = buf_.flatbuffers_field_struct(pos_, 12) |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 28 | return if o: NamespaceA_NamespaceB_StructInNestedNS { buf_, o } else: nil |
| 29 | |
| 30 | def GetRootAsTableInFirstNS(buf:string): return TableInFirstNS { buf, buf.flatbuffers_indirect(0) } |
| 31 | |
| 32 | struct TableInFirstNSBuilder: |
| 33 | b_:flatbuffers_builder |
| 34 | def start(): |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 35 | b_.StartObject(5) |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 36 | return this |
| 37 | def add_foo_table(foo_table:flatbuffers_offset): |
| 38 | b_.PrependUOffsetTRelativeSlot(0, foo_table) |
| 39 | return this |
| 40 | def add_foo_enum(foo_enum:EnumInNestedNS): |
| 41 | b_.PrependInt8Slot(1, foo_enum, 0) |
| 42 | return this |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 43 | def add_foo_union_type(foo_union_type:UnionInNestedNS): |
| 44 | b_.PrependUint8Slot(2, foo_union_type, 0) |
| 45 | return this |
| 46 | def add_foo_union(foo_union:flatbuffers_offset): |
| 47 | b_.PrependUOffsetTRelativeSlot(3, foo_union) |
| 48 | return this |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 49 | def add_foo_struct(foo_struct:flatbuffers_offset): |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 50 | b_.PrependStructSlot(4, foo_struct) |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 51 | return this |
| 52 | def end(): |
| 53 | return b_.EndObject() |
| 54 | |
| 55 | namespace NamespaceC |
| 56 | |
| 57 | class TableInC : flatbuffers_handle |
| 58 | def refer_to_a1(): |
| 59 | let o = buf_.flatbuffers_field_table(pos_, 4) |
| 60 | return if o: NamespaceA_TableInFirstNS { buf_, o } else: nil |
| 61 | def refer_to_a2(): |
| 62 | let o = buf_.flatbuffers_field_table(pos_, 6) |
| 63 | return if o: NamespaceA_SecondTableInA { buf_, o } else: nil |
| 64 | |
| 65 | def GetRootAsTableInC(buf:string): return TableInC { buf, buf.flatbuffers_indirect(0) } |
| 66 | |
| 67 | struct TableInCBuilder: |
| 68 | b_:flatbuffers_builder |
| 69 | def start(): |
| 70 | b_.StartObject(2) |
| 71 | return this |
| 72 | def add_refer_to_a1(refer_to_a1:flatbuffers_offset): |
| 73 | b_.PrependUOffsetTRelativeSlot(0, refer_to_a1) |
| 74 | return this |
| 75 | def add_refer_to_a2(refer_to_a2:flatbuffers_offset): |
| 76 | b_.PrependUOffsetTRelativeSlot(1, refer_to_a2) |
| 77 | return this |
| 78 | def end(): |
| 79 | return b_.EndObject() |
| 80 | |
| 81 | namespace NamespaceA |
| 82 | |
| 83 | class SecondTableInA : flatbuffers_handle |
| 84 | def refer_to_c(): |
| 85 | let o = buf_.flatbuffers_field_table(pos_, 4) |
| 86 | return if o: NamespaceC_TableInC { buf_, o } else: nil |
| 87 | |
| 88 | def GetRootAsSecondTableInA(buf:string): return SecondTableInA { buf, buf.flatbuffers_indirect(0) } |
| 89 | |
| 90 | struct SecondTableInABuilder: |
| 91 | b_:flatbuffers_builder |
| 92 | def start(): |
| 93 | b_.StartObject(1) |
| 94 | return this |
| 95 | def add_refer_to_c(refer_to_c:flatbuffers_offset): |
| 96 | b_.PrependUOffsetTRelativeSlot(0, refer_to_c) |
| 97 | return this |
| 98 | def end(): |
| 99 | return b_.EndObject() |
| 100 | |