route_guide.pb.swift 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. //
  4. // Generated by the Swift generator plugin for the protocol buffer compiler.
  5. // Source: route_guide.proto
  6. //
  7. // For information on using the generated types, please see the documentation:
  8. // https://github.com/apple/swift-protobuf/
  9. // Copyright 2015 gRPC authors.
  10. //
  11. // Licensed under the Apache License, Version 2.0 (the "License");
  12. // you may not use this file except in compliance with the License.
  13. // You may obtain a copy of the License at
  14. //
  15. // http://www.apache.org/licenses/LICENSE-2.0
  16. //
  17. // Unless required by applicable law or agreed to in writing, software
  18. // distributed under the License is distributed on an "AS IS" BASIS,
  19. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20. // See the License for the specific language governing permissions and
  21. // limitations under the License.
  22. import Foundation
  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 {
  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 {
  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 {
  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 {
  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 {
  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. switch fieldNumber {
  148. case 1: try decoder.decodeSingularInt32Field(value: &self.latitude)
  149. case 2: 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 = [
  173. 1: .same(proto: "lo"),
  174. 2: .same(proto: "hi"),
  175. ]
  176. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  177. while let fieldNumber = try decoder.nextFieldNumber() {
  178. switch fieldNumber {
  179. case 1: try decoder.decodeSingularMessageField(value: &self._lo)
  180. case 2: try decoder.decodeSingularMessageField(value: &self._hi)
  181. default: break
  182. }
  183. }
  184. }
  185. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  186. if let v = self._lo {
  187. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  188. }
  189. if let v = self._hi {
  190. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  191. }
  192. try unknownFields.traverse(visitor: &visitor)
  193. }
  194. public static func ==(lhs: Routeguide_Rectangle, rhs: Routeguide_Rectangle) -> Bool {
  195. if lhs._lo != rhs._lo {return false}
  196. if lhs._hi != rhs._hi {return false}
  197. if lhs.unknownFields != rhs.unknownFields {return false}
  198. return true
  199. }
  200. }
  201. extension Routeguide_Feature: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  202. public static let protoMessageName: String = _protobuf_package + ".Feature"
  203. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  204. 1: .same(proto: "name"),
  205. 2: .same(proto: "location"),
  206. ]
  207. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  208. while let fieldNumber = try decoder.nextFieldNumber() {
  209. switch fieldNumber {
  210. case 1: try decoder.decodeSingularStringField(value: &self.name)
  211. case 2: try decoder.decodeSingularMessageField(value: &self._location)
  212. default: break
  213. }
  214. }
  215. }
  216. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  217. if !self.name.isEmpty {
  218. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  219. }
  220. if let v = self._location {
  221. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  222. }
  223. try unknownFields.traverse(visitor: &visitor)
  224. }
  225. public static func ==(lhs: Routeguide_Feature, rhs: Routeguide_Feature) -> Bool {
  226. if lhs.name != rhs.name {return false}
  227. if lhs._location != rhs._location {return false}
  228. if lhs.unknownFields != rhs.unknownFields {return false}
  229. return true
  230. }
  231. }
  232. extension Routeguide_RouteNote: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  233. public static let protoMessageName: String = _protobuf_package + ".RouteNote"
  234. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  235. 1: .same(proto: "location"),
  236. 2: .same(proto: "message"),
  237. ]
  238. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  239. while let fieldNumber = try decoder.nextFieldNumber() {
  240. switch fieldNumber {
  241. case 1: try decoder.decodeSingularMessageField(value: &self._location)
  242. case 2: try decoder.decodeSingularStringField(value: &self.message)
  243. default: break
  244. }
  245. }
  246. }
  247. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  248. if let v = self._location {
  249. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  250. }
  251. if !self.message.isEmpty {
  252. try visitor.visitSingularStringField(value: self.message, fieldNumber: 2)
  253. }
  254. try unknownFields.traverse(visitor: &visitor)
  255. }
  256. public static func ==(lhs: Routeguide_RouteNote, rhs: Routeguide_RouteNote) -> Bool {
  257. if lhs._location != rhs._location {return false}
  258. if lhs.message != rhs.message {return false}
  259. if lhs.unknownFields != rhs.unknownFields {return false}
  260. return true
  261. }
  262. }
  263. extension Routeguide_RouteSummary: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  264. public static let protoMessageName: String = _protobuf_package + ".RouteSummary"
  265. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  266. 1: .standard(proto: "point_count"),
  267. 2: .standard(proto: "feature_count"),
  268. 3: .same(proto: "distance"),
  269. 4: .standard(proto: "elapsed_time"),
  270. ]
  271. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  272. while let fieldNumber = try decoder.nextFieldNumber() {
  273. switch fieldNumber {
  274. case 1: try decoder.decodeSingularInt32Field(value: &self.pointCount)
  275. case 2: try decoder.decodeSingularInt32Field(value: &self.featureCount)
  276. case 3: try decoder.decodeSingularInt32Field(value: &self.distance)
  277. case 4: try decoder.decodeSingularInt32Field(value: &self.elapsedTime)
  278. default: break
  279. }
  280. }
  281. }
  282. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  283. if self.pointCount != 0 {
  284. try visitor.visitSingularInt32Field(value: self.pointCount, fieldNumber: 1)
  285. }
  286. if self.featureCount != 0 {
  287. try visitor.visitSingularInt32Field(value: self.featureCount, fieldNumber: 2)
  288. }
  289. if self.distance != 0 {
  290. try visitor.visitSingularInt32Field(value: self.distance, fieldNumber: 3)
  291. }
  292. if self.elapsedTime != 0 {
  293. try visitor.visitSingularInt32Field(value: self.elapsedTime, fieldNumber: 4)
  294. }
  295. try unknownFields.traverse(visitor: &visitor)
  296. }
  297. public static func ==(lhs: Routeguide_RouteSummary, rhs: Routeguide_RouteSummary) -> Bool {
  298. if lhs.pointCount != rhs.pointCount {return false}
  299. if lhs.featureCount != rhs.featureCount {return false}
  300. if lhs.distance != rhs.distance {return false}
  301. if lhs.elapsedTime != rhs.elapsedTime {return false}
  302. if lhs.unknownFields != rhs.unknownFields {return false}
  303. return true
  304. }
  305. }