route_guide.pb.swift 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. // swiftlint:disable all
  4. //
  5. // Generated by the Swift generator plugin for the protocol buffer compiler.
  6. // Source: route_guide.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. // Copyright 2015 gRPC authors.
  11. //
  12. // Licensed under the Apache License, Version 2.0 (the "License");
  13. // you may not use this file except in compliance with the License.
  14. // You may obtain a copy of the License at
  15. //
  16. // http://www.apache.org/licenses/LICENSE-2.0
  17. //
  18. // Unless required by applicable law or agreed to in writing, software
  19. // distributed under the License is distributed on an "AS IS" BASIS,
  20. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  21. // See the License for the specific language governing permissions and
  22. // limitations under the License.
  23. import SwiftProtobuf
  24. // If the compiler emits an error on this type, it is because this file
  25. // was generated by a version of the `protoc` Swift plug-in that is
  26. // incompatible with the version of SwiftProtobuf to which you are linking.
  27. // Please ensure that you are building against the same version of the API
  28. // that was used to generate this file.
  29. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  30. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  31. typealias Version = _2
  32. }
  33. /// Points are represented as latitude-longitude pairs in the E7 representation
  34. /// (degrees multiplied by 10**7 and rounded to the nearest integer).
  35. /// Latitudes should be in the range +/- 90 degrees and longitude should be in
  36. /// the range +/- 180 degrees (inclusive).
  37. public struct Routeguide_Point: Sendable {
  38. // SwiftProtobuf.Message conformance is added in an extension below. See the
  39. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  40. // methods supported on all messages.
  41. public var latitude: Int32 = 0
  42. public var longitude: Int32 = 0
  43. public var unknownFields = SwiftProtobuf.UnknownStorage()
  44. public init() {}
  45. }
  46. /// A latitude-longitude rectangle, represented as two diagonally opposite
  47. /// points "lo" and "hi".
  48. public struct Routeguide_Rectangle: Sendable {
  49. // SwiftProtobuf.Message conformance is added in an extension below. See the
  50. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  51. // methods supported on all messages.
  52. /// One corner of the rectangle.
  53. public var lo: Routeguide_Point {
  54. get {return _lo ?? Routeguide_Point()}
  55. set {_lo = newValue}
  56. }
  57. /// Returns true if `lo` has been explicitly set.
  58. public var hasLo: Bool {return self._lo != nil}
  59. /// Clears the value of `lo`. Subsequent reads from it will return its default value.
  60. public mutating func clearLo() {self._lo = nil}
  61. /// The other corner of the rectangle.
  62. public var hi: Routeguide_Point {
  63. get {return _hi ?? Routeguide_Point()}
  64. set {_hi = newValue}
  65. }
  66. /// Returns true if `hi` has been explicitly set.
  67. public var hasHi: Bool {return self._hi != nil}
  68. /// Clears the value of `hi`. Subsequent reads from it will return its default value.
  69. public mutating func clearHi() {self._hi = nil}
  70. public var unknownFields = SwiftProtobuf.UnknownStorage()
  71. public init() {}
  72. fileprivate var _lo: Routeguide_Point? = nil
  73. fileprivate var _hi: Routeguide_Point? = nil
  74. }
  75. /// A feature names something at a given point.
  76. ///
  77. /// If a feature could not be named, the name is empty.
  78. public struct Routeguide_Feature: Sendable {
  79. // SwiftProtobuf.Message conformance is added in an extension below. See the
  80. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  81. // methods supported on all messages.
  82. /// The name of the feature.
  83. public var name: String = String()
  84. /// The point where the feature is detected.
  85. public var location: Routeguide_Point {
  86. get {return _location ?? Routeguide_Point()}
  87. set {_location = newValue}
  88. }
  89. /// Returns true if `location` has been explicitly set.
  90. public var hasLocation: Bool {return self._location != nil}
  91. /// Clears the value of `location`. Subsequent reads from it will return its default value.
  92. public mutating func clearLocation() {self._location = nil}
  93. public var unknownFields = SwiftProtobuf.UnknownStorage()
  94. public init() {}
  95. fileprivate var _location: Routeguide_Point? = nil
  96. }
  97. /// A RouteNote is a message sent while at a given point.
  98. public struct Routeguide_RouteNote: Sendable {
  99. // SwiftProtobuf.Message conformance is added in an extension below. See the
  100. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  101. // methods supported on all messages.
  102. /// The location from which the message is sent.
  103. public var location: Routeguide_Point {
  104. get {return _location ?? Routeguide_Point()}
  105. set {_location = newValue}
  106. }
  107. /// Returns true if `location` has been explicitly set.
  108. public var hasLocation: Bool {return self._location != nil}
  109. /// Clears the value of `location`. Subsequent reads from it will return its default value.
  110. public mutating func clearLocation() {self._location = nil}
  111. /// The message to be sent.
  112. public var message: String = String()
  113. public var unknownFields = SwiftProtobuf.UnknownStorage()
  114. public init() {}
  115. fileprivate var _location: Routeguide_Point? = nil
  116. }
  117. /// A RouteSummary is received in response to a RecordRoute rpc.
  118. ///
  119. /// It contains the number of individual points received, the number of
  120. /// detected features, and the total distance covered as the cumulative sum of
  121. /// the distance between each point.
  122. public struct Routeguide_RouteSummary: Sendable {
  123. // SwiftProtobuf.Message conformance is added in an extension below. See the
  124. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  125. // methods supported on all messages.
  126. /// The number of points received.
  127. public var pointCount: Int32 = 0
  128. /// The number of known features passed while traversing the route.
  129. public var featureCount: Int32 = 0
  130. /// The distance covered in metres.
  131. public var distance: Int32 = 0
  132. /// The duration of the traversal in seconds.
  133. public var elapsedTime: Int32 = 0
  134. public var unknownFields = SwiftProtobuf.UnknownStorage()
  135. public init() {}
  136. }
  137. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  138. fileprivate let _protobuf_package = "routeguide"
  139. extension Routeguide_Point: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  140. public static let protoMessageName: String = _protobuf_package + ".Point"
  141. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  142. 1: .same(proto: "latitude"),
  143. 2: .same(proto: "longitude"),
  144. ]
  145. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  146. while let fieldNumber = try decoder.nextFieldNumber() {
  147. // The use of inline closures is to circumvent an issue where the compiler
  148. // allocates stack space for every case branch when no optimizations are
  149. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  150. switch fieldNumber {
  151. case 1: try { try decoder.decodeSingularInt32Field(value: &self.latitude) }()
  152. case 2: try { try decoder.decodeSingularInt32Field(value: &self.longitude) }()
  153. default: break
  154. }
  155. }
  156. }
  157. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  158. if self.latitude != 0 {
  159. try visitor.visitSingularInt32Field(value: self.latitude, fieldNumber: 1)
  160. }
  161. if self.longitude != 0 {
  162. try visitor.visitSingularInt32Field(value: self.longitude, fieldNumber: 2)
  163. }
  164. try unknownFields.traverse(visitor: &visitor)
  165. }
  166. public static func ==(lhs: Routeguide_Point, rhs: Routeguide_Point) -> Bool {
  167. if lhs.latitude != rhs.latitude {return false}
  168. if lhs.longitude != rhs.longitude {return false}
  169. if lhs.unknownFields != rhs.unknownFields {return false}
  170. return true
  171. }
  172. }
  173. extension Routeguide_Rectangle: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  174. public static let protoMessageName: String = _protobuf_package + ".Rectangle"
  175. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  176. 1: .same(proto: "lo"),
  177. 2: .same(proto: "hi"),
  178. ]
  179. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  180. while let fieldNumber = try decoder.nextFieldNumber() {
  181. // The use of inline closures is to circumvent an issue where the compiler
  182. // allocates stack space for every case branch when no optimizations are
  183. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  184. switch fieldNumber {
  185. case 1: try { try decoder.decodeSingularMessageField(value: &self._lo) }()
  186. case 2: try { try decoder.decodeSingularMessageField(value: &self._hi) }()
  187. default: break
  188. }
  189. }
  190. }
  191. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  192. // The use of inline closures is to circumvent an issue where the compiler
  193. // allocates stack space for every if/case branch local when no optimizations
  194. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  195. // https://github.com/apple/swift-protobuf/issues/1182
  196. try { if let v = self._lo {
  197. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  198. } }()
  199. try { if let v = self._hi {
  200. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  201. } }()
  202. try unknownFields.traverse(visitor: &visitor)
  203. }
  204. public static func ==(lhs: Routeguide_Rectangle, rhs: Routeguide_Rectangle) -> Bool {
  205. if lhs._lo != rhs._lo {return false}
  206. if lhs._hi != rhs._hi {return false}
  207. if lhs.unknownFields != rhs.unknownFields {return false}
  208. return true
  209. }
  210. }
  211. extension Routeguide_Feature: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  212. public static let protoMessageName: String = _protobuf_package + ".Feature"
  213. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  214. 1: .same(proto: "name"),
  215. 2: .same(proto: "location"),
  216. ]
  217. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  218. while let fieldNumber = try decoder.nextFieldNumber() {
  219. // The use of inline closures is to circumvent an issue where the compiler
  220. // allocates stack space for every case branch when no optimizations are
  221. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  222. switch fieldNumber {
  223. case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
  224. case 2: try { try decoder.decodeSingularMessageField(value: &self._location) }()
  225. default: break
  226. }
  227. }
  228. }
  229. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  230. // The use of inline closures is to circumvent an issue where the compiler
  231. // allocates stack space for every if/case branch local when no optimizations
  232. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  233. // https://github.com/apple/swift-protobuf/issues/1182
  234. if !self.name.isEmpty {
  235. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  236. }
  237. try { if let v = self._location {
  238. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  239. } }()
  240. try unknownFields.traverse(visitor: &visitor)
  241. }
  242. public static func ==(lhs: Routeguide_Feature, rhs: Routeguide_Feature) -> Bool {
  243. if lhs.name != rhs.name {return false}
  244. if lhs._location != rhs._location {return false}
  245. if lhs.unknownFields != rhs.unknownFields {return false}
  246. return true
  247. }
  248. }
  249. extension Routeguide_RouteNote: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  250. public static let protoMessageName: String = _protobuf_package + ".RouteNote"
  251. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  252. 1: .same(proto: "location"),
  253. 2: .same(proto: "message"),
  254. ]
  255. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  256. while let fieldNumber = try decoder.nextFieldNumber() {
  257. // The use of inline closures is to circumvent an issue where the compiler
  258. // allocates stack space for every case branch when no optimizations are
  259. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  260. switch fieldNumber {
  261. case 1: try { try decoder.decodeSingularMessageField(value: &self._location) }()
  262. case 2: try { try decoder.decodeSingularStringField(value: &self.message) }()
  263. default: break
  264. }
  265. }
  266. }
  267. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  268. // The use of inline closures is to circumvent an issue where the compiler
  269. // allocates stack space for every if/case branch local when no optimizations
  270. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  271. // https://github.com/apple/swift-protobuf/issues/1182
  272. try { if let v = self._location {
  273. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  274. } }()
  275. if !self.message.isEmpty {
  276. try visitor.visitSingularStringField(value: self.message, fieldNumber: 2)
  277. }
  278. try unknownFields.traverse(visitor: &visitor)
  279. }
  280. public static func ==(lhs: Routeguide_RouteNote, rhs: Routeguide_RouteNote) -> Bool {
  281. if lhs._location != rhs._location {return false}
  282. if lhs.message != rhs.message {return false}
  283. if lhs.unknownFields != rhs.unknownFields {return false}
  284. return true
  285. }
  286. }
  287. extension Routeguide_RouteSummary: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  288. public static let protoMessageName: String = _protobuf_package + ".RouteSummary"
  289. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  290. 1: .standard(proto: "point_count"),
  291. 2: .standard(proto: "feature_count"),
  292. 3: .same(proto: "distance"),
  293. 4: .standard(proto: "elapsed_time"),
  294. ]
  295. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  296. while let fieldNumber = try decoder.nextFieldNumber() {
  297. // The use of inline closures is to circumvent an issue where the compiler
  298. // allocates stack space for every case branch when no optimizations are
  299. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  300. switch fieldNumber {
  301. case 1: try { try decoder.decodeSingularInt32Field(value: &self.pointCount) }()
  302. case 2: try { try decoder.decodeSingularInt32Field(value: &self.featureCount) }()
  303. case 3: try { try decoder.decodeSingularInt32Field(value: &self.distance) }()
  304. case 4: try { try decoder.decodeSingularInt32Field(value: &self.elapsedTime) }()
  305. default: break
  306. }
  307. }
  308. }
  309. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  310. if self.pointCount != 0 {
  311. try visitor.visitSingularInt32Field(value: self.pointCount, fieldNumber: 1)
  312. }
  313. if self.featureCount != 0 {
  314. try visitor.visitSingularInt32Field(value: self.featureCount, fieldNumber: 2)
  315. }
  316. if self.distance != 0 {
  317. try visitor.visitSingularInt32Field(value: self.distance, fieldNumber: 3)
  318. }
  319. if self.elapsedTime != 0 {
  320. try visitor.visitSingularInt32Field(value: self.elapsedTime, fieldNumber: 4)
  321. }
  322. try unknownFields.traverse(visitor: &visitor)
  323. }
  324. public static func ==(lhs: Routeguide_RouteSummary, rhs: Routeguide_RouteSummary) -> Bool {
  325. if lhs.pointCount != rhs.pointCount {return false}
  326. if lhs.featureCount != rhs.featureCount {return false}
  327. if lhs.distance != rhs.distance {return false}
  328. if lhs.elapsedTime != rhs.elapsedTime {return false}
  329. if lhs.unknownFields != rhs.unknownFields {return false}
  330. return true
  331. }
  332. }