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)) |
| 22 | def foo_struct(): |
| 23 | let o = buf_.flatbuffers_field_struct(pos_, 8) |
| 24 | return if o: NamespaceA_NamespaceB_StructInNestedNS { buf_, o } else: nil |
| 25 | |
| 26 | def GetRootAsTableInFirstNS(buf:string): return TableInFirstNS { buf, buf.flatbuffers_indirect(0) } |
| 27 | |
| 28 | struct TableInFirstNSBuilder: |
| 29 | b_:flatbuffers_builder |
| 30 | def start(): |
| 31 | b_.StartObject(3) |
| 32 | return this |
| 33 | def add_foo_table(foo_table:flatbuffers_offset): |
| 34 | b_.PrependUOffsetTRelativeSlot(0, foo_table) |
| 35 | return this |
| 36 | def add_foo_enum(foo_enum:EnumInNestedNS): |
| 37 | b_.PrependInt8Slot(1, foo_enum, 0) |
| 38 | return this |
| 39 | def add_foo_struct(foo_struct:flatbuffers_offset): |
| 40 | b_.PrependStructSlot(2, foo_struct) |
| 41 | return this |
| 42 | def end(): |
| 43 | return b_.EndObject() |
| 44 | |
| 45 | namespace NamespaceC |
| 46 | |
| 47 | class TableInC : flatbuffers_handle |
| 48 | def refer_to_a1(): |
| 49 | let o = buf_.flatbuffers_field_table(pos_, 4) |
| 50 | return if o: NamespaceA_TableInFirstNS { buf_, o } else: nil |
| 51 | def refer_to_a2(): |
| 52 | let o = buf_.flatbuffers_field_table(pos_, 6) |
| 53 | return if o: NamespaceA_SecondTableInA { buf_, o } else: nil |
| 54 | |
| 55 | def GetRootAsTableInC(buf:string): return TableInC { buf, buf.flatbuffers_indirect(0) } |
| 56 | |
| 57 | struct TableInCBuilder: |
| 58 | b_:flatbuffers_builder |
| 59 | def start(): |
| 60 | b_.StartObject(2) |
| 61 | return this |
| 62 | def add_refer_to_a1(refer_to_a1:flatbuffers_offset): |
| 63 | b_.PrependUOffsetTRelativeSlot(0, refer_to_a1) |
| 64 | return this |
| 65 | def add_refer_to_a2(refer_to_a2:flatbuffers_offset): |
| 66 | b_.PrependUOffsetTRelativeSlot(1, refer_to_a2) |
| 67 | return this |
| 68 | def end(): |
| 69 | return b_.EndObject() |
| 70 | |
| 71 | namespace NamespaceA |
| 72 | |
| 73 | class SecondTableInA : flatbuffers_handle |
| 74 | def refer_to_c(): |
| 75 | let o = buf_.flatbuffers_field_table(pos_, 4) |
| 76 | return if o: NamespaceC_TableInC { buf_, o } else: nil |
| 77 | |
| 78 | def GetRootAsSecondTableInA(buf:string): return SecondTableInA { buf, buf.flatbuffers_indirect(0) } |
| 79 | |
| 80 | struct SecondTableInABuilder: |
| 81 | b_:flatbuffers_builder |
| 82 | def start(): |
| 83 | b_.StartObject(1) |
| 84 | return this |
| 85 | def add_refer_to_c(refer_to_c:flatbuffers_offset): |
| 86 | b_.PrependUOffsetTRelativeSlot(0, refer_to_c) |
| 87 | return this |
| 88 | def end(): |
| 89 | return b_.EndObject() |
| 90 | |