forked from google/flatbuffers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Swift] Moves grpc example to grpc/examples (google#6479)
Updates generated Code Removes grpc generation code from tests dir Small fix to generate.sh
- Loading branch information
mustiikhalil
authored
Feb 20, 2021
1 parent
3b53657
commit b5da526
Showing
11 changed files
with
147 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
grpc/examples/swift/Greeter/Sources/Model/greeter_generated.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// automatically generated by the FlatBuffers compiler, do not modify | ||
// swiftlint:disable all | ||
// swiftformat:disable all | ||
|
||
import FlatBuffers | ||
|
||
public struct models_HelloReply: FlatBufferObject { | ||
|
||
static func validateVersion() { FlatBuffersVersion_1_12_0() } | ||
public var __buffer: ByteBuffer! { return _accessor.bb } | ||
private var _accessor: Table | ||
|
||
public static func getRootAsHelloReply(bb: ByteBuffer) -> models_HelloReply { return models_HelloReply(Table(bb: bb, position: Int32(bb.read(def: UOffset.self, position: bb.reader)) + Int32(bb.reader))) } | ||
|
||
private init(_ t: Table) { _accessor = t } | ||
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } | ||
|
||
private enum VTOFFSET: VOffset { | ||
case message = 4 | ||
var v: Int32 { Int32(self.rawValue) } | ||
var p: VOffset { self.rawValue } | ||
} | ||
|
||
public var message: String? { let o = _accessor.offset(VTOFFSET.message.v); return o == 0 ? nil : _accessor.string(at: o) } | ||
public var messageSegmentArray: [UInt8]? { return _accessor.getVector(at: VTOFFSET.message.v) } | ||
public static func startHelloReply(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 1) } | ||
public static func add(message: Offset<String>, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: message, at: VTOFFSET.message.p) } | ||
public static func endHelloReply(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset<UOffset> { let end = Offset<UOffset>(offset: fbb.endTable(at: start)); return end } | ||
public static func createHelloReply( | ||
_ fbb: inout FlatBufferBuilder, | ||
messageOffset message: Offset<String> = Offset() | ||
) -> Offset<UOffset> { | ||
let __start = models_HelloReply.startHelloReply(&fbb) | ||
models_HelloReply.add(message: message, &fbb) | ||
return models_HelloReply.endHelloReply(&fbb, start: __start) | ||
} | ||
} | ||
|
||
public struct models_HelloRequest: FlatBufferObject { | ||
|
||
static func validateVersion() { FlatBuffersVersion_1_12_0() } | ||
public var __buffer: ByteBuffer! { return _accessor.bb } | ||
private var _accessor: Table | ||
|
||
public static func getRootAsHelloRequest(bb: ByteBuffer) -> models_HelloRequest { return models_HelloRequest(Table(bb: bb, position: Int32(bb.read(def: UOffset.self, position: bb.reader)) + Int32(bb.reader))) } | ||
|
||
private init(_ t: Table) { _accessor = t } | ||
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } | ||
|
||
private enum VTOFFSET: VOffset { | ||
case name = 4 | ||
var v: Int32 { Int32(self.rawValue) } | ||
var p: VOffset { self.rawValue } | ||
} | ||
|
||
public var name: String? { let o = _accessor.offset(VTOFFSET.name.v); return o == 0 ? nil : _accessor.string(at: o) } | ||
public var nameSegmentArray: [UInt8]? { return _accessor.getVector(at: VTOFFSET.name.v) } | ||
public static func startHelloRequest(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 1) } | ||
public static func add(name: Offset<String>, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: name, at: VTOFFSET.name.p) } | ||
public static func endHelloRequest(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset<UOffset> { let end = Offset<UOffset>(offset: fbb.endTable(at: start)); return end } | ||
public static func createHelloRequest( | ||
_ fbb: inout FlatBufferBuilder, | ||
nameOffset name: Offset<String> = Offset() | ||
) -> Offset<UOffset> { | ||
let __start = models_HelloRequest.startHelloRequest(&fbb) | ||
models_HelloRequest.add(name: name, &fbb) | ||
return models_HelloRequest.endHelloRequest(&fbb, start: __start) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.