route_guide.pb.swift 13 KB

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