unittest_delimited.pb.swift 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  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: google/protobuf/unittest_delimited.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. import SwiftProtobuf
  11. // If the compiler emits an error on this type, it is because this file
  12. // was generated by a version of the `protoc` Swift plug-in that is
  13. // incompatible with the version of SwiftProtobuf to which you are linking.
  14. // Please ensure that you are building against the same version of the API
  15. // that was used to generate this file.
  16. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  17. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  18. typealias Version = _2
  19. }
  20. struct EditionsUnittest_LengthPrefixed: Sendable {
  21. // SwiftProtobuf.Message conformance is added in an extension below. See the
  22. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  23. // methods supported on all messages.
  24. var a: Int32 {
  25. get {return _a ?? 0}
  26. set {_a = newValue}
  27. }
  28. /// Returns true if `a` has been explicitly set.
  29. var hasA: Bool {return self._a != nil}
  30. /// Clears the value of `a`. Subsequent reads from it will return its default value.
  31. mutating func clearA() {self._a = nil}
  32. var b: Int32 {
  33. get {return _b ?? 0}
  34. set {_b = newValue}
  35. }
  36. /// Returns true if `b` has been explicitly set.
  37. var hasB: Bool {return self._b != nil}
  38. /// Clears the value of `b`. Subsequent reads from it will return its default value.
  39. mutating func clearB() {self._b = nil}
  40. var unknownFields = SwiftProtobuf.UnknownStorage()
  41. init() {}
  42. fileprivate var _a: Int32? = nil
  43. fileprivate var _b: Int32? = nil
  44. }
  45. struct EditionsUnittest_NotGroupLikeScope: Sendable {
  46. // SwiftProtobuf.Message conformance is added in an extension below. See the
  47. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  48. // methods supported on all messages.
  49. var a: Int32 {
  50. get {return _a ?? 0}
  51. set {_a = newValue}
  52. }
  53. /// Returns true if `a` has been explicitly set.
  54. var hasA: Bool {return self._a != nil}
  55. /// Clears the value of `a`. Subsequent reads from it will return its default value.
  56. mutating func clearA() {self._a = nil}
  57. var b: Int32 {
  58. get {return _b ?? 0}
  59. set {_b = newValue}
  60. }
  61. /// Returns true if `b` has been explicitly set.
  62. var hasB: Bool {return self._b != nil}
  63. /// Clears the value of `b`. Subsequent reads from it will return its default value.
  64. mutating func clearB() {self._b = nil}
  65. var unknownFields = SwiftProtobuf.UnknownStorage()
  66. init() {}
  67. fileprivate var _a: Int32? = nil
  68. fileprivate var _b: Int32? = nil
  69. }
  70. struct EditionsUnittest_GroupLikeFileScope: Sendable {
  71. // SwiftProtobuf.Message conformance is added in an extension below. See the
  72. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  73. // methods supported on all messages.
  74. var a: Int32 {
  75. get {return _a ?? 0}
  76. set {_a = newValue}
  77. }
  78. /// Returns true if `a` has been explicitly set.
  79. var hasA: Bool {return self._a != nil}
  80. /// Clears the value of `a`. Subsequent reads from it will return its default value.
  81. mutating func clearA() {self._a = nil}
  82. var b: Int32 {
  83. get {return _b ?? 0}
  84. set {_b = newValue}
  85. }
  86. /// Returns true if `b` has been explicitly set.
  87. var hasB: Bool {return self._b != nil}
  88. /// Clears the value of `b`. Subsequent reads from it will return its default value.
  89. mutating func clearB() {self._b = nil}
  90. var unknownFields = SwiftProtobuf.UnknownStorage()
  91. init() {}
  92. fileprivate var _a: Int32? = nil
  93. fileprivate var _b: Int32? = nil
  94. }
  95. struct EditionsUnittest_TestDelimited: SwiftProtobuf.ExtensibleMessage, @unchecked Sendable {
  96. // SwiftProtobuf.Message conformance is added in an extension below. See the
  97. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  98. // methods supported on all messages.
  99. /// Non-delimited field that otherwise looks group-like.
  100. var lengthprefixed: EditionsUnittest_TestDelimited.LengthPrefixed {
  101. get {return _storage._lengthprefixed ?? EditionsUnittest_TestDelimited.LengthPrefixed()}
  102. set {_uniqueStorage()._lengthprefixed = newValue}
  103. }
  104. /// Returns true if `lengthprefixed` has been explicitly set.
  105. var hasLengthprefixed: Bool {return _storage._lengthprefixed != nil}
  106. /// Clears the value of `lengthprefixed`. Subsequent reads from it will return its default value.
  107. mutating func clearLengthprefixed() {_uniqueStorage()._lengthprefixed = nil}
  108. /// Nested field for nested tests.
  109. var nested: EditionsUnittest_TestDelimited {
  110. get {return _storage._nested ?? EditionsUnittest_TestDelimited()}
  111. set {_uniqueStorage()._nested = newValue}
  112. }
  113. /// Returns true if `nested` has been explicitly set.
  114. var hasNested: Bool {return _storage._nested != nil}
  115. /// Clears the value of `nested`. Subsequent reads from it will return its default value.
  116. mutating func clearNested() {_uniqueStorage()._nested = nil}
  117. /// Truly group-like field.
  118. var groupLike: EditionsUnittest_TestDelimited.GroupLike {
  119. get {return _storage._groupLike ?? EditionsUnittest_TestDelimited.GroupLike()}
  120. set {_uniqueStorage()._groupLike = newValue}
  121. }
  122. /// Returns true if `groupLike` has been explicitly set.
  123. var hasGroupLike: Bool {return _storage._groupLike != nil}
  124. /// Clears the value of `groupLike`. Subsequent reads from it will return its default value.
  125. mutating func clearGroupLike() {_uniqueStorage()._groupLike = nil}
  126. /// Delimited field that isn't group-like solely because of its name.
  127. var notgrouplike: EditionsUnittest_TestDelimited.GroupLike {
  128. get {return _storage._notgrouplike ?? EditionsUnittest_TestDelimited.GroupLike()}
  129. set {_uniqueStorage()._notgrouplike = newValue}
  130. }
  131. /// Returns true if `notgrouplike` has been explicitly set.
  132. var hasNotgrouplike: Bool {return _storage._notgrouplike != nil}
  133. /// Clears the value of `notgrouplike`. Subsequent reads from it will return its default value.
  134. mutating func clearNotgrouplike() {_uniqueStorage()._notgrouplike = nil}
  135. /// Delimited field that isn't group-like because of the scope of its type.
  136. var notgrouplikescope: EditionsUnittest_NotGroupLikeScope {
  137. get {return _storage._notgrouplikescope ?? EditionsUnittest_NotGroupLikeScope()}
  138. set {_uniqueStorage()._notgrouplikescope = newValue}
  139. }
  140. /// Returns true if `notgrouplikescope` has been explicitly set.
  141. var hasNotgrouplikescope: Bool {return _storage._notgrouplikescope != nil}
  142. /// Clears the value of `notgrouplikescope`. Subsequent reads from it will return its default value.
  143. mutating func clearNotgrouplikescope() {_uniqueStorage()._notgrouplikescope = nil}
  144. /// Delimited field that's grouplike except that it's an imported type.
  145. var messageimport: EditionsUnittest_MessageImport {
  146. get {return _storage._messageimport ?? EditionsUnittest_MessageImport()}
  147. set {_uniqueStorage()._messageimport = newValue}
  148. }
  149. /// Returns true if `messageimport` has been explicitly set.
  150. var hasMessageimport: Bool {return _storage._messageimport != nil}
  151. /// Clears the value of `messageimport`. Subsequent reads from it will return its default value.
  152. mutating func clearMessageimport() {_uniqueStorage()._messageimport = nil}
  153. var unknownFields = SwiftProtobuf.UnknownStorage()
  154. struct LengthPrefixed: Sendable {
  155. // SwiftProtobuf.Message conformance is added in an extension below. See the
  156. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  157. // methods supported on all messages.
  158. var a: Int32 {
  159. get {return _a ?? 0}
  160. set {_a = newValue}
  161. }
  162. /// Returns true if `a` has been explicitly set.
  163. var hasA: Bool {return self._a != nil}
  164. /// Clears the value of `a`. Subsequent reads from it will return its default value.
  165. mutating func clearA() {self._a = nil}
  166. var b: Int32 {
  167. get {return _b ?? 0}
  168. set {_b = newValue}
  169. }
  170. /// Returns true if `b` has been explicitly set.
  171. var hasB: Bool {return self._b != nil}
  172. /// Clears the value of `b`. Subsequent reads from it will return its default value.
  173. mutating func clearB() {self._b = nil}
  174. var unknownFields = SwiftProtobuf.UnknownStorage()
  175. init() {}
  176. fileprivate var _a: Int32? = nil
  177. fileprivate var _b: Int32? = nil
  178. }
  179. struct GroupLike: Sendable {
  180. // SwiftProtobuf.Message conformance is added in an extension below. See the
  181. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  182. // methods supported on all messages.
  183. var a: Int32 {
  184. get {return _a ?? 0}
  185. set {_a = newValue}
  186. }
  187. /// Returns true if `a` has been explicitly set.
  188. var hasA: Bool {return self._a != nil}
  189. /// Clears the value of `a`. Subsequent reads from it will return its default value.
  190. mutating func clearA() {self._a = nil}
  191. var b: Int32 {
  192. get {return _b ?? 0}
  193. set {_b = newValue}
  194. }
  195. /// Returns true if `b` has been explicitly set.
  196. var hasB: Bool {return self._b != nil}
  197. /// Clears the value of `b`. Subsequent reads from it will return its default value.
  198. mutating func clearB() {self._b = nil}
  199. var unknownFields = SwiftProtobuf.UnknownStorage()
  200. init() {}
  201. fileprivate var _a: Int32? = nil
  202. fileprivate var _b: Int32? = nil
  203. }
  204. init() {}
  205. var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet()
  206. fileprivate var _storage = _StorageClass.defaultInstance
  207. }
  208. // MARK: - Extension support defined in unittest_delimited.proto.
  209. // MARK: - Extension Properties
  210. // Swift Extensions on the extended Messages to add easy access to the declared
  211. // extension fields. The names are based on the extension field name from the proto
  212. // declaration. To avoid naming collisions, the names are prefixed with the name of
  213. // the scope where the extend directive occurs.
  214. extension EditionsUnittest_TestDelimited {
  215. /// Non-delimited field that otherwise looks group-like.
  216. var EditionsUnittest_lengthprefixed: EditionsUnittest_LengthPrefixed {
  217. get {return getExtensionValue(ext: EditionsUnittest_Extensions_lengthprefixed) ?? EditionsUnittest_LengthPrefixed()}
  218. set {setExtensionValue(ext: EditionsUnittest_Extensions_lengthprefixed, value: newValue)}
  219. }
  220. /// Returns true if extension `EditionsUnittest_Extensions_lengthprefixed`
  221. /// has been explicitly set.
  222. var hasEditionsUnittest_lengthprefixed: Bool {
  223. return hasExtensionValue(ext: EditionsUnittest_Extensions_lengthprefixed)
  224. }
  225. /// Clears the value of extension `EditionsUnittest_Extensions_lengthprefixed`.
  226. /// Subsequent reads from it will return its default value.
  227. mutating func clearEditionsUnittest_lengthprefixed() {
  228. clearExtensionValue(ext: EditionsUnittest_Extensions_lengthprefixed)
  229. }
  230. /// Truly group-like extension.
  231. var EditionsUnittest_groupLikeFileScope: EditionsUnittest_GroupLikeFileScope {
  232. get {return getExtensionValue(ext: EditionsUnittest_Extensions_GroupLikeFileScope) ?? EditionsUnittest_GroupLikeFileScope()}
  233. set {setExtensionValue(ext: EditionsUnittest_Extensions_GroupLikeFileScope, value: newValue)}
  234. }
  235. /// Returns true if extension `EditionsUnittest_Extensions_GroupLikeFileScope`
  236. /// has been explicitly set.
  237. var hasEditionsUnittest_groupLikeFileScope: Bool {
  238. return hasExtensionValue(ext: EditionsUnittest_Extensions_GroupLikeFileScope)
  239. }
  240. /// Clears the value of extension `EditionsUnittest_Extensions_GroupLikeFileScope`.
  241. /// Subsequent reads from it will return its default value.
  242. mutating func clearEditionsUnittest_groupLikeFileScope() {
  243. clearExtensionValue(ext: EditionsUnittest_Extensions_GroupLikeFileScope)
  244. }
  245. /// Delimited extension that isn't group-like because of its name.
  246. var EditionsUnittest_notGroupLikeScope: EditionsUnittest_NotGroupLikeScope {
  247. get {return getExtensionValue(ext: EditionsUnittest_Extensions_not_group_like_scope) ?? EditionsUnittest_NotGroupLikeScope()}
  248. set {setExtensionValue(ext: EditionsUnittest_Extensions_not_group_like_scope, value: newValue)}
  249. }
  250. /// Returns true if extension `EditionsUnittest_Extensions_not_group_like_scope`
  251. /// has been explicitly set.
  252. var hasEditionsUnittest_notGroupLikeScope: Bool {
  253. return hasExtensionValue(ext: EditionsUnittest_Extensions_not_group_like_scope)
  254. }
  255. /// Clears the value of extension `EditionsUnittest_Extensions_not_group_like_scope`.
  256. /// Subsequent reads from it will return its default value.
  257. mutating func clearEditionsUnittest_notGroupLikeScope() {
  258. clearExtensionValue(ext: EditionsUnittest_Extensions_not_group_like_scope)
  259. }
  260. /// Delimited extension that isn't group-like because of the scope of its type.
  261. var EditionsUnittest_grouplike: EditionsUnittest_TestDelimited.GroupLike {
  262. get {return getExtensionValue(ext: EditionsUnittest_Extensions_grouplike) ?? EditionsUnittest_TestDelimited.GroupLike()}
  263. set {setExtensionValue(ext: EditionsUnittest_Extensions_grouplike, value: newValue)}
  264. }
  265. /// Returns true if extension `EditionsUnittest_Extensions_grouplike`
  266. /// has been explicitly set.
  267. var hasEditionsUnittest_grouplike: Bool {
  268. return hasExtensionValue(ext: EditionsUnittest_Extensions_grouplike)
  269. }
  270. /// Clears the value of extension `EditionsUnittest_Extensions_grouplike`.
  271. /// Subsequent reads from it will return its default value.
  272. mutating func clearEditionsUnittest_grouplike() {
  273. clearExtensionValue(ext: EditionsUnittest_Extensions_grouplike)
  274. }
  275. /// Delimited extension that's grouplike except that it's an imported type.
  276. var EditionsUnittest_messageimport: EditionsUnittest_MessageImport {
  277. get {return getExtensionValue(ext: EditionsUnittest_Extensions_messageimport) ?? EditionsUnittest_MessageImport()}
  278. set {setExtensionValue(ext: EditionsUnittest_Extensions_messageimport, value: newValue)}
  279. }
  280. /// Returns true if extension `EditionsUnittest_Extensions_messageimport`
  281. /// has been explicitly set.
  282. var hasEditionsUnittest_messageimport: Bool {
  283. return hasExtensionValue(ext: EditionsUnittest_Extensions_messageimport)
  284. }
  285. /// Clears the value of extension `EditionsUnittest_Extensions_messageimport`.
  286. /// Subsequent reads from it will return its default value.
  287. mutating func clearEditionsUnittest_messageimport() {
  288. clearExtensionValue(ext: EditionsUnittest_Extensions_messageimport)
  289. }
  290. }
  291. // MARK: - File's ExtensionMap: EditionsUnittest_UnittestDelimited_Extensions
  292. /// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by
  293. /// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed
  294. /// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create
  295. /// a larger `SwiftProtobuf.SimpleExtensionMap`.
  296. let EditionsUnittest_UnittestDelimited_Extensions: SwiftProtobuf.SimpleExtensionMap = [
  297. EditionsUnittest_Extensions_lengthprefixed,
  298. EditionsUnittest_Extensions_GroupLikeFileScope,
  299. EditionsUnittest_Extensions_not_group_like_scope,
  300. EditionsUnittest_Extensions_grouplike,
  301. EditionsUnittest_Extensions_messageimport
  302. ]
  303. // Extension Objects - The only reason these might be needed is when manually
  304. // constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_
  305. // accessors for the extension fields on the messages directly.
  306. /// Non-delimited field that otherwise looks group-like.
  307. let EditionsUnittest_Extensions_lengthprefixed = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalMessageExtensionField<EditionsUnittest_LengthPrefixed>, EditionsUnittest_TestDelimited>(
  308. _protobuf_fieldNumber: 1004,
  309. fieldName: "editions_unittest.lengthprefixed"
  310. )
  311. /// Truly group-like extension.
  312. let EditionsUnittest_Extensions_GroupLikeFileScope = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalGroupExtensionField<EditionsUnittest_GroupLikeFileScope>, EditionsUnittest_TestDelimited>(
  313. _protobuf_fieldNumber: 1000,
  314. fieldName: "editions_unittest.grouplikefilescope"
  315. )
  316. /// Delimited extension that isn't group-like because of its name.
  317. let EditionsUnittest_Extensions_not_group_like_scope = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalGroupExtensionField<EditionsUnittest_NotGroupLikeScope>, EditionsUnittest_TestDelimited>(
  318. _protobuf_fieldNumber: 1001,
  319. fieldName: "editions_unittest.not_group_like_scope"
  320. )
  321. /// Delimited extension that isn't group-like because of the scope of its type.
  322. let EditionsUnittest_Extensions_grouplike = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalGroupExtensionField<EditionsUnittest_TestDelimited.GroupLike>, EditionsUnittest_TestDelimited>(
  323. _protobuf_fieldNumber: 1002,
  324. fieldName: "editions_unittest.grouplike"
  325. )
  326. /// Delimited extension that's grouplike except that it's an imported type.
  327. let EditionsUnittest_Extensions_messageimport = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalGroupExtensionField<EditionsUnittest_MessageImport>, EditionsUnittest_TestDelimited>(
  328. _protobuf_fieldNumber: 1003,
  329. fieldName: "editions_unittest.messageimport"
  330. )
  331. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  332. fileprivate let _protobuf_package = "editions_unittest"
  333. extension EditionsUnittest_LengthPrefixed: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  334. static let protoMessageName: String = _protobuf_package + ".LengthPrefixed"
  335. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  336. 1: .same(proto: "a"),
  337. 2: .same(proto: "b"),
  338. ]
  339. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  340. while let fieldNumber = try decoder.nextFieldNumber() {
  341. // The use of inline closures is to circumvent an issue where the compiler
  342. // allocates stack space for every case branch when no optimizations are
  343. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  344. switch fieldNumber {
  345. case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }()
  346. case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
  347. default: break
  348. }
  349. }
  350. }
  351. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  352. // The use of inline closures is to circumvent an issue where the compiler
  353. // allocates stack space for every if/case branch local when no optimizations
  354. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  355. // https://github.com/apple/swift-protobuf/issues/1182
  356. try { if let v = self._a {
  357. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  358. } }()
  359. try { if let v = self._b {
  360. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  361. } }()
  362. try unknownFields.traverse(visitor: &visitor)
  363. }
  364. static func ==(lhs: EditionsUnittest_LengthPrefixed, rhs: EditionsUnittest_LengthPrefixed) -> Bool {
  365. if lhs._a != rhs._a {return false}
  366. if lhs._b != rhs._b {return false}
  367. if lhs.unknownFields != rhs.unknownFields {return false}
  368. return true
  369. }
  370. }
  371. extension EditionsUnittest_NotGroupLikeScope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  372. static let protoMessageName: String = _protobuf_package + ".NotGroupLikeScope"
  373. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  374. 1: .same(proto: "a"),
  375. 2: .same(proto: "b"),
  376. ]
  377. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  378. while let fieldNumber = try decoder.nextFieldNumber() {
  379. // The use of inline closures is to circumvent an issue where the compiler
  380. // allocates stack space for every case branch when no optimizations are
  381. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  382. switch fieldNumber {
  383. case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }()
  384. case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
  385. default: break
  386. }
  387. }
  388. }
  389. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  390. // The use of inline closures is to circumvent an issue where the compiler
  391. // allocates stack space for every if/case branch local when no optimizations
  392. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  393. // https://github.com/apple/swift-protobuf/issues/1182
  394. try { if let v = self._a {
  395. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  396. } }()
  397. try { if let v = self._b {
  398. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  399. } }()
  400. try unknownFields.traverse(visitor: &visitor)
  401. }
  402. static func ==(lhs: EditionsUnittest_NotGroupLikeScope, rhs: EditionsUnittest_NotGroupLikeScope) -> Bool {
  403. if lhs._a != rhs._a {return false}
  404. if lhs._b != rhs._b {return false}
  405. if lhs.unknownFields != rhs.unknownFields {return false}
  406. return true
  407. }
  408. }
  409. extension EditionsUnittest_GroupLikeFileScope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  410. static let protoMessageName: String = _protobuf_package + ".GroupLikeFileScope"
  411. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  412. 1: .same(proto: "a"),
  413. 2: .same(proto: "b"),
  414. ]
  415. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  416. while let fieldNumber = try decoder.nextFieldNumber() {
  417. // The use of inline closures is to circumvent an issue where the compiler
  418. // allocates stack space for every case branch when no optimizations are
  419. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  420. switch fieldNumber {
  421. case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }()
  422. case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
  423. default: break
  424. }
  425. }
  426. }
  427. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  428. // The use of inline closures is to circumvent an issue where the compiler
  429. // allocates stack space for every if/case branch local when no optimizations
  430. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  431. // https://github.com/apple/swift-protobuf/issues/1182
  432. try { if let v = self._a {
  433. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  434. } }()
  435. try { if let v = self._b {
  436. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  437. } }()
  438. try unknownFields.traverse(visitor: &visitor)
  439. }
  440. static func ==(lhs: EditionsUnittest_GroupLikeFileScope, rhs: EditionsUnittest_GroupLikeFileScope) -> Bool {
  441. if lhs._a != rhs._a {return false}
  442. if lhs._b != rhs._b {return false}
  443. if lhs.unknownFields != rhs.unknownFields {return false}
  444. return true
  445. }
  446. }
  447. extension EditionsUnittest_TestDelimited: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  448. static let protoMessageName: String = _protobuf_package + ".TestDelimited"
  449. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  450. 1: .same(proto: "lengthprefixed"),
  451. 2: .same(proto: "nested"),
  452. 3: .same(proto: "grouplike"),
  453. 3: .unique(proto: "GroupLike", json: "grouplike"),
  454. 4: .same(proto: "notgrouplike"),
  455. 5: .same(proto: "notgrouplikescope"),
  456. 6: .same(proto: "messageimport"),
  457. ]
  458. fileprivate class _StorageClass {
  459. var _lengthprefixed: EditionsUnittest_TestDelimited.LengthPrefixed? = nil
  460. var _nested: EditionsUnittest_TestDelimited? = nil
  461. var _groupLike: EditionsUnittest_TestDelimited.GroupLike? = nil
  462. var _notgrouplike: EditionsUnittest_TestDelimited.GroupLike? = nil
  463. var _notgrouplikescope: EditionsUnittest_NotGroupLikeScope? = nil
  464. var _messageimport: EditionsUnittest_MessageImport? = nil
  465. // This property is used as the initial default value for new instances of the type.
  466. // The type itself is protecting the reference to its storage via CoW semantics.
  467. // This will force a copy to be made of this reference when the first mutation occurs;
  468. // hence, it is safe to mark this as `nonisolated(unsafe)`.
  469. static nonisolated(unsafe) let defaultInstance = _StorageClass()
  470. private init() {}
  471. init(copying source: _StorageClass) {
  472. _lengthprefixed = source._lengthprefixed
  473. _nested = source._nested
  474. _groupLike = source._groupLike
  475. _notgrouplike = source._notgrouplike
  476. _notgrouplikescope = source._notgrouplikescope
  477. _messageimport = source._messageimport
  478. }
  479. }
  480. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  481. if !isKnownUniquelyReferenced(&_storage) {
  482. _storage = _StorageClass(copying: _storage)
  483. }
  484. return _storage
  485. }
  486. public var isInitialized: Bool {
  487. if !_protobuf_extensionFieldValues.isInitialized {return false}
  488. return withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  489. if let v = _storage._nested, !v.isInitialized {return false}
  490. return true
  491. }
  492. }
  493. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  494. _ = _uniqueStorage()
  495. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  496. while let fieldNumber = try decoder.nextFieldNumber() {
  497. // The use of inline closures is to circumvent an issue where the compiler
  498. // allocates stack space for every case branch when no optimizations are
  499. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  500. switch fieldNumber {
  501. case 1: try { try decoder.decodeSingularMessageField(value: &_storage._lengthprefixed) }()
  502. case 2: try { try decoder.decodeSingularGroupField(value: &_storage._nested) }()
  503. case 3: try { try decoder.decodeSingularGroupField(value: &_storage._groupLike) }()
  504. case 4: try { try decoder.decodeSingularGroupField(value: &_storage._notgrouplike) }()
  505. case 5: try { try decoder.decodeSingularGroupField(value: &_storage._notgrouplikescope) }()
  506. case 6: try { try decoder.decodeSingularGroupField(value: &_storage._messageimport) }()
  507. case 1000..<536870912:
  508. try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: EditionsUnittest_TestDelimited.self, fieldNumber: fieldNumber) }()
  509. default: break
  510. }
  511. }
  512. }
  513. }
  514. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  515. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  516. // The use of inline closures is to circumvent an issue where the compiler
  517. // allocates stack space for every if/case branch local when no optimizations
  518. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  519. // https://github.com/apple/swift-protobuf/issues/1182
  520. try { if let v = _storage._lengthprefixed {
  521. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  522. } }()
  523. try { if let v = _storage._nested {
  524. try visitor.visitSingularGroupField(value: v, fieldNumber: 2)
  525. } }()
  526. try { if let v = _storage._groupLike {
  527. try visitor.visitSingularGroupField(value: v, fieldNumber: 3)
  528. } }()
  529. try { if let v = _storage._notgrouplike {
  530. try visitor.visitSingularGroupField(value: v, fieldNumber: 4)
  531. } }()
  532. try { if let v = _storage._notgrouplikescope {
  533. try visitor.visitSingularGroupField(value: v, fieldNumber: 5)
  534. } }()
  535. try { if let v = _storage._messageimport {
  536. try visitor.visitSingularGroupField(value: v, fieldNumber: 6)
  537. } }()
  538. try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912)
  539. }
  540. try unknownFields.traverse(visitor: &visitor)
  541. }
  542. static func ==(lhs: EditionsUnittest_TestDelimited, rhs: EditionsUnittest_TestDelimited) -> Bool {
  543. if lhs._storage !== rhs._storage {
  544. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  545. let _storage = _args.0
  546. let rhs_storage = _args.1
  547. if _storage._lengthprefixed != rhs_storage._lengthprefixed {return false}
  548. if _storage._nested != rhs_storage._nested {return false}
  549. if _storage._groupLike != rhs_storage._groupLike {return false}
  550. if _storage._notgrouplike != rhs_storage._notgrouplike {return false}
  551. if _storage._notgrouplikescope != rhs_storage._notgrouplikescope {return false}
  552. if _storage._messageimport != rhs_storage._messageimport {return false}
  553. return true
  554. }
  555. if !storagesAreEqual {return false}
  556. }
  557. if lhs.unknownFields != rhs.unknownFields {return false}
  558. if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false}
  559. return true
  560. }
  561. }
  562. extension EditionsUnittest_TestDelimited.LengthPrefixed: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  563. static let protoMessageName: String = EditionsUnittest_TestDelimited.protoMessageName + ".LengthPrefixed"
  564. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  565. 1: .same(proto: "a"),
  566. 2: .same(proto: "b"),
  567. ]
  568. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  569. while let fieldNumber = try decoder.nextFieldNumber() {
  570. // The use of inline closures is to circumvent an issue where the compiler
  571. // allocates stack space for every case branch when no optimizations are
  572. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  573. switch fieldNumber {
  574. case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }()
  575. case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
  576. default: break
  577. }
  578. }
  579. }
  580. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  581. // The use of inline closures is to circumvent an issue where the compiler
  582. // allocates stack space for every if/case branch local when no optimizations
  583. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  584. // https://github.com/apple/swift-protobuf/issues/1182
  585. try { if let v = self._a {
  586. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  587. } }()
  588. try { if let v = self._b {
  589. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  590. } }()
  591. try unknownFields.traverse(visitor: &visitor)
  592. }
  593. static func ==(lhs: EditionsUnittest_TestDelimited.LengthPrefixed, rhs: EditionsUnittest_TestDelimited.LengthPrefixed) -> Bool {
  594. if lhs._a != rhs._a {return false}
  595. if lhs._b != rhs._b {return false}
  596. if lhs.unknownFields != rhs.unknownFields {return false}
  597. return true
  598. }
  599. }
  600. extension EditionsUnittest_TestDelimited.GroupLike: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  601. static let protoMessageName: String = EditionsUnittest_TestDelimited.protoMessageName + ".GroupLike"
  602. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  603. 1: .same(proto: "a"),
  604. 2: .same(proto: "b"),
  605. ]
  606. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  607. while let fieldNumber = try decoder.nextFieldNumber() {
  608. // The use of inline closures is to circumvent an issue where the compiler
  609. // allocates stack space for every case branch when no optimizations are
  610. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  611. switch fieldNumber {
  612. case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }()
  613. case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
  614. default: break
  615. }
  616. }
  617. }
  618. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  619. // The use of inline closures is to circumvent an issue where the compiler
  620. // allocates stack space for every if/case branch local when no optimizations
  621. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  622. // https://github.com/apple/swift-protobuf/issues/1182
  623. try { if let v = self._a {
  624. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  625. } }()
  626. try { if let v = self._b {
  627. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  628. } }()
  629. try unknownFields.traverse(visitor: &visitor)
  630. }
  631. static func ==(lhs: EditionsUnittest_TestDelimited.GroupLike, rhs: EditionsUnittest_TestDelimited.GroupLike) -> Bool {
  632. if lhs._a != rhs._a {return false}
  633. if lhs._b != rhs._b {return false}
  634. if lhs.unknownFields != rhs.unknownFields {return false}
  635. return true
  636. }
  637. }