NdbMeta.swift (4104B)
1 // automatically generated by the FlatBuffers compiler, do not modify 2 // swiftlint:disable all 3 // swiftformat:disable all 4 5 public struct NdbEventMeta: FlatBufferObject, Verifiable { 6 7 static func validateVersion() { FlatBuffersVersion_23_5_26() } 8 public var __buffer: ByteBuffer! { return _accessor.bb } 9 private var _accessor: Table 10 11 private init(_ t: Table) { _accessor = t } 12 public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } 13 14 private enum VTOFFSET: VOffset { 15 case receivedAt = 4 16 case reactions = 6 17 case quotes = 8 18 case reposts = 10 19 case zaps = 12 20 case zapTotal = 14 21 var v: Int32 { Int32(self.rawValue) } 22 var p: VOffset { self.rawValue } 23 } 24 25 public var receivedAt: Int32 { let o = _accessor.offset(VTOFFSET.receivedAt.v); return o == 0 ? 0 : _accessor.readBuffer(of: Int32.self, at: o) } 26 public var reactions: Int32 { let o = _accessor.offset(VTOFFSET.reactions.v); return o == 0 ? 0 : _accessor.readBuffer(of: Int32.self, at: o) } 27 public var quotes: Int32 { let o = _accessor.offset(VTOFFSET.quotes.v); return o == 0 ? 0 : _accessor.readBuffer(of: Int32.self, at: o) } 28 public var reposts: Int32 { let o = _accessor.offset(VTOFFSET.reposts.v); return o == 0 ? 0 : _accessor.readBuffer(of: Int32.self, at: o) } 29 public var zaps: Int32 { let o = _accessor.offset(VTOFFSET.zaps.v); return o == 0 ? 0 : _accessor.readBuffer(of: Int32.self, at: o) } 30 public var zapTotal: Int64 { let o = _accessor.offset(VTOFFSET.zapTotal.v); return o == 0 ? 0 : _accessor.readBuffer(of: Int64.self, at: o) } 31 public static func startNdbEventMeta(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 6) } 32 public static func add(receivedAt: Int32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: receivedAt, def: 0, at: VTOFFSET.receivedAt.p) } 33 public static func add(reactions: Int32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: reactions, def: 0, at: VTOFFSET.reactions.p) } 34 public static func add(quotes: Int32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: quotes, def: 0, at: VTOFFSET.quotes.p) } 35 public static func add(reposts: Int32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: reposts, def: 0, at: VTOFFSET.reposts.p) } 36 public static func add(zaps: Int32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: zaps, def: 0, at: VTOFFSET.zaps.p) } 37 public static func add(zapTotal: Int64, _ fbb: inout FlatBufferBuilder) { fbb.add(element: zapTotal, def: 0, at: VTOFFSET.zapTotal.p) } 38 public static func endNdbEventMeta(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); return end } 39 public static func createNdbEventMeta( 40 _ fbb: inout FlatBufferBuilder, 41 receivedAt: Int32 = 0, 42 reactions: Int32 = 0, 43 quotes: Int32 = 0, 44 reposts: Int32 = 0, 45 zaps: Int32 = 0, 46 zapTotal: Int64 = 0 47 ) -> Offset { 48 let __start = NdbEventMeta.startNdbEventMeta(&fbb) 49 NdbEventMeta.add(receivedAt: receivedAt, &fbb) 50 NdbEventMeta.add(reactions: reactions, &fbb) 51 NdbEventMeta.add(quotes: quotes, &fbb) 52 NdbEventMeta.add(reposts: reposts, &fbb) 53 NdbEventMeta.add(zaps: zaps, &fbb) 54 NdbEventMeta.add(zapTotal: zapTotal, &fbb) 55 return NdbEventMeta.endNdbEventMeta(&fbb, start: __start) 56 } 57 58 public static func verify<T>(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable { 59 var _v = try verifier.visitTable(at: position) 60 try _v.visit(field: VTOFFSET.receivedAt.p, fieldName: "receivedAt", required: false, type: Int32.self) 61 try _v.visit(field: VTOFFSET.reactions.p, fieldName: "reactions", required: false, type: Int32.self) 62 try _v.visit(field: VTOFFSET.quotes.p, fieldName: "quotes", required: false, type: Int32.self) 63 try _v.visit(field: VTOFFSET.reposts.p, fieldName: "reposts", required: false, type: Int32.self) 64 try _v.visit(field: VTOFFSET.zaps.p, fieldName: "zaps", required: false, type: Int32.self) 65 try _v.visit(field: VTOFFSET.zapTotal.p, fieldName: "zapTotal", required: false, type: Int64.self) 66 _v.finish() 67 } 68 } 69