blob: d51f3d91638f82808938bcc852ced924123d7397 [file] [log] [blame]
Austin Schuh272c6132020-11-14 16:37:52 -08001// automatically generated by the FlatBuffers compiler, do not modify
2
3import FlatBuffers
4
5public struct Property: Readable {
6
7 static func validateVersion() { FlatBuffersVersion_1_12_0() }
8 public var __buffer: ByteBuffer! { return _accessor.bb }
9 private var _accessor: Struct
10
11 public static var size = 1
12 public static var alignment = 1
13 public init(_ bb: ByteBuffer, o: Int32) { _accessor = Struct(bb: bb, position: o) }
14
15 public var property: Bool { return _accessor.readBuffer(of: Bool.self, at: 0) }
16 @discardableResult public func mutate(property: Bool) -> Bool { return _accessor.mutate(property, index: 0) }
17}
18
19public func createProperty(builder: inout FlatBufferBuilder, property: Bool = false) -> Offset<UOffset> {
20 builder.createStructOf(size: Property.size, alignment: Property.alignment)
21 builder.reverseAdd(v: property, postion: 0)
22 return builder.endStruct()
23}
24
25public struct TestMutatingBool: FlatBufferObject {
26
27 static func validateVersion() { FlatBuffersVersion_1_12_0() }
28 public var __buffer: ByteBuffer! { return _accessor.bb }
29 private var _accessor: Table
30
31 public static func getRootAsTestMutatingBool(bb: ByteBuffer) -> TestMutatingBool { return TestMutatingBool(Table(bb: bb, position: Int32(bb.read(def: UOffset.self, position: bb.reader)) + Int32(bb.reader))) }
32
33 private init(_ t: Table) { _accessor = t }
34 public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
35
36 enum VTOFFSET: VOffset {
37 case b = 4
38 var v: Int32 { Int32(self.rawValue) }
39 var p: VOffset { self.rawValue }
40 }
41
42 public var b: Property? { let o = _accessor.offset(VTOFFSET.b.v); return o == 0 ? nil : Property(_accessor.bb, o: o + _accessor.postion) }
43 public static func startTestMutatingBool(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 1) }
44 public static func add(b: Offset<UOffset>, _ fbb: inout FlatBufferBuilder) { fbb.add(structOffset: VTOFFSET.b.p) }
45 public static func endTestMutatingBool(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset<UOffset> { let end = Offset<UOffset>(offset: fbb.endTable(at: start)); return end }
46}
47