mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-05 20:06:53 +00:00
[Swift] Implements FlatbuffersVector which confirms to RandomAccessCollection (#8752)
* Implements FlatbuffersVector in swift Implements FlatbuffersVector which confirms to RandomAccessCollection, this would give us semi-native sugary syntax to all the arrays in swift port. This work will also be the foundation of using arrays in swift * Fix failing tests for Swift
This commit is contained in:
@@ -9,7 +9,7 @@ import Common
|
||||
import FlatBuffers
|
||||
|
||||
/// Composite components of Monster color.
|
||||
public enum MyGame_Example_Color: UInt8, Enum, Verifiable {
|
||||
public enum MyGame_Example_Color: UInt8, FlatbuffersVectorInitializable, Enum, Verifiable {
|
||||
public typealias T = UInt8
|
||||
public static var byteSize: Int { return MemoryLayout<UInt8>.size }
|
||||
public var value: UInt8 { return self.rawValue }
|
||||
@@ -35,7 +35,7 @@ extension MyGame_Example_Color: Encodable {
|
||||
}
|
||||
}
|
||||
|
||||
public enum MyGame_Example_Race: Int8, Enum, Verifiable {
|
||||
public enum MyGame_Example_Race: Int8, FlatbuffersVectorInitializable, Enum, Verifiable {
|
||||
public typealias T = Int8
|
||||
public static var byteSize: Int { return MemoryLayout<Int8>.size }
|
||||
public var value: Int8 { return self.rawValue }
|
||||
@@ -60,7 +60,7 @@ extension MyGame_Example_Race: Encodable {
|
||||
}
|
||||
}
|
||||
|
||||
public enum MyGame_Example_LongEnum: UInt64, Enum, Verifiable {
|
||||
public enum MyGame_Example_LongEnum: UInt64, FlatbuffersVectorInitializable, Enum, Verifiable {
|
||||
public typealias T = UInt64
|
||||
public static var byteSize: Int { return MemoryLayout<UInt64>.size }
|
||||
public var value: UInt64 { return self.rawValue }
|
||||
@@ -83,7 +83,7 @@ extension MyGame_Example_LongEnum: Encodable {
|
||||
}
|
||||
}
|
||||
|
||||
public enum MyGame_Example_Any_: UInt8, UnionEnum {
|
||||
public enum MyGame_Example_Any_: UInt8, FlatbuffersVectorInitializable, UnionEnum {
|
||||
public typealias T = UInt8
|
||||
|
||||
public init?(value: T) {
|
||||
@@ -135,7 +135,7 @@ public struct MyGame_Example_Any_Union {
|
||||
}
|
||||
}
|
||||
}
|
||||
public enum MyGame_Example_AnyUniqueAliases: UInt8, UnionEnum {
|
||||
public enum MyGame_Example_AnyUniqueAliases: UInt8, FlatbuffersVectorInitializable, UnionEnum {
|
||||
public typealias T = UInt8
|
||||
|
||||
public init?(value: T) {
|
||||
@@ -187,7 +187,7 @@ public struct MyGame_Example_AnyUniqueAliasesUnion {
|
||||
}
|
||||
}
|
||||
}
|
||||
public enum MyGame_Example_AnyAmbiguousAliases: UInt8, UnionEnum {
|
||||
public enum MyGame_Example_AnyAmbiguousAliases: UInt8, FlatbuffersVectorInitializable, UnionEnum {
|
||||
public typealias T = UInt8
|
||||
|
||||
public init?(value: T) {
|
||||
@@ -239,7 +239,7 @@ public struct MyGame_Example_AnyAmbiguousAliasesUnion {
|
||||
}
|
||||
}
|
||||
}
|
||||
public struct MyGame_Example_Test: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject {
|
||||
public struct MyGame_Example_Test: NativeStruct, FlatbuffersVectorInitializable, Verifiable, FlatbuffersInitializable, NativeObject {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
|
||||
@@ -293,7 +293,7 @@ extension MyGame_Example_Test: Encodable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct MyGame_Example_Test_Mutable: FlatBufferObject {
|
||||
public struct MyGame_Example_Test_Mutable: FlatBufferStruct, FlatbuffersVectorInitializable {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
public var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
@@ -320,7 +320,7 @@ public struct MyGame_Example_Test_Mutable: FlatBufferObject {
|
||||
}
|
||||
}
|
||||
|
||||
public struct MyGame_Example_Vec3: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject {
|
||||
public struct MyGame_Example_Vec3: NativeStruct, FlatbuffersVectorInitializable, Verifiable, FlatbuffersInitializable, NativeObject {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
|
||||
@@ -415,7 +415,7 @@ extension MyGame_Example_Vec3: Encodable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct MyGame_Example_Vec3_Mutable: FlatBufferObject {
|
||||
public struct MyGame_Example_Vec3_Mutable: FlatBufferStruct, FlatbuffersVectorInitializable {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
public var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
@@ -449,7 +449,7 @@ public struct MyGame_Example_Vec3_Mutable: FlatBufferObject {
|
||||
}
|
||||
}
|
||||
|
||||
public struct MyGame_Example_Ability: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject {
|
||||
public struct MyGame_Example_Ability: NativeStruct, FlatbuffersVectorInitializable, Verifiable, FlatbuffersInitializable, NativeObject {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
|
||||
@@ -502,7 +502,7 @@ extension MyGame_Example_Ability: Encodable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct MyGame_Example_Ability_Mutable: FlatBufferObject {
|
||||
public struct MyGame_Example_Ability_Mutable: FlatBufferStruct, FlatbuffersVectorInitializable {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
public var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
@@ -529,7 +529,7 @@ public struct MyGame_Example_Ability_Mutable: FlatBufferObject {
|
||||
}
|
||||
}
|
||||
|
||||
public struct MyGame_Example_StructOfStructs: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject {
|
||||
public struct MyGame_Example_StructOfStructs: NativeStruct, FlatbuffersVectorInitializable, Verifiable, FlatbuffersInitializable, NativeObject {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
|
||||
@@ -589,7 +589,7 @@ extension MyGame_Example_StructOfStructs: Encodable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct MyGame_Example_StructOfStructs_Mutable: FlatBufferObject {
|
||||
public struct MyGame_Example_StructOfStructs_Mutable: FlatBufferStruct, FlatbuffersVectorInitializable {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
public var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
@@ -615,7 +615,7 @@ public struct MyGame_Example_StructOfStructs_Mutable: FlatBufferObject {
|
||||
}
|
||||
}
|
||||
|
||||
public struct MyGame_Example_StructOfStructsOfStructs: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject {
|
||||
public struct MyGame_Example_StructOfStructsOfStructs: NativeStruct, FlatbuffersVectorInitializable, Verifiable, FlatbuffersInitializable, NativeObject {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
|
||||
@@ -657,7 +657,7 @@ extension MyGame_Example_StructOfStructsOfStructs: Encodable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct MyGame_Example_StructOfStructsOfStructs_Mutable: FlatBufferObject {
|
||||
public struct MyGame_Example_StructOfStructsOfStructs_Mutable: FlatBufferStruct, FlatbuffersVectorInitializable {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
public var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
@@ -681,7 +681,7 @@ public struct MyGame_Example_StructOfStructsOfStructs_Mutable: FlatBufferObject
|
||||
}
|
||||
}
|
||||
|
||||
public struct MyGame_InParentNamespace: FlatBufferObject, Verifiable, ObjectAPIPacker {
|
||||
public struct MyGame_InParentNamespace: FlatBufferTable, FlatbuffersVectorInitializable, Verifiable, ObjectAPIPacker {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
public var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
@@ -733,7 +733,7 @@ public class MyGame_InParentNamespaceT: NativeObject {
|
||||
public func serialize() -> ByteBuffer { return serialize(type: MyGame_InParentNamespace.self) }
|
||||
|
||||
}
|
||||
public struct MyGame_Example2_Monster: FlatBufferObject, Verifiable, ObjectAPIPacker {
|
||||
public struct MyGame_Example2_Monster: FlatBufferTable, FlatbuffersVectorInitializable, Verifiable, ObjectAPIPacker {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
public var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
@@ -785,7 +785,7 @@ public class MyGame_Example2_MonsterT: NativeObject {
|
||||
public func serialize() -> ByteBuffer { return serialize(type: MyGame_Example2_Monster.self) }
|
||||
|
||||
}
|
||||
internal struct MyGame_Example_TestSimpleTableWithEnum: FlatBufferObject, Verifiable, ObjectAPIPacker {
|
||||
internal struct MyGame_Example_TestSimpleTableWithEnum: FlatBufferTable, FlatbuffersVectorInitializable, Verifiable, ObjectAPIPacker {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
internal var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
@@ -866,7 +866,7 @@ internal class MyGame_Example_TestSimpleTableWithEnumT: NativeObject {
|
||||
internal func serialize() -> ByteBuffer { return serialize(type: MyGame_Example_TestSimpleTableWithEnum.self) }
|
||||
|
||||
}
|
||||
public struct MyGame_Example_Stat: FlatBufferObject, Verifiable, ObjectAPIPacker {
|
||||
public struct MyGame_Example_Stat: FlatBufferTable, FlatbuffersVectorInitializable, Verifiable, ObjectAPIPacker {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
public var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
@@ -1005,7 +1005,7 @@ public class MyGame_Example_StatT: NativeObject {
|
||||
public func serialize() -> ByteBuffer { return serialize(type: MyGame_Example_Stat.self) }
|
||||
|
||||
}
|
||||
public struct MyGame_Example_Referrable: FlatBufferObject, Verifiable, ObjectAPIPacker {
|
||||
public struct MyGame_Example_Referrable: FlatBufferTable, FlatbuffersVectorInitializable, Verifiable, ObjectAPIPacker {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
public var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
@@ -1111,7 +1111,7 @@ public class MyGame_Example_ReferrableT: NativeObject {
|
||||
|
||||
}
|
||||
/// an example documentation comment: "monster object"
|
||||
public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPacker {
|
||||
public struct MyGame_Example_Monster: FlatBufferTable, FlatbuffersVectorInitializable, Verifiable, ObjectAPIPacker {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
public var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
@@ -1196,37 +1196,25 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac
|
||||
@discardableResult public func mutate(hp: Int16) -> Bool {let o = _accessor.offset(VTOFFSET.hp.v); return _accessor.mutate(hp, index: o) }
|
||||
public var name: String! { let o = _accessor.offset(VTOFFSET.name.v); return _accessor.string(at: o) }
|
||||
public var nameSegmentArray: [UInt8]! { return _accessor.getVector(at: VTOFFSET.name.v) }
|
||||
public var hasInventory: Bool { let o = _accessor.offset(VTOFFSET.inventory.v); return o == 0 ? false : true }
|
||||
public var inventoryCount: Int32 { let o = _accessor.offset(VTOFFSET.inventory.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func inventory(at index: Int32) -> UInt8 { let o = _accessor.offset(VTOFFSET.inventory.v); return o == 0 ? 0 : _accessor.directRead(of: UInt8.self, offset: _accessor.vector(at: o) + index * 1) }
|
||||
public var inventory: [UInt8] { return _accessor.getVector(at: VTOFFSET.inventory.v) ?? [] }
|
||||
public var inventory: FlatbufferVector<UInt8> { return _accessor.vector(at: VTOFFSET.inventory.v, byteSize: 1) }
|
||||
public func mutate(inventory: UInt8, at index: Int32) -> Bool { let o = _accessor.offset(VTOFFSET.inventory.v); return _accessor.directMutate(inventory, index: _accessor.vector(at: o) + index * 1) }
|
||||
public func withUnsafePointerToInventory<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.inventory.v, body: body) }
|
||||
public func withUnsafePointerToInventory<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.inventory.v, body: body) }
|
||||
public var color: MyGame_Example_Color { let o = _accessor.offset(VTOFFSET.color.v); return o == 0 ? .blue : MyGame_Example_Color(rawValue: _accessor.readBuffer(of: UInt8.self, at: o)) ?? .blue }
|
||||
@discardableResult public func mutate(color: MyGame_Example_Color) -> Bool {let o = _accessor.offset(VTOFFSET.color.v); return _accessor.mutate(color.rawValue, index: o) }
|
||||
public var testType: MyGame_Example_Any_ { let o = _accessor.offset(VTOFFSET.testType.v); return o == 0 ? .none_ : MyGame_Example_Any_(rawValue: _accessor.readBuffer(of: UInt8.self, at: o)) ?? .none_ }
|
||||
public func test<T: FlatbuffersInitializable>(type: T.Type) -> T? { let o = _accessor.offset(VTOFFSET.test.v); return o == 0 ? nil : _accessor.union(o) }
|
||||
public var hasTest4: Bool { let o = _accessor.offset(VTOFFSET.test4.v); return o == 0 ? false : true }
|
||||
public var test4Count: Int32 { let o = _accessor.offset(VTOFFSET.test4.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func test4(at index: Int32) -> MyGame_Example_Test? { let o = _accessor.offset(VTOFFSET.test4.v); return o == 0 ? nil : _accessor.directRead(of: MyGame_Example_Test.self, offset: _accessor.vector(at: o) + index * 4) }
|
||||
public func mutableTest4(at index: Int32) -> MyGame_Example_Test_Mutable? { let o = _accessor.offset(VTOFFSET.test4.v); return o == 0 ? nil : MyGame_Example_Test_Mutable(_accessor.bb, o: _accessor.vector(at: o) + index * 4) }
|
||||
public func withUnsafePointerToTest4<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.test4.v, body: body) }
|
||||
public var hasTestarrayofstring: Bool { let o = _accessor.offset(VTOFFSET.testarrayofstring.v); return o == 0 ? false : true }
|
||||
public var testarrayofstringCount: Int32 { let o = _accessor.offset(VTOFFSET.testarrayofstring.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func testarrayofstring(at index: Int32) -> String? { let o = _accessor.offset(VTOFFSET.testarrayofstring.v); return o == 0 ? nil : _accessor.directString(at: _accessor.vector(at: o) + index * 4) }
|
||||
public var test4: FlatbufferVector<MyGame_Example_Test> { return _accessor.vector(at: VTOFFSET.test4.v, byteSize: 4) }
|
||||
public var mutableTest4: FlatbufferVector<MyGame_Example_Test_Mutable> { return _accessor.vector(at: VTOFFSET.test4.v, byteSize: 4) }
|
||||
public func withUnsafePointerToTest4<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.test4.v, body: body) }
|
||||
public var testarrayofstring: FlatbufferVector<String?> { return _accessor.vector(at: VTOFFSET.testarrayofstring.v, byteSize: 4) }
|
||||
/// an example documentation comment: this will end up in the generated code
|
||||
/// multiline too
|
||||
public var hasTestarrayoftables: Bool { let o = _accessor.offset(VTOFFSET.testarrayoftables.v); return o == 0 ? false : true }
|
||||
public var testarrayoftablesCount: Int32 { let o = _accessor.offset(VTOFFSET.testarrayoftables.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func testarrayoftables(at index: Int32) -> MyGame_Example_Monster? { let o = _accessor.offset(VTOFFSET.testarrayoftables.v); return o == 0 ? nil : MyGame_Example_Monster(_accessor.bb, o: _accessor.indirect(_accessor.vector(at: o) + index * 4)) }
|
||||
public var testarrayoftables: FlatbufferVector<MyGame_Example_Monster> { return _accessor.vector(at: VTOFFSET.testarrayoftables.v, byteSize: 4) }
|
||||
public func testarrayoftablesBy(key: String) -> MyGame_Example_Monster? { let o = _accessor.offset(VTOFFSET.testarrayoftables.v); return o == 0 ? nil : MyGame_Example_Monster.lookupByKey(vector: _accessor.vector(at: o), key: key, fbb: _accessor.bb) }
|
||||
public var enemy: MyGame_Example_Monster? { let o = _accessor.offset(VTOFFSET.enemy.v); return o == 0 ? nil : MyGame_Example_Monster(_accessor.bb, o: _accessor.indirect(o + _accessor.position)) }
|
||||
public var hasTestnestedflatbuffer: Bool { let o = _accessor.offset(VTOFFSET.testnestedflatbuffer.v); return o == 0 ? false : true }
|
||||
public var testnestedflatbufferCount: Int32 { let o = _accessor.offset(VTOFFSET.testnestedflatbuffer.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func testnestedflatbuffer(at index: Int32) -> UInt8 { let o = _accessor.offset(VTOFFSET.testnestedflatbuffer.v); return o == 0 ? 0 : _accessor.directRead(of: UInt8.self, offset: _accessor.vector(at: o) + index * 1) }
|
||||
public var testnestedflatbuffer: [UInt8] { return _accessor.getVector(at: VTOFFSET.testnestedflatbuffer.v) ?? [] }
|
||||
public var testnestedflatbuffer: FlatbufferVector<UInt8> { return _accessor.vector(at: VTOFFSET.testnestedflatbuffer.v, byteSize: 1) }
|
||||
public func mutate(testnestedflatbuffer: UInt8, at index: Int32) -> Bool { let o = _accessor.offset(VTOFFSET.testnestedflatbuffer.v); return _accessor.directMutate(testnestedflatbuffer, index: _accessor.vector(at: o) + index * 1) }
|
||||
public func withUnsafePointerToTestnestedflatbuffer<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.testnestedflatbuffer.v, body: body) }
|
||||
public func withUnsafePointerToTestnestedflatbuffer<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.testnestedflatbuffer.v, body: body) }
|
||||
public var testempty: MyGame_Example_Stat? { let o = _accessor.offset(VTOFFSET.testempty.v); return o == 0 ? nil : MyGame_Example_Stat(_accessor.bb, o: _accessor.indirect(o + _accessor.position)) }
|
||||
public var testbool: Bool { let o = _accessor.offset(VTOFFSET.testbool.v); return o == 0 ? false : _accessor.readBuffer(of: Bool.self, at: o) }
|
||||
@discardableResult public func mutate(testbool: Bool) -> Bool {let o = _accessor.offset(VTOFFSET.testbool.v); return _accessor.mutate(testbool, index: o) }
|
||||
@@ -1246,100 +1234,62 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac
|
||||
@discardableResult public func mutate(testhashs64Fnv1a: Int64) -> Bool {let o = _accessor.offset(VTOFFSET.testhashs64Fnv1a.v); return _accessor.mutate(testhashs64Fnv1a, index: o) }
|
||||
public var testhashu64Fnv1a: UInt64 { let o = _accessor.offset(VTOFFSET.testhashu64Fnv1a.v); return o == 0 ? 0 : _accessor.readBuffer(of: UInt64.self, at: o) }
|
||||
@discardableResult public func mutate(testhashu64Fnv1a: UInt64) -> Bool {let o = _accessor.offset(VTOFFSET.testhashu64Fnv1a.v); return _accessor.mutate(testhashu64Fnv1a, index: o) }
|
||||
public var hasTestarrayofbools: Bool { let o = _accessor.offset(VTOFFSET.testarrayofbools.v); return o == 0 ? false : true }
|
||||
public var testarrayofboolsCount: Int32 { let o = _accessor.offset(VTOFFSET.testarrayofbools.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func testarrayofbools(at index: Int32) -> Bool { let o = _accessor.offset(VTOFFSET.testarrayofbools.v); return o == 0 ? true : _accessor.directRead(of: Bool.self, offset: _accessor.vector(at: o) + index * 1) }
|
||||
public var testarrayofbools: [Bool] { return _accessor.getVector(at: VTOFFSET.testarrayofbools.v) ?? [] }
|
||||
public var testarrayofbools: FlatbufferVector<Bool> { return _accessor.vector(at: VTOFFSET.testarrayofbools.v, byteSize: 1) }
|
||||
public func mutate(testarrayofbools: Bool, at index: Int32) -> Bool { let o = _accessor.offset(VTOFFSET.testarrayofbools.v); return _accessor.directMutate(testarrayofbools, index: _accessor.vector(at: o) + index * 1) }
|
||||
public func withUnsafePointerToTestarrayofbools<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.testarrayofbools.v, body: body) }
|
||||
public func withUnsafePointerToTestarrayofbools<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.testarrayofbools.v, body: body) }
|
||||
public var testf: Float32 { let o = _accessor.offset(VTOFFSET.testf.v); return o == 0 ? 3.14159 : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
@discardableResult public func mutate(testf: Float32) -> Bool {let o = _accessor.offset(VTOFFSET.testf.v); return _accessor.mutate(testf, index: o) }
|
||||
public var testf2: Float32 { let o = _accessor.offset(VTOFFSET.testf2.v); return o == 0 ? 3.0 : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
@discardableResult public func mutate(testf2: Float32) -> Bool {let o = _accessor.offset(VTOFFSET.testf2.v); return _accessor.mutate(testf2, index: o) }
|
||||
public var testf3: Float32 { let o = _accessor.offset(VTOFFSET.testf3.v); return o == 0 ? 0.0 : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
@discardableResult public func mutate(testf3: Float32) -> Bool {let o = _accessor.offset(VTOFFSET.testf3.v); return _accessor.mutate(testf3, index: o) }
|
||||
public var hasTestarrayofstring2: Bool { let o = _accessor.offset(VTOFFSET.testarrayofstring2.v); return o == 0 ? false : true }
|
||||
public var testarrayofstring2Count: Int32 { let o = _accessor.offset(VTOFFSET.testarrayofstring2.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func testarrayofstring2(at index: Int32) -> String? { let o = _accessor.offset(VTOFFSET.testarrayofstring2.v); return o == 0 ? nil : _accessor.directString(at: _accessor.vector(at: o) + index * 4) }
|
||||
public var hasTestarrayofsortedstruct: Bool { let o = _accessor.offset(VTOFFSET.testarrayofsortedstruct.v); return o == 0 ? false : true }
|
||||
public var testarrayofsortedstructCount: Int32 { let o = _accessor.offset(VTOFFSET.testarrayofsortedstruct.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func testarrayofsortedstruct(at index: Int32) -> MyGame_Example_Ability? { let o = _accessor.offset(VTOFFSET.testarrayofsortedstruct.v); return o == 0 ? nil : _accessor.directRead(of: MyGame_Example_Ability.self, offset: _accessor.vector(at: o) + index * 8) }
|
||||
public func mutableTestarrayofsortedstruct(at index: Int32) -> MyGame_Example_Ability_Mutable? { let o = _accessor.offset(VTOFFSET.testarrayofsortedstruct.v); return o == 0 ? nil : MyGame_Example_Ability_Mutable(_accessor.bb, o: _accessor.vector(at: o) + index * 8) }
|
||||
public func withUnsafePointerToTestarrayofsortedstruct<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.testarrayofsortedstruct.v, body: body) }
|
||||
public var hasFlex: Bool { let o = _accessor.offset(VTOFFSET.flex.v); return o == 0 ? false : true }
|
||||
public var flexCount: Int32 { let o = _accessor.offset(VTOFFSET.flex.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func flex(at index: Int32) -> UInt8 { let o = _accessor.offset(VTOFFSET.flex.v); return o == 0 ? 0 : _accessor.directRead(of: UInt8.self, offset: _accessor.vector(at: o) + index * 1) }
|
||||
public var flex: [UInt8] { return _accessor.getVector(at: VTOFFSET.flex.v) ?? [] }
|
||||
public var testarrayofstring2: FlatbufferVector<String?> { return _accessor.vector(at: VTOFFSET.testarrayofstring2.v, byteSize: 4) }
|
||||
public var testarrayofsortedstruct: FlatbufferVector<MyGame_Example_Ability> { return _accessor.vector(at: VTOFFSET.testarrayofsortedstruct.v, byteSize: 8) }
|
||||
public var mutableTestarrayofsortedstruct: FlatbufferVector<MyGame_Example_Ability_Mutable> { return _accessor.vector(at: VTOFFSET.testarrayofsortedstruct.v, byteSize: 8) }
|
||||
public func withUnsafePointerToTestarrayofsortedstruct<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.testarrayofsortedstruct.v, body: body) }
|
||||
public var flex: FlatbufferVector<UInt8> { return _accessor.vector(at: VTOFFSET.flex.v, byteSize: 1) }
|
||||
public func mutate(flex: UInt8, at index: Int32) -> Bool { let o = _accessor.offset(VTOFFSET.flex.v); return _accessor.directMutate(flex, index: _accessor.vector(at: o) + index * 1) }
|
||||
public func withUnsafePointerToFlex<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.flex.v, body: body) }
|
||||
public var hasTest5: Bool { let o = _accessor.offset(VTOFFSET.test5.v); return o == 0 ? false : true }
|
||||
public var test5Count: Int32 { let o = _accessor.offset(VTOFFSET.test5.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func test5(at index: Int32) -> MyGame_Example_Test? { let o = _accessor.offset(VTOFFSET.test5.v); return o == 0 ? nil : _accessor.directRead(of: MyGame_Example_Test.self, offset: _accessor.vector(at: o) + index * 4) }
|
||||
public func mutableTest5(at index: Int32) -> MyGame_Example_Test_Mutable? { let o = _accessor.offset(VTOFFSET.test5.v); return o == 0 ? nil : MyGame_Example_Test_Mutable(_accessor.bb, o: _accessor.vector(at: o) + index * 4) }
|
||||
public func withUnsafePointerToTest5<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.test5.v, body: body) }
|
||||
public var hasVectorOfLongs: Bool { let o = _accessor.offset(VTOFFSET.vectorOfLongs.v); return o == 0 ? false : true }
|
||||
public var vectorOfLongsCount: Int32 { let o = _accessor.offset(VTOFFSET.vectorOfLongs.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func vectorOfLongs(at index: Int32) -> Int64 { let o = _accessor.offset(VTOFFSET.vectorOfLongs.v); return o == 0 ? 0 : _accessor.directRead(of: Int64.self, offset: _accessor.vector(at: o) + index * 8) }
|
||||
public var vectorOfLongs: [Int64] { return _accessor.getVector(at: VTOFFSET.vectorOfLongs.v) ?? [] }
|
||||
public func withUnsafePointerToFlex<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.flex.v, body: body) }
|
||||
public var test5: FlatbufferVector<MyGame_Example_Test> { return _accessor.vector(at: VTOFFSET.test5.v, byteSize: 4) }
|
||||
public var mutableTest5: FlatbufferVector<MyGame_Example_Test_Mutable> { return _accessor.vector(at: VTOFFSET.test5.v, byteSize: 4) }
|
||||
public func withUnsafePointerToTest5<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.test5.v, body: body) }
|
||||
public var vectorOfLongs: FlatbufferVector<Int64> { return _accessor.vector(at: VTOFFSET.vectorOfLongs.v, byteSize: 8) }
|
||||
public func mutate(vectorOfLongs: Int64, at index: Int32) -> Bool { let o = _accessor.offset(VTOFFSET.vectorOfLongs.v); return _accessor.directMutate(vectorOfLongs, index: _accessor.vector(at: o) + index * 8) }
|
||||
public func withUnsafePointerToVectorOfLongs<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.vectorOfLongs.v, body: body) }
|
||||
public var hasVectorOfDoubles: Bool { let o = _accessor.offset(VTOFFSET.vectorOfDoubles.v); return o == 0 ? false : true }
|
||||
public var vectorOfDoublesCount: Int32 { let o = _accessor.offset(VTOFFSET.vectorOfDoubles.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func vectorOfDoubles(at index: Int32) -> Double { let o = _accessor.offset(VTOFFSET.vectorOfDoubles.v); return o == 0 ? 0 : _accessor.directRead(of: Double.self, offset: _accessor.vector(at: o) + index * 8) }
|
||||
public var vectorOfDoubles: [Double] { return _accessor.getVector(at: VTOFFSET.vectorOfDoubles.v) ?? [] }
|
||||
public func withUnsafePointerToVectorOfLongs<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.vectorOfLongs.v, body: body) }
|
||||
public var vectorOfDoubles: FlatbufferVector<Double> { return _accessor.vector(at: VTOFFSET.vectorOfDoubles.v, byteSize: 8) }
|
||||
public func mutate(vectorOfDoubles: Double, at index: Int32) -> Bool { let o = _accessor.offset(VTOFFSET.vectorOfDoubles.v); return _accessor.directMutate(vectorOfDoubles, index: _accessor.vector(at: o) + index * 8) }
|
||||
public func withUnsafePointerToVectorOfDoubles<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.vectorOfDoubles.v, body: body) }
|
||||
public func withUnsafePointerToVectorOfDoubles<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.vectorOfDoubles.v, body: body) }
|
||||
public var parentNamespaceTest: MyGame_InParentNamespace? { let o = _accessor.offset(VTOFFSET.parentNamespaceTest.v); return o == 0 ? nil : MyGame_InParentNamespace(_accessor.bb, o: _accessor.indirect(o + _accessor.position)) }
|
||||
public var hasVectorOfReferrables: Bool { let o = _accessor.offset(VTOFFSET.vectorOfReferrables.v); return o == 0 ? false : true }
|
||||
public var vectorOfReferrablesCount: Int32 { let o = _accessor.offset(VTOFFSET.vectorOfReferrables.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func vectorOfReferrables(at index: Int32) -> MyGame_Example_Referrable? { let o = _accessor.offset(VTOFFSET.vectorOfReferrables.v); return o == 0 ? nil : MyGame_Example_Referrable(_accessor.bb, o: _accessor.indirect(_accessor.vector(at: o) + index * 4)) }
|
||||
public var vectorOfReferrables: FlatbufferVector<MyGame_Example_Referrable> { return _accessor.vector(at: VTOFFSET.vectorOfReferrables.v, byteSize: 4) }
|
||||
public func vectorOfReferrablesBy(key: UInt64) -> MyGame_Example_Referrable? { let o = _accessor.offset(VTOFFSET.vectorOfReferrables.v); return o == 0 ? nil : MyGame_Example_Referrable.lookupByKey(vector: _accessor.vector(at: o), key: key, fbb: _accessor.bb) }
|
||||
public var singleWeakReference: UInt64 { let o = _accessor.offset(VTOFFSET.singleWeakReference.v); return o == 0 ? 0 : _accessor.readBuffer(of: UInt64.self, at: o) }
|
||||
@discardableResult public func mutate(singleWeakReference: UInt64) -> Bool {let o = _accessor.offset(VTOFFSET.singleWeakReference.v); return _accessor.mutate(singleWeakReference, index: o) }
|
||||
public var hasVectorOfWeakReferences: Bool { let o = _accessor.offset(VTOFFSET.vectorOfWeakReferences.v); return o == 0 ? false : true }
|
||||
public var vectorOfWeakReferencesCount: Int32 { let o = _accessor.offset(VTOFFSET.vectorOfWeakReferences.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func vectorOfWeakReferences(at index: Int32) -> UInt64 { let o = _accessor.offset(VTOFFSET.vectorOfWeakReferences.v); return o == 0 ? 0 : _accessor.directRead(of: UInt64.self, offset: _accessor.vector(at: o) + index * 8) }
|
||||
public var vectorOfWeakReferences: [UInt64] { return _accessor.getVector(at: VTOFFSET.vectorOfWeakReferences.v) ?? [] }
|
||||
public var vectorOfWeakReferences: FlatbufferVector<UInt64> { return _accessor.vector(at: VTOFFSET.vectorOfWeakReferences.v, byteSize: 8) }
|
||||
public func mutate(vectorOfWeakReferences: UInt64, at index: Int32) -> Bool { let o = _accessor.offset(VTOFFSET.vectorOfWeakReferences.v); return _accessor.directMutate(vectorOfWeakReferences, index: _accessor.vector(at: o) + index * 8) }
|
||||
public func withUnsafePointerToVectorOfWeakReferences<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.vectorOfWeakReferences.v, body: body) }
|
||||
public var hasVectorOfStrongReferrables: Bool { let o = _accessor.offset(VTOFFSET.vectorOfStrongReferrables.v); return o == 0 ? false : true }
|
||||
public var vectorOfStrongReferrablesCount: Int32 { let o = _accessor.offset(VTOFFSET.vectorOfStrongReferrables.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func vectorOfStrongReferrables(at index: Int32) -> MyGame_Example_Referrable? { let o = _accessor.offset(VTOFFSET.vectorOfStrongReferrables.v); return o == 0 ? nil : MyGame_Example_Referrable(_accessor.bb, o: _accessor.indirect(_accessor.vector(at: o) + index * 4)) }
|
||||
public func withUnsafePointerToVectorOfWeakReferences<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.vectorOfWeakReferences.v, body: body) }
|
||||
public var vectorOfStrongReferrables: FlatbufferVector<MyGame_Example_Referrable> { return _accessor.vector(at: VTOFFSET.vectorOfStrongReferrables.v, byteSize: 4) }
|
||||
public func vectorOfStrongReferrablesBy(key: UInt64) -> MyGame_Example_Referrable? { let o = _accessor.offset(VTOFFSET.vectorOfStrongReferrables.v); return o == 0 ? nil : MyGame_Example_Referrable.lookupByKey(vector: _accessor.vector(at: o), key: key, fbb: _accessor.bb) }
|
||||
public var coOwningReference: UInt64 { let o = _accessor.offset(VTOFFSET.coOwningReference.v); return o == 0 ? 0 : _accessor.readBuffer(of: UInt64.self, at: o) }
|
||||
@discardableResult public func mutate(coOwningReference: UInt64) -> Bool {let o = _accessor.offset(VTOFFSET.coOwningReference.v); return _accessor.mutate(coOwningReference, index: o) }
|
||||
public var hasVectorOfCoOwningReferences: Bool { let o = _accessor.offset(VTOFFSET.vectorOfCoOwningReferences.v); return o == 0 ? false : true }
|
||||
public var vectorOfCoOwningReferencesCount: Int32 { let o = _accessor.offset(VTOFFSET.vectorOfCoOwningReferences.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func vectorOfCoOwningReferences(at index: Int32) -> UInt64 { let o = _accessor.offset(VTOFFSET.vectorOfCoOwningReferences.v); return o == 0 ? 0 : _accessor.directRead(of: UInt64.self, offset: _accessor.vector(at: o) + index * 8) }
|
||||
public var vectorOfCoOwningReferences: [UInt64] { return _accessor.getVector(at: VTOFFSET.vectorOfCoOwningReferences.v) ?? [] }
|
||||
public var vectorOfCoOwningReferences: FlatbufferVector<UInt64> { return _accessor.vector(at: VTOFFSET.vectorOfCoOwningReferences.v, byteSize: 8) }
|
||||
public func mutate(vectorOfCoOwningReferences: UInt64, at index: Int32) -> Bool { let o = _accessor.offset(VTOFFSET.vectorOfCoOwningReferences.v); return _accessor.directMutate(vectorOfCoOwningReferences, index: _accessor.vector(at: o) + index * 8) }
|
||||
public func withUnsafePointerToVectorOfCoOwningReferences<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.vectorOfCoOwningReferences.v, body: body) }
|
||||
public func withUnsafePointerToVectorOfCoOwningReferences<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.vectorOfCoOwningReferences.v, body: body) }
|
||||
public var nonOwningReference: UInt64 { let o = _accessor.offset(VTOFFSET.nonOwningReference.v); return o == 0 ? 0 : _accessor.readBuffer(of: UInt64.self, at: o) }
|
||||
@discardableResult public func mutate(nonOwningReference: UInt64) -> Bool {let o = _accessor.offset(VTOFFSET.nonOwningReference.v); return _accessor.mutate(nonOwningReference, index: o) }
|
||||
public var hasVectorOfNonOwningReferences: Bool { let o = _accessor.offset(VTOFFSET.vectorOfNonOwningReferences.v); return o == 0 ? false : true }
|
||||
public var vectorOfNonOwningReferencesCount: Int32 { let o = _accessor.offset(VTOFFSET.vectorOfNonOwningReferences.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func vectorOfNonOwningReferences(at index: Int32) -> UInt64 { let o = _accessor.offset(VTOFFSET.vectorOfNonOwningReferences.v); return o == 0 ? 0 : _accessor.directRead(of: UInt64.self, offset: _accessor.vector(at: o) + index * 8) }
|
||||
public var vectorOfNonOwningReferences: [UInt64] { return _accessor.getVector(at: VTOFFSET.vectorOfNonOwningReferences.v) ?? [] }
|
||||
public var vectorOfNonOwningReferences: FlatbufferVector<UInt64> { return _accessor.vector(at: VTOFFSET.vectorOfNonOwningReferences.v, byteSize: 8) }
|
||||
public func mutate(vectorOfNonOwningReferences: UInt64, at index: Int32) -> Bool { let o = _accessor.offset(VTOFFSET.vectorOfNonOwningReferences.v); return _accessor.directMutate(vectorOfNonOwningReferences, index: _accessor.vector(at: o) + index * 8) }
|
||||
public func withUnsafePointerToVectorOfNonOwningReferences<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.vectorOfNonOwningReferences.v, body: body) }
|
||||
public func withUnsafePointerToVectorOfNonOwningReferences<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.vectorOfNonOwningReferences.v, body: body) }
|
||||
public var anyUniqueType: MyGame_Example_AnyUniqueAliases { let o = _accessor.offset(VTOFFSET.anyUniqueType.v); return o == 0 ? .none_ : MyGame_Example_AnyUniqueAliases(rawValue: _accessor.readBuffer(of: UInt8.self, at: o)) ?? .none_ }
|
||||
public func anyUnique<T: FlatbuffersInitializable>(type: T.Type) -> T? { let o = _accessor.offset(VTOFFSET.anyUnique.v); return o == 0 ? nil : _accessor.union(o) }
|
||||
public var anyAmbiguousType: MyGame_Example_AnyAmbiguousAliases { let o = _accessor.offset(VTOFFSET.anyAmbiguousType.v); return o == 0 ? .none_ : MyGame_Example_AnyAmbiguousAliases(rawValue: _accessor.readBuffer(of: UInt8.self, at: o)) ?? .none_ }
|
||||
public func anyAmbiguous<T: FlatbuffersInitializable>(type: T.Type) -> T? { let o = _accessor.offset(VTOFFSET.anyAmbiguous.v); return o == 0 ? nil : _accessor.union(o) }
|
||||
public var hasVectorOfEnums: Bool { let o = _accessor.offset(VTOFFSET.vectorOfEnums.v); return o == 0 ? false : true }
|
||||
public var vectorOfEnumsCount: Int32 { let o = _accessor.offset(VTOFFSET.vectorOfEnums.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func vectorOfEnums(at index: Int32) -> MyGame_Example_Color? { let o = _accessor.offset(VTOFFSET.vectorOfEnums.v); return o == 0 ? MyGame_Example_Color.red : MyGame_Example_Color(rawValue: _accessor.directRead(of: UInt8.self, offset: _accessor.vector(at: o) + index * 1)) }
|
||||
public var vectorOfEnums: FlatbufferVector<MyGame_Example_Color> { return _accessor.vector(at: VTOFFSET.vectorOfEnums.v, byteSize: 1) }
|
||||
public var signedEnum: MyGame_Example_Race { let o = _accessor.offset(VTOFFSET.signedEnum.v); return o == 0 ? .none_ : MyGame_Example_Race(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? .none_ }
|
||||
@discardableResult public func mutate(signedEnum: MyGame_Example_Race) -> Bool {let o = _accessor.offset(VTOFFSET.signedEnum.v); return _accessor.mutate(signedEnum.rawValue, index: o) }
|
||||
public var hasTestrequirednestedflatbuffer: Bool { let o = _accessor.offset(VTOFFSET.testrequirednestedflatbuffer.v); return o == 0 ? false : true }
|
||||
public var testrequirednestedflatbufferCount: Int32 { let o = _accessor.offset(VTOFFSET.testrequirednestedflatbuffer.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func testrequirednestedflatbuffer(at index: Int32) -> UInt8 { let o = _accessor.offset(VTOFFSET.testrequirednestedflatbuffer.v); return o == 0 ? 0 : _accessor.directRead(of: UInt8.self, offset: _accessor.vector(at: o) + index * 1) }
|
||||
public var testrequirednestedflatbuffer: [UInt8] { return _accessor.getVector(at: VTOFFSET.testrequirednestedflatbuffer.v) ?? [] }
|
||||
public var testrequirednestedflatbuffer: FlatbufferVector<UInt8> { return _accessor.vector(at: VTOFFSET.testrequirednestedflatbuffer.v, byteSize: 1) }
|
||||
public func mutate(testrequirednestedflatbuffer: UInt8, at index: Int32) -> Bool { let o = _accessor.offset(VTOFFSET.testrequirednestedflatbuffer.v); return _accessor.directMutate(testrequirednestedflatbuffer, index: _accessor.vector(at: o) + index * 1) }
|
||||
public func withUnsafePointerToTestrequirednestedflatbuffer<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.testrequirednestedflatbuffer.v, body: body) }
|
||||
public var hasScalarKeySortedTables: Bool { let o = _accessor.offset(VTOFFSET.scalarKeySortedTables.v); return o == 0 ? false : true }
|
||||
public var scalarKeySortedTablesCount: Int32 { let o = _accessor.offset(VTOFFSET.scalarKeySortedTables.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func scalarKeySortedTables(at index: Int32) -> MyGame_Example_Stat? { let o = _accessor.offset(VTOFFSET.scalarKeySortedTables.v); return o == 0 ? nil : MyGame_Example_Stat(_accessor.bb, o: _accessor.indirect(_accessor.vector(at: o) + index * 4)) }
|
||||
public func withUnsafePointerToTestrequirednestedflatbuffer<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.testrequirednestedflatbuffer.v, body: body) }
|
||||
public var scalarKeySortedTables: FlatbufferVector<MyGame_Example_Stat> { return _accessor.vector(at: VTOFFSET.scalarKeySortedTables.v, byteSize: 4) }
|
||||
public func scalarKeySortedTablesBy(key: UInt16) -> MyGame_Example_Stat? { let o = _accessor.offset(VTOFFSET.scalarKeySortedTables.v); return o == 0 ? nil : MyGame_Example_Stat.lookupByKey(vector: _accessor.vector(at: o), key: key, fbb: _accessor.bb) }
|
||||
public var nativeInline: MyGame_Example_Test? { let o = _accessor.offset(VTOFFSET.nativeInline.v); return o == 0 ? nil : _accessor.readBuffer(of: MyGame_Example_Test.self, at: o) }
|
||||
public var mutableNativeInline: MyGame_Example_Test_Mutable? { let o = _accessor.offset(VTOFFSET.nativeInline.v); return o == 0 ? nil : MyGame_Example_Test_Mutable(_accessor.bb, o: o + _accessor.position) }
|
||||
@@ -1604,9 +1554,8 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac
|
||||
let __inventory = builder.createVector(obj.inventory)
|
||||
let __test = obj.test?.pack(builder: &builder) ?? Offset()
|
||||
MyGame_Example_Monster.startVectorOfTest4(obj.test4.count, in: &builder)
|
||||
for i in obj.test4 {
|
||||
guard let _o = i else { continue }
|
||||
builder.create(struct: _o)
|
||||
for val in obj.test4 {
|
||||
builder.create(struct: val)
|
||||
}
|
||||
let __test4 = builder.endVector(len: obj.test4.count)
|
||||
let __testarrayofstring = builder.createVector(ofStrings: obj.testarrayofstring.compactMap({ $0 }) )
|
||||
@@ -1621,16 +1570,14 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac
|
||||
let __testarrayofbools = builder.createVector(obj.testarrayofbools)
|
||||
let __testarrayofstring2 = builder.createVector(ofStrings: obj.testarrayofstring2.compactMap({ $0 }) )
|
||||
MyGame_Example_Monster.startVectorOfTestarrayofsortedstruct(obj.testarrayofsortedstruct.count, in: &builder)
|
||||
for i in obj.testarrayofsortedstruct {
|
||||
guard let _o = i else { continue }
|
||||
builder.create(struct: _o)
|
||||
for val in obj.testarrayofsortedstruct {
|
||||
builder.create(struct: val)
|
||||
}
|
||||
let __testarrayofsortedstruct = builder.endVector(len: obj.testarrayofsortedstruct.count)
|
||||
let __flex = builder.createVector(obj.flex)
|
||||
MyGame_Example_Monster.startVectorOfTest5(obj.test5.count, in: &builder)
|
||||
for i in obj.test5 {
|
||||
guard let _o = i else { continue }
|
||||
builder.create(struct: _o)
|
||||
for val in obj.test5 {
|
||||
builder.create(struct: val)
|
||||
}
|
||||
let __test5 = builder.endVector(len: obj.test5.count)
|
||||
let __vectorOfLongs = builder.createVector(obj.vectorOfLongs)
|
||||
@@ -1904,9 +1851,7 @@ extension MyGame_Example_Monster: Encodable {
|
||||
try container.encodeIfPresent(hp, forKey: .hp)
|
||||
}
|
||||
try container.encodeIfPresent(name, forKey: .name)
|
||||
if inventoryCount > 0 {
|
||||
try container.encodeIfPresent(inventory, forKey: .inventory)
|
||||
}
|
||||
try container.encodeIfPresent(inventory, forKey: .inventory)
|
||||
if color != .blue {
|
||||
try container.encodeIfPresent(color, forKey: .color)
|
||||
}
|
||||
@@ -1925,31 +1870,11 @@ extension MyGame_Example_Monster: Encodable {
|
||||
try container.encodeIfPresent(_v, forKey: .test)
|
||||
default: break;
|
||||
}
|
||||
if test4Count > 0 {
|
||||
var contentEncoder = container.nestedUnkeyedContainer(forKey: .test4)
|
||||
for index in 0..<test4Count {
|
||||
guard let type = test4(at: index) else { continue }
|
||||
try contentEncoder.encode(type)
|
||||
}
|
||||
}
|
||||
if testarrayofstringCount > 0 {
|
||||
var contentEncoder = container.nestedUnkeyedContainer(forKey: .testarrayofstring)
|
||||
for index in 0..<testarrayofstringCount {
|
||||
guard let type = testarrayofstring(at: index) else { continue }
|
||||
try contentEncoder.encode(type)
|
||||
}
|
||||
}
|
||||
if testarrayoftablesCount > 0 {
|
||||
var contentEncoder = container.nestedUnkeyedContainer(forKey: .testarrayoftables)
|
||||
for index in 0..<testarrayoftablesCount {
|
||||
guard let type = testarrayoftables(at: index) else { continue }
|
||||
try contentEncoder.encode(type)
|
||||
}
|
||||
}
|
||||
try container.encodeIfPresent(test4, forKey: .test4)
|
||||
try container.encodeIfPresent(testarrayofstring, forKey: .testarrayofstring)
|
||||
try container.encodeIfPresent(testarrayoftables, forKey: .testarrayoftables)
|
||||
try container.encodeIfPresent(enemy, forKey: .enemy)
|
||||
if testnestedflatbufferCount > 0 {
|
||||
try container.encodeIfPresent(testnestedflatbuffer, forKey: .testnestedflatbuffer)
|
||||
}
|
||||
try container.encodeIfPresent(testnestedflatbuffer, forKey: .testnestedflatbuffer)
|
||||
try container.encodeIfPresent(testempty, forKey: .testempty)
|
||||
if testbool != false {
|
||||
try container.encodeIfPresent(testbool, forKey: .testbool)
|
||||
@@ -1978,9 +1903,7 @@ extension MyGame_Example_Monster: Encodable {
|
||||
if testhashu64Fnv1a != 0 {
|
||||
try container.encodeIfPresent(testhashu64Fnv1a, forKey: .testhashu64Fnv1a)
|
||||
}
|
||||
if testarrayofboolsCount > 0 {
|
||||
try container.encodeIfPresent(testarrayofbools, forKey: .testarrayofbools)
|
||||
}
|
||||
try container.encodeIfPresent(testarrayofbools, forKey: .testarrayofbools)
|
||||
if testf != 3.14159 {
|
||||
try container.encodeIfPresent(testf, forKey: .testf)
|
||||
}
|
||||
@@ -1990,69 +1913,27 @@ extension MyGame_Example_Monster: Encodable {
|
||||
if testf3 != 0.0 {
|
||||
try container.encodeIfPresent(testf3, forKey: .testf3)
|
||||
}
|
||||
if testarrayofstring2Count > 0 {
|
||||
var contentEncoder = container.nestedUnkeyedContainer(forKey: .testarrayofstring2)
|
||||
for index in 0..<testarrayofstring2Count {
|
||||
guard let type = testarrayofstring2(at: index) else { continue }
|
||||
try contentEncoder.encode(type)
|
||||
}
|
||||
}
|
||||
if testarrayofsortedstructCount > 0 {
|
||||
var contentEncoder = container.nestedUnkeyedContainer(forKey: .testarrayofsortedstruct)
|
||||
for index in 0..<testarrayofsortedstructCount {
|
||||
guard let type = testarrayofsortedstruct(at: index) else { continue }
|
||||
try contentEncoder.encode(type)
|
||||
}
|
||||
}
|
||||
if flexCount > 0 {
|
||||
try container.encodeIfPresent(flex, forKey: .flex)
|
||||
}
|
||||
if test5Count > 0 {
|
||||
var contentEncoder = container.nestedUnkeyedContainer(forKey: .test5)
|
||||
for index in 0..<test5Count {
|
||||
guard let type = test5(at: index) else { continue }
|
||||
try contentEncoder.encode(type)
|
||||
}
|
||||
}
|
||||
if vectorOfLongsCount > 0 {
|
||||
try container.encodeIfPresent(vectorOfLongs, forKey: .vectorOfLongs)
|
||||
}
|
||||
if vectorOfDoublesCount > 0 {
|
||||
try container.encodeIfPresent(vectorOfDoubles, forKey: .vectorOfDoubles)
|
||||
}
|
||||
try container.encodeIfPresent(testarrayofstring2, forKey: .testarrayofstring2)
|
||||
try container.encodeIfPresent(testarrayofsortedstruct, forKey: .testarrayofsortedstruct)
|
||||
try container.encodeIfPresent(flex, forKey: .flex)
|
||||
try container.encodeIfPresent(test5, forKey: .test5)
|
||||
try container.encodeIfPresent(vectorOfLongs, forKey: .vectorOfLongs)
|
||||
try container.encodeIfPresent(vectorOfDoubles, forKey: .vectorOfDoubles)
|
||||
try container.encodeIfPresent(parentNamespaceTest, forKey: .parentNamespaceTest)
|
||||
if vectorOfReferrablesCount > 0 {
|
||||
var contentEncoder = container.nestedUnkeyedContainer(forKey: .vectorOfReferrables)
|
||||
for index in 0..<vectorOfReferrablesCount {
|
||||
guard let type = vectorOfReferrables(at: index) else { continue }
|
||||
try contentEncoder.encode(type)
|
||||
}
|
||||
}
|
||||
try container.encodeIfPresent(vectorOfReferrables, forKey: .vectorOfReferrables)
|
||||
if singleWeakReference != 0 {
|
||||
try container.encodeIfPresent(singleWeakReference, forKey: .singleWeakReference)
|
||||
}
|
||||
if vectorOfWeakReferencesCount > 0 {
|
||||
try container.encodeIfPresent(vectorOfWeakReferences, forKey: .vectorOfWeakReferences)
|
||||
}
|
||||
if vectorOfStrongReferrablesCount > 0 {
|
||||
var contentEncoder = container.nestedUnkeyedContainer(forKey: .vectorOfStrongReferrables)
|
||||
for index in 0..<vectorOfStrongReferrablesCount {
|
||||
guard let type = vectorOfStrongReferrables(at: index) else { continue }
|
||||
try contentEncoder.encode(type)
|
||||
}
|
||||
}
|
||||
try container.encodeIfPresent(vectorOfWeakReferences, forKey: .vectorOfWeakReferences)
|
||||
try container.encodeIfPresent(vectorOfStrongReferrables, forKey: .vectorOfStrongReferrables)
|
||||
if coOwningReference != 0 {
|
||||
try container.encodeIfPresent(coOwningReference, forKey: .coOwningReference)
|
||||
}
|
||||
if vectorOfCoOwningReferencesCount > 0 {
|
||||
try container.encodeIfPresent(vectorOfCoOwningReferences, forKey: .vectorOfCoOwningReferences)
|
||||
}
|
||||
try container.encodeIfPresent(vectorOfCoOwningReferences, forKey: .vectorOfCoOwningReferences)
|
||||
if nonOwningReference != 0 {
|
||||
try container.encodeIfPresent(nonOwningReference, forKey: .nonOwningReference)
|
||||
}
|
||||
if vectorOfNonOwningReferencesCount > 0 {
|
||||
try container.encodeIfPresent(vectorOfNonOwningReferences, forKey: .vectorOfNonOwningReferences)
|
||||
}
|
||||
try container.encodeIfPresent(vectorOfNonOwningReferences, forKey: .vectorOfNonOwningReferences)
|
||||
if anyUniqueType != .none_ {
|
||||
try container.encodeIfPresent(anyUniqueType, forKey: .anyUniqueType)
|
||||
}
|
||||
@@ -2083,26 +1964,12 @@ extension MyGame_Example_Monster: Encodable {
|
||||
try container.encodeIfPresent(_v, forKey: .anyAmbiguous)
|
||||
default: break;
|
||||
}
|
||||
if vectorOfEnumsCount > 0 {
|
||||
var contentEncoder = container.nestedUnkeyedContainer(forKey: .vectorOfEnums)
|
||||
for index in 0..<vectorOfEnumsCount {
|
||||
guard let type = vectorOfEnums(at: index) else { continue }
|
||||
try contentEncoder.encode(type)
|
||||
}
|
||||
}
|
||||
try container.encodeIfPresent(vectorOfEnums, forKey: .vectorOfEnums)
|
||||
if signedEnum != .none_ {
|
||||
try container.encodeIfPresent(signedEnum, forKey: .signedEnum)
|
||||
}
|
||||
if testrequirednestedflatbufferCount > 0 {
|
||||
try container.encodeIfPresent(testrequirednestedflatbuffer, forKey: .testrequirednestedflatbuffer)
|
||||
}
|
||||
if scalarKeySortedTablesCount > 0 {
|
||||
var contentEncoder = container.nestedUnkeyedContainer(forKey: .scalarKeySortedTables)
|
||||
for index in 0..<scalarKeySortedTablesCount {
|
||||
guard let type = scalarKeySortedTables(at: index) else { continue }
|
||||
try contentEncoder.encode(type)
|
||||
}
|
||||
}
|
||||
try container.encodeIfPresent(testrequirednestedflatbuffer, forKey: .testrequirednestedflatbuffer)
|
||||
try container.encodeIfPresent(scalarKeySortedTables, forKey: .scalarKeySortedTables)
|
||||
try container.encodeIfPresent(nativeInline, forKey: .nativeInline)
|
||||
if longEnumNonEnumDefault != .longone {
|
||||
try container.encodeIfPresent(longEnumNonEnumDefault, forKey: .longEnumNonEnumDefault)
|
||||
@@ -2146,7 +2013,7 @@ public class MyGame_Example_MonsterT: NativeObject {
|
||||
public var inventory: [UInt8]
|
||||
public var color: MyGame_Example_Color
|
||||
public var test: MyGame_Example_Any_Union?
|
||||
public var test4: [MyGame_Example_Test?]
|
||||
public var test4: [MyGame_Example_Test]
|
||||
public var testarrayofstring: [String?]
|
||||
public var testarrayoftables: [MyGame_Example_MonsterT?]
|
||||
public var enemy: MyGame_Example_MonsterT?
|
||||
@@ -2166,9 +2033,9 @@ public class MyGame_Example_MonsterT: NativeObject {
|
||||
public var testf2: Float32
|
||||
public var testf3: Float32
|
||||
public var testarrayofstring2: [String?]
|
||||
public var testarrayofsortedstruct: [MyGame_Example_Ability?]
|
||||
public var testarrayofsortedstruct: [MyGame_Example_Ability]
|
||||
public var flex: [UInt8]
|
||||
public var test5: [MyGame_Example_Test?]
|
||||
public var test5: [MyGame_Example_Test]
|
||||
public var vectorOfLongs: [Int64]
|
||||
public var vectorOfDoubles: [Double]
|
||||
public var parentNamespaceTest: MyGame_InParentNamespaceT?
|
||||
@@ -2204,9 +2071,7 @@ public class MyGame_Example_MonsterT: NativeObject {
|
||||
hp = _t.hp
|
||||
name = _t.name
|
||||
inventory = []
|
||||
for index in 0..<_t.inventoryCount {
|
||||
inventory.append(_t.inventory(at: index))
|
||||
}
|
||||
inventory.append(contentsOf: _t.inventory)
|
||||
color = _t.color
|
||||
switch _t.testType {
|
||||
case .monster:
|
||||
@@ -2221,24 +2086,17 @@ public class MyGame_Example_MonsterT: NativeObject {
|
||||
default: break
|
||||
}
|
||||
test4 = []
|
||||
for index in 0..<_t.test4Count {
|
||||
test4.append(_t.test4(at: index))
|
||||
}
|
||||
test4.append(contentsOf: _t.test4)
|
||||
testarrayofstring = []
|
||||
for index in 0..<_t.testarrayofstringCount {
|
||||
testarrayofstring.append(_t.testarrayofstring(at: index))
|
||||
}
|
||||
testarrayofstring.append(contentsOf: _t.testarrayofstring)
|
||||
testarrayoftables = []
|
||||
for index in 0..<_t.testarrayoftablesCount {
|
||||
var __v_ = _t.testarrayoftables(at: index)
|
||||
testarrayoftables.append(__v_?.unpack())
|
||||
for var val in _t.testarrayoftables{
|
||||
testarrayoftables.append(val.unpack())
|
||||
}
|
||||
var __enemy = _t.enemy
|
||||
enemy = __enemy?.unpack()
|
||||
testnestedflatbuffer = []
|
||||
for index in 0..<_t.testnestedflatbufferCount {
|
||||
testnestedflatbuffer.append(_t.testnestedflatbuffer(at: index))
|
||||
}
|
||||
testnestedflatbuffer.append(contentsOf: _t.testnestedflatbuffer)
|
||||
var __testempty = _t.testempty
|
||||
testempty = __testempty?.unpack()
|
||||
testbool = _t.testbool
|
||||
@@ -2251,63 +2109,41 @@ public class MyGame_Example_MonsterT: NativeObject {
|
||||
testhashs64Fnv1a = _t.testhashs64Fnv1a
|
||||
testhashu64Fnv1a = _t.testhashu64Fnv1a
|
||||
testarrayofbools = []
|
||||
for index in 0..<_t.testarrayofboolsCount {
|
||||
testarrayofbools.append(_t.testarrayofbools(at: index))
|
||||
}
|
||||
testarrayofbools.append(contentsOf: _t.testarrayofbools)
|
||||
testf = _t.testf
|
||||
testf2 = _t.testf2
|
||||
testf3 = _t.testf3
|
||||
testarrayofstring2 = []
|
||||
for index in 0..<_t.testarrayofstring2Count {
|
||||
testarrayofstring2.append(_t.testarrayofstring2(at: index))
|
||||
}
|
||||
testarrayofstring2.append(contentsOf: _t.testarrayofstring2)
|
||||
testarrayofsortedstruct = []
|
||||
for index in 0..<_t.testarrayofsortedstructCount {
|
||||
testarrayofsortedstruct.append(_t.testarrayofsortedstruct(at: index))
|
||||
}
|
||||
testarrayofsortedstruct.append(contentsOf: _t.testarrayofsortedstruct)
|
||||
flex = []
|
||||
for index in 0..<_t.flexCount {
|
||||
flex.append(_t.flex(at: index))
|
||||
}
|
||||
flex.append(contentsOf: _t.flex)
|
||||
test5 = []
|
||||
for index in 0..<_t.test5Count {
|
||||
test5.append(_t.test5(at: index))
|
||||
}
|
||||
test5.append(contentsOf: _t.test5)
|
||||
vectorOfLongs = []
|
||||
for index in 0..<_t.vectorOfLongsCount {
|
||||
vectorOfLongs.append(_t.vectorOfLongs(at: index))
|
||||
}
|
||||
vectorOfLongs.append(contentsOf: _t.vectorOfLongs)
|
||||
vectorOfDoubles = []
|
||||
for index in 0..<_t.vectorOfDoublesCount {
|
||||
vectorOfDoubles.append(_t.vectorOfDoubles(at: index))
|
||||
}
|
||||
vectorOfDoubles.append(contentsOf: _t.vectorOfDoubles)
|
||||
var __parentNamespaceTest = _t.parentNamespaceTest
|
||||
parentNamespaceTest = __parentNamespaceTest?.unpack()
|
||||
vectorOfReferrables = []
|
||||
for index in 0..<_t.vectorOfReferrablesCount {
|
||||
var __v_ = _t.vectorOfReferrables(at: index)
|
||||
vectorOfReferrables.append(__v_?.unpack())
|
||||
for var val in _t.vectorOfReferrables{
|
||||
vectorOfReferrables.append(val.unpack())
|
||||
}
|
||||
singleWeakReference = _t.singleWeakReference
|
||||
vectorOfWeakReferences = []
|
||||
for index in 0..<_t.vectorOfWeakReferencesCount {
|
||||
vectorOfWeakReferences.append(_t.vectorOfWeakReferences(at: index))
|
||||
}
|
||||
vectorOfWeakReferences.append(contentsOf: _t.vectorOfWeakReferences)
|
||||
vectorOfStrongReferrables = []
|
||||
for index in 0..<_t.vectorOfStrongReferrablesCount {
|
||||
var __v_ = _t.vectorOfStrongReferrables(at: index)
|
||||
vectorOfStrongReferrables.append(__v_?.unpack())
|
||||
for var val in _t.vectorOfStrongReferrables{
|
||||
vectorOfStrongReferrables.append(val.unpack())
|
||||
}
|
||||
coOwningReference = _t.coOwningReference
|
||||
vectorOfCoOwningReferences = []
|
||||
for index in 0..<_t.vectorOfCoOwningReferencesCount {
|
||||
vectorOfCoOwningReferences.append(_t.vectorOfCoOwningReferences(at: index))
|
||||
}
|
||||
vectorOfCoOwningReferences.append(contentsOf: _t.vectorOfCoOwningReferences)
|
||||
nonOwningReference = _t.nonOwningReference
|
||||
vectorOfNonOwningReferences = []
|
||||
for index in 0..<_t.vectorOfNonOwningReferencesCount {
|
||||
vectorOfNonOwningReferences.append(_t.vectorOfNonOwningReferences(at: index))
|
||||
}
|
||||
vectorOfNonOwningReferences.append(contentsOf: _t.vectorOfNonOwningReferences)
|
||||
switch _t.anyUniqueType {
|
||||
case .m:
|
||||
var _v = _t.anyUnique(type: MyGame_Example_Monster.self)
|
||||
@@ -2333,18 +2169,13 @@ public class MyGame_Example_MonsterT: NativeObject {
|
||||
default: break
|
||||
}
|
||||
vectorOfEnums = []
|
||||
for index in 0..<_t.vectorOfEnumsCount {
|
||||
vectorOfEnums.append(_t.vectorOfEnums(at: index)!)
|
||||
}
|
||||
vectorOfEnums.append(contentsOf: _t.vectorOfEnums)
|
||||
signedEnum = _t.signedEnum
|
||||
testrequirednestedflatbuffer = []
|
||||
for index in 0..<_t.testrequirednestedflatbufferCount {
|
||||
testrequirednestedflatbuffer.append(_t.testrequirednestedflatbuffer(at: index))
|
||||
}
|
||||
testrequirednestedflatbuffer.append(contentsOf: _t.testrequirednestedflatbuffer)
|
||||
scalarKeySortedTables = []
|
||||
for index in 0..<_t.scalarKeySortedTablesCount {
|
||||
var __v_ = _t.scalarKeySortedTables(at: index)
|
||||
scalarKeySortedTables.append(__v_?.unpack())
|
||||
for var val in _t.scalarKeySortedTables{
|
||||
scalarKeySortedTables.append(val.unpack())
|
||||
}
|
||||
nativeInline = _t.nativeInline
|
||||
longEnumNonEnumDefault = _t.longEnumNonEnumDefault
|
||||
@@ -2420,7 +2251,7 @@ public class MyGame_Example_MonsterT: NativeObject {
|
||||
public func serialize() -> ByteBuffer { return serialize(type: MyGame_Example_Monster.self) }
|
||||
|
||||
}
|
||||
public struct MyGame_Example_TypeAliases: FlatBufferObject, Verifiable, ObjectAPIPacker {
|
||||
public struct MyGame_Example_TypeAliases: FlatBufferTable, FlatbuffersVectorInitializable, Verifiable, ObjectAPIPacker {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
public var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
@@ -2468,18 +2299,12 @@ public struct MyGame_Example_TypeAliases: FlatBufferObject, Verifiable, ObjectAP
|
||||
@discardableResult public func mutate(f32: Float32) -> Bool {let o = _accessor.offset(VTOFFSET.f32.v); return _accessor.mutate(f32, index: o) }
|
||||
public var f64: Double { let o = _accessor.offset(VTOFFSET.f64.v); return o == 0 ? 0.0 : _accessor.readBuffer(of: Double.self, at: o) }
|
||||
@discardableResult public func mutate(f64: Double) -> Bool {let o = _accessor.offset(VTOFFSET.f64.v); return _accessor.mutate(f64, index: o) }
|
||||
public var hasV8: Bool { let o = _accessor.offset(VTOFFSET.v8.v); return o == 0 ? false : true }
|
||||
public var v8Count: Int32 { let o = _accessor.offset(VTOFFSET.v8.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func v8(at index: Int32) -> Int8 { let o = _accessor.offset(VTOFFSET.v8.v); return o == 0 ? 0 : _accessor.directRead(of: Int8.self, offset: _accessor.vector(at: o) + index * 1) }
|
||||
public var v8: [Int8] { return _accessor.getVector(at: VTOFFSET.v8.v) ?? [] }
|
||||
public var v8: FlatbufferVector<Int8> { return _accessor.vector(at: VTOFFSET.v8.v, byteSize: 1) }
|
||||
public func mutate(v8: Int8, at index: Int32) -> Bool { let o = _accessor.offset(VTOFFSET.v8.v); return _accessor.directMutate(v8, index: _accessor.vector(at: o) + index * 1) }
|
||||
public func withUnsafePointerToV8<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.v8.v, body: body) }
|
||||
public var hasVf64: Bool { let o = _accessor.offset(VTOFFSET.vf64.v); return o == 0 ? false : true }
|
||||
public var vf64Count: Int32 { let o = _accessor.offset(VTOFFSET.vf64.v); return o == 0 ? 0 : _accessor.vector(count: o) }
|
||||
public func vf64(at index: Int32) -> Double { let o = _accessor.offset(VTOFFSET.vf64.v); return o == 0 ? 0 : _accessor.directRead(of: Double.self, offset: _accessor.vector(at: o) + index * 8) }
|
||||
public var vf64: [Double] { return _accessor.getVector(at: VTOFFSET.vf64.v) ?? [] }
|
||||
public func withUnsafePointerToV8<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.v8.v, body: body) }
|
||||
public var vf64: FlatbufferVector<Double> { return _accessor.vector(at: VTOFFSET.vf64.v, byteSize: 8) }
|
||||
public func mutate(vf64: Double, at index: Int32) -> Bool { let o = _accessor.offset(VTOFFSET.vf64.v); return _accessor.directMutate(vf64, index: _accessor.vector(at: o) + index * 8) }
|
||||
public func withUnsafePointerToVf64<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.vf64.v, body: body) }
|
||||
public func withUnsafePointerToVf64<T>(_ body: (UnsafeRawBufferPointer, Int) throws -> T) rethrows -> T? { return try _accessor.withUnsafePointerToSlice(at: VTOFFSET.vf64.v, body: body) }
|
||||
public static func startTypeAliases(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 12) }
|
||||
public static func add(i8: Int8, _ fbb: inout FlatBufferBuilder) { fbb.add(element: i8, def: 0, at: VTOFFSET.i8.p) }
|
||||
public static func add(u8: UInt8, _ fbb: inout FlatBufferBuilder) { fbb.add(element: u8, def: 0, at: VTOFFSET.u8.p) }
|
||||
@@ -2619,12 +2444,8 @@ extension MyGame_Example_TypeAliases: Encodable {
|
||||
if f64 != 0.0 {
|
||||
try container.encodeIfPresent(f64, forKey: .f64)
|
||||
}
|
||||
if v8Count > 0 {
|
||||
try container.encodeIfPresent(v8, forKey: .v8)
|
||||
}
|
||||
if vf64Count > 0 {
|
||||
try container.encodeIfPresent(vf64, forKey: .vf64)
|
||||
}
|
||||
try container.encodeIfPresent(v8, forKey: .v8)
|
||||
try container.encodeIfPresent(vf64, forKey: .vf64)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2655,13 +2476,9 @@ public class MyGame_Example_TypeAliasesT: NativeObject {
|
||||
f32 = _t.f32
|
||||
f64 = _t.f64
|
||||
v8 = []
|
||||
for index in 0..<_t.v8Count {
|
||||
v8.append(_t.v8(at: index))
|
||||
}
|
||||
v8.append(contentsOf: _t.v8)
|
||||
vf64 = []
|
||||
for index in 0..<_t.vf64Count {
|
||||
vf64.append(_t.vf64(at: index))
|
||||
}
|
||||
vf64.append(contentsOf: _t.vf64)
|
||||
}
|
||||
|
||||
public init() {
|
||||
|
||||
Reference in New Issue
Block a user