summaryrefslogtreecommitdiff
path: root/tests/namespace_test/namespace_test2_generated.lobster
blob: 3820928d571a8b314c3c049ff0681cedc37a8128 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// automatically generated by the FlatBuffers compiler, do not modify
import flatbuffers

namespace NamespaceA

class TableInFirstNS

namespace NamespaceC

class TableInC

namespace NamespaceA

class SecondTableInA

class TableInFirstNS : flatbuffers_handle
    def foo_table():
        let o = buf_.flatbuffers_field_table(pos_, 4)
        return if o: NamespaceA_NamespaceB_TableInNestedNS { buf_, o } else: nil
    def foo_enum():
        return EnumInNestedNS(buf_.flatbuffers_field_int8(pos_, 6, 0))
    def foo_union_type():
        return UnionInNestedNS(buf_.flatbuffers_field_int8(pos_, 8, 0))
    def foo_union_as_TableInNestedNS():
        return NamespaceA_NamespaceB_TableInNestedNS { buf_, buf_.flatbuffers_field_table(pos_, 10) }
    def foo_struct():
        let o = buf_.flatbuffers_field_struct(pos_, 12)
        return if o: NamespaceA_NamespaceB_StructInNestedNS { buf_, o } else: nil

def GetRootAsTableInFirstNS(buf:string): return TableInFirstNS { buf, buf.flatbuffers_indirect(0) }

struct TableInFirstNSBuilder:
    b_:flatbuffers_builder
    def start():
        b_.StartObject(5)
        return this
    def add_foo_table(foo_table:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(0, foo_table)
        return this
    def add_foo_enum(foo_enum:EnumInNestedNS):
        b_.PrependInt8Slot(1, foo_enum, 0)
        return this
    def add_foo_union_type(foo_union_type:UnionInNestedNS):
        b_.PrependUint8Slot(2, foo_union_type, 0)
        return this
    def add_foo_union(foo_union:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(3, foo_union)
        return this
    def add_foo_struct(foo_struct:flatbuffers_offset):
        b_.PrependStructSlot(4, foo_struct)
        return this
    def end():
        return b_.EndObject()

namespace NamespaceC

class TableInC : flatbuffers_handle
    def refer_to_a1():
        let o = buf_.flatbuffers_field_table(pos_, 4)
        return if o: NamespaceA_TableInFirstNS { buf_, o } else: nil
    def refer_to_a2():
        let o = buf_.flatbuffers_field_table(pos_, 6)
        return if o: NamespaceA_SecondTableInA { buf_, o } else: nil

def GetRootAsTableInC(buf:string): return TableInC { buf, buf.flatbuffers_indirect(0) }

struct TableInCBuilder:
    b_:flatbuffers_builder
    def start():
        b_.StartObject(2)
        return this
    def add_refer_to_a1(refer_to_a1:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(0, refer_to_a1)
        return this
    def add_refer_to_a2(refer_to_a2:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(1, refer_to_a2)
        return this
    def end():
        return b_.EndObject()

namespace NamespaceA

class SecondTableInA : flatbuffers_handle
    def refer_to_c():
        let o = buf_.flatbuffers_field_table(pos_, 4)
        return if o: NamespaceC_TableInC { buf_, o } else: nil

def GetRootAsSecondTableInA(buf:string): return SecondTableInA { buf, buf.flatbuffers_indirect(0) }

struct SecondTableInABuilder:
    b_:flatbuffers_builder
    def start():
        b_.StartObject(1)
        return this
    def add_refer_to_c(refer_to_c:flatbuffers_offset):
        b_.PrependUOffsetTRelativeSlot(0, refer_to_c)
        return this
    def end():
        return b_.EndObject()