mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
* Migrate to swift 6.0 & swift-gRPC 2.0 The following migrates to swift 6.0, and also migrate to swift-grpc 2.0 that uses swift-nio under the hood to provide nicer API and async await Adds sendable to enum & update @_implementationOnly imports to use internal imports * Address PR comments regarding misspelling & proper method naming.
68 lines
2.0 KiB
Swift
68 lines
2.0 KiB
Swift
// automatically generated by the FlatBuffers compiler, do not modify
|
|
// swiftlint:disable all
|
|
// swiftformat:disable all
|
|
|
|
#if canImport(Common)
|
|
import Common
|
|
#endif
|
|
|
|
import FlatBuffers
|
|
|
|
public struct DataModel_A: FlatBufferVerifiableTable, FlatbuffersVectorInitializable, ObjectAPIPacker {
|
|
|
|
static func validateVersion() { FlatBuffersVersion_25_12_19() }
|
|
public var __buffer: ByteBuffer! { return _accessor.bb }
|
|
private var _accessor: Table
|
|
|
|
private init(_ t: Table) { _accessor = t }
|
|
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
|
|
|
private struct VT {
|
|
}
|
|
|
|
public static func startA(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 1) }
|
|
public static func endA(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); return end }
|
|
public static func createA(
|
|
_ fbb: inout FlatBufferBuilder
|
|
) -> Offset {
|
|
let __start = DataModel_A.startA(&fbb)
|
|
return DataModel_A.endA(&fbb, start: __start)
|
|
}
|
|
|
|
public func unpack() -> DataModel_AT {
|
|
return DataModel_AT(self)
|
|
}
|
|
public static func pack(_ builder: inout FlatBufferBuilder, obj: inout DataModel_AT?) -> Offset {
|
|
guard var obj = obj else { return Offset() }
|
|
return pack(&builder, obj: &obj)
|
|
}
|
|
|
|
public static func pack(_ builder: inout FlatBufferBuilder, obj: inout DataModel_AT) -> Offset {
|
|
let __root = DataModel_A.startA(&builder)
|
|
return DataModel_A.endA(&builder, start: __root)
|
|
}
|
|
|
|
public static func verify<T>(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable {
|
|
var _v = try verifier.visitTable(at: position)
|
|
_v.finish()
|
|
}
|
|
}
|
|
|
|
extension DataModel_A: Encodable {
|
|
public func encode(to encoder: Encoder) throws {
|
|
}
|
|
}
|
|
|
|
public class DataModel_AT: NativeObject {
|
|
|
|
|
|
public init(_ _t: borrowing DataModel_A) {
|
|
}
|
|
|
|
public init() {
|
|
}
|
|
|
|
public func serialize() -> ByteBuffer { return serialize(type: DataModel_A.self) }
|
|
|
|
}
|