route_guide.pb.swift 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  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(bytecode: "\0\u{1}latitude\0\u{1}longitude\0")
  142. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  143. while let fieldNumber = try decoder.nextFieldNumber() {
  144. // The use of inline closures is to circumvent an issue where the compiler
  145. // allocates stack space for every case branch when no optimizations are
  146. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  147. switch fieldNumber {
  148. case 1: try { try decoder.decodeSingularInt32Field(value: &self.latitude) }()
  149. case 2: try { try decoder.decodeSingularInt32Field(value: &self.longitude) }()
  150. default: break
  151. }
  152. }
  153. }
  154. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  155. if self.latitude != 0 {
  156. try visitor.visitSingularInt32Field(value: self.latitude, fieldNumber: 1)
  157. }
  158. if self.longitude != 0 {
  159. try visitor.visitSingularInt32Field(value: self.longitude, fieldNumber: 2)
  160. }
  161. try unknownFields.traverse(visitor: &visitor)
  162. }
  163. public static func ==(lhs: Routeguide_Point, rhs: Routeguide_Point) -> Bool {
  164. if lhs.latitude != rhs.latitude {return false}
  165. if lhs.longitude != rhs.longitude {return false}
  166. if lhs.unknownFields != rhs.unknownFields {return false}
  167. return true
  168. }
  169. }
  170. extension Routeguide_Rectangle: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  171. public static let protoMessageName: String = _protobuf_package + ".Rectangle"
  172. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}lo\0\u{1}hi\0")
  173. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  174. while let fieldNumber = try decoder.nextFieldNumber() {
  175. // The use of inline closures is to circumvent an issue where the compiler
  176. // allocates stack space for every case branch when no optimizations are
  177. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  178. switch fieldNumber {
  179. case 1: try { try decoder.decodeSingularMessageField(value: &self._lo) }()
  180. case 2: try { try decoder.decodeSingularMessageField(value: &self._hi) }()
  181. default: break
  182. }
  183. }
  184. }
  185. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  186. // The use of inline closures is to circumvent an issue where the compiler
  187. // allocates stack space for every if/case branch local when no optimizations
  188. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  189. // https://github.com/apple/swift-protobuf/issues/1182
  190. try { if let v = self._lo {
  191. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  192. } }()
  193. try { if let v = self._hi {
  194. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  195. } }()
  196. try unknownFields.traverse(visitor: &visitor)
  197. }
  198. public static func ==(lhs: Routeguide_Rectangle, rhs: Routeguide_Rectangle) -> Bool {
  199. if lhs._lo != rhs._lo {return false}
  200. if lhs._hi != rhs._hi {return false}
  201. if lhs.unknownFields != rhs.unknownFields {return false}
  202. return true
  203. }
  204. }
  205. extension Routeguide_Feature: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  206. public static let protoMessageName: String = _protobuf_package + ".Feature"
  207. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}name\0\u{1}location\0")
  208. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  209. while let fieldNumber = try decoder.nextFieldNumber() {
  210. // The use of inline closures is to circumvent an issue where the compiler
  211. // allocates stack space for every case branch when no optimizations are
  212. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  213. switch fieldNumber {
  214. case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
  215. case 2: try { try decoder.decodeSingularMessageField(value: &self._location) }()
  216. default: break
  217. }
  218. }
  219. }
  220. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  221. // The use of inline closures is to circumvent an issue where the compiler
  222. // allocates stack space for every if/case branch local when no optimizations
  223. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  224. // https://github.com/apple/swift-protobuf/issues/1182
  225. if !self.name.isEmpty {
  226. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  227. }
  228. try { if let v = self._location {
  229. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  230. } }()
  231. try unknownFields.traverse(visitor: &visitor)
  232. }
  233. public static func ==(lhs: Routeguide_Feature, rhs: Routeguide_Feature) -> Bool {
  234. if lhs.name != rhs.name {return false}
  235. if lhs._location != rhs._location {return false}
  236. if lhs.unknownFields != rhs.unknownFields {return false}
  237. return true
  238. }
  239. }
  240. extension Routeguide_RouteNote: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  241. public static let protoMessageName: String = _protobuf_package + ".RouteNote"
  242. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}location\0\u{1}message\0")
  243. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  244. while let fieldNumber = try decoder.nextFieldNumber() {
  245. // The use of inline closures is to circumvent an issue where the compiler
  246. // allocates stack space for every case branch when no optimizations are
  247. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  248. switch fieldNumber {
  249. case 1: try { try decoder.decodeSingularMessageField(value: &self._location) }()
  250. case 2: try { try decoder.decodeSingularStringField(value: &self.message) }()
  251. default: break
  252. }
  253. }
  254. }
  255. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  256. // The use of inline closures is to circumvent an issue where the compiler
  257. // allocates stack space for every if/case branch local when no optimizations
  258. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  259. // https://github.com/apple/swift-protobuf/issues/1182
  260. try { if let v = self._location {
  261. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  262. } }()
  263. if !self.message.isEmpty {
  264. try visitor.visitSingularStringField(value: self.message, fieldNumber: 2)
  265. }
  266. try unknownFields.traverse(visitor: &visitor)
  267. }
  268. public static func ==(lhs: Routeguide_RouteNote, rhs: Routeguide_RouteNote) -> Bool {
  269. if lhs._location != rhs._location {return false}
  270. if lhs.message != rhs.message {return false}
  271. if lhs.unknownFields != rhs.unknownFields {return false}
  272. return true
  273. }
  274. }
  275. extension Routeguide_RouteSummary: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  276. public static let protoMessageName: String = _protobuf_package + ".RouteSummary"
  277. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}point_count\0\u{3}feature_count\0\u{1}distance\0\u{3}elapsed_time\0")
  278. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  279. while let fieldNumber = try decoder.nextFieldNumber() {
  280. // The use of inline closures is to circumvent an issue where the compiler
  281. // allocates stack space for every case branch when no optimizations are
  282. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  283. switch fieldNumber {
  284. case 1: try { try decoder.decodeSingularInt32Field(value: &self.pointCount) }()
  285. case 2: try { try decoder.decodeSingularInt32Field(value: &self.featureCount) }()
  286. case 3: try { try decoder.decodeSingularInt32Field(value: &self.distance) }()
  287. case 4: try { try decoder.decodeSingularInt32Field(value: &self.elapsedTime) }()
  288. default: break
  289. }
  290. }
  291. }
  292. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  293. if self.pointCount != 0 {
  294. try visitor.visitSingularInt32Field(value: self.pointCount, fieldNumber: 1)
  295. }
  296. if self.featureCount != 0 {
  297. try visitor.visitSingularInt32Field(value: self.featureCount, fieldNumber: 2)
  298. }
  299. if self.distance != 0 {
  300. try visitor.visitSingularInt32Field(value: self.distance, fieldNumber: 3)
  301. }
  302. if self.elapsedTime != 0 {
  303. try visitor.visitSingularInt32Field(value: self.elapsedTime, fieldNumber: 4)
  304. }
  305. try unknownFields.traverse(visitor: &visitor)
  306. }
  307. public static func ==(lhs: Routeguide_RouteSummary, rhs: Routeguide_RouteSummary) -> Bool {
  308. if lhs.pointCount != rhs.pointCount {return false}
  309. if lhs.featureCount != rhs.featureCount {return false}
  310. if lhs.distance != rhs.distance {return false}
  311. if lhs.elapsedTime != rhs.elapsedTime {return false}
  312. if lhs.unknownFields != rhs.unknownFields {return false}
  313. return true
  314. }
  315. }