...

Text file src/github.com/google/flatbuffers/tests/namespace_test/namespace_test2_generated.lobster

Documentation: github.com/google/flatbuffers/tests/namespace_test

     1// automatically generated by the FlatBuffers compiler, do not modify
     2import flatbuffers
     3
     4namespace NamespaceA
     5
     6class TableInFirstNS
     7
     8namespace NamespaceC
     9
    10class TableInC
    11
    12namespace NamespaceA
    13
    14class SecondTableInA
    15
    16class 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_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) }
    26    def foo_struct():
    27        let o = buf_.flatbuffers_field_struct(pos_, 12)
    28        return if o: NamespaceA_NamespaceB_StructInNestedNS { buf_, o } else: nil
    29
    30def GetRootAsTableInFirstNS(buf:string): return TableInFirstNS { buf, buf.flatbuffers_indirect(0) }
    31
    32struct TableInFirstNSBuilder:
    33    b_:flatbuffers_builder
    34    def start():
    35        b_.StartObject(5)
    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
    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
    49    def add_foo_struct(foo_struct:flatbuffers_offset):
    50        b_.PrependStructSlot(4, foo_struct)
    51        return this
    52    def end():
    53        return b_.EndObject()
    54
    55namespace NamespaceC
    56
    57class 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
    65def GetRootAsTableInC(buf:string): return TableInC { buf, buf.flatbuffers_indirect(0) }
    66
    67struct 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
    81namespace NamespaceA
    82
    83class 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
    88def GetRootAsSecondTableInA(buf:string): return SecondTableInA { buf, buf.flatbuffers_indirect(0) }
    89
    90struct 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

View as plain text