unittest_delimited.pb.swift 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  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 {_a ?? 0}
  26. set {_a = newValue}
  27. }
  28. /// Returns true if `a` has been explicitly set.
  29. var hasA: Bool {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 {_b ?? 0}
  34. set {_b = newValue}
  35. }
  36. /// Returns true if `b` has been explicitly set.
  37. var hasB: Bool {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 {_a ?? 0}
  51. set {_a = newValue}
  52. }
  53. /// Returns true if `a` has been explicitly set.
  54. var hasA: Bool {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 {_b ?? 0}
  59. set {_b = newValue}
  60. }
  61. /// Returns true if `b` has been explicitly set.
  62. var hasB: Bool {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 {_a ?? 0}
  76. set {_a = newValue}
  77. }
  78. /// Returns true if `a` has been explicitly set.
  79. var hasA: Bool {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 {_b ?? 0}
  84. set {_b = newValue}
  85. }
  86. /// Returns true if `b` has been explicitly set.
  87. var hasB: Bool {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 {_storage._lengthprefixed ?? EditionsUnittest_TestDelimited.LengthPrefixed()}
  102. set {_uniqueStorage()._lengthprefixed = newValue}
  103. }
  104. /// Returns true if `lengthprefixed` has been explicitly set.
  105. var hasLengthprefixed: Bool {_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 {_storage._nested ?? EditionsUnittest_TestDelimited()}
  111. set {_uniqueStorage()._nested = newValue}
  112. }
  113. /// Returns true if `nested` has been explicitly set.
  114. var hasNested: Bool {_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 {_storage._groupLike ?? EditionsUnittest_TestDelimited.GroupLike()}
  120. set {_uniqueStorage()._groupLike = newValue}
  121. }
  122. /// Returns true if `groupLike` has been explicitly set.
  123. var hasGroupLike: Bool {_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 {_storage._notgrouplike ?? EditionsUnittest_TestDelimited.GroupLike()}
  129. set {_uniqueStorage()._notgrouplike = newValue}
  130. }
  131. /// Returns true if `notgrouplike` has been explicitly set.
  132. var hasNotgrouplike: Bool {_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 {_storage._notgrouplikescope ?? EditionsUnittest_NotGroupLikeScope()}
  138. set {_uniqueStorage()._notgrouplikescope = newValue}
  139. }
  140. /// Returns true if `notgrouplikescope` has been explicitly set.
  141. var hasNotgrouplikescope: Bool {_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 {_storage._messageimport ?? EditionsUnittest_MessageImport()}
  147. set {_uniqueStorage()._messageimport = newValue}
  148. }
  149. /// Returns true if `messageimport` has been explicitly set.
  150. var hasMessageimport: Bool {_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 {_a ?? 0}
  160. set {_a = newValue}
  161. }
  162. /// Returns true if `a` has been explicitly set.
  163. var hasA: Bool {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 {_b ?? 0}
  168. set {_b = newValue}
  169. }
  170. /// Returns true if `b` has been explicitly set.
  171. var hasB: Bool {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 {_a ?? 0}
  185. set {_a = newValue}
  186. }
  187. /// Returns true if `a` has been explicitly set.
  188. var hasA: Bool {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 {_b ?? 0}
  193. set {_b = newValue}
  194. }
  195. /// Returns true if `b` has been explicitly set.
  196. var hasB: Bool {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(bytecode: "\0\u{1}a\0\u{1}b\0")
  336. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  337. while let fieldNumber = try decoder.nextFieldNumber() {
  338. // The use of inline closures is to circumvent an issue where the compiler
  339. // allocates stack space for every case branch when no optimizations are
  340. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  341. switch fieldNumber {
  342. case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }()
  343. case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
  344. default: break
  345. }
  346. }
  347. }
  348. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  349. // The use of inline closures is to circumvent an issue where the compiler
  350. // allocates stack space for every if/case branch local when no optimizations
  351. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  352. // https://github.com/apple/swift-protobuf/issues/1182
  353. try { if let v = self._a {
  354. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  355. } }()
  356. try { if let v = self._b {
  357. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  358. } }()
  359. try unknownFields.traverse(visitor: &visitor)
  360. }
  361. static func ==(lhs: EditionsUnittest_LengthPrefixed, rhs: EditionsUnittest_LengthPrefixed) -> Bool {
  362. if lhs._a != rhs._a {return false}
  363. if lhs._b != rhs._b {return false}
  364. if lhs.unknownFields != rhs.unknownFields {return false}
  365. return true
  366. }
  367. }
  368. extension EditionsUnittest_NotGroupLikeScope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  369. static let protoMessageName: String = _protobuf_package + ".NotGroupLikeScope"
  370. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}a\0\u{1}b\0")
  371. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  372. while let fieldNumber = try decoder.nextFieldNumber() {
  373. // The use of inline closures is to circumvent an issue where the compiler
  374. // allocates stack space for every case branch when no optimizations are
  375. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  376. switch fieldNumber {
  377. case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }()
  378. case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
  379. default: break
  380. }
  381. }
  382. }
  383. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  384. // The use of inline closures is to circumvent an issue where the compiler
  385. // allocates stack space for every if/case branch local when no optimizations
  386. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  387. // https://github.com/apple/swift-protobuf/issues/1182
  388. try { if let v = self._a {
  389. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  390. } }()
  391. try { if let v = self._b {
  392. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  393. } }()
  394. try unknownFields.traverse(visitor: &visitor)
  395. }
  396. static func ==(lhs: EditionsUnittest_NotGroupLikeScope, rhs: EditionsUnittest_NotGroupLikeScope) -> Bool {
  397. if lhs._a != rhs._a {return false}
  398. if lhs._b != rhs._b {return false}
  399. if lhs.unknownFields != rhs.unknownFields {return false}
  400. return true
  401. }
  402. }
  403. extension EditionsUnittest_GroupLikeFileScope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  404. static let protoMessageName: String = _protobuf_package + ".GroupLikeFileScope"
  405. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}a\0\u{1}b\0")
  406. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  407. while let fieldNumber = try decoder.nextFieldNumber() {
  408. // The use of inline closures is to circumvent an issue where the compiler
  409. // allocates stack space for every case branch when no optimizations are
  410. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  411. switch fieldNumber {
  412. case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }()
  413. case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
  414. default: break
  415. }
  416. }
  417. }
  418. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  419. // The use of inline closures is to circumvent an issue where the compiler
  420. // allocates stack space for every if/case branch local when no optimizations
  421. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  422. // https://github.com/apple/swift-protobuf/issues/1182
  423. try { if let v = self._a {
  424. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  425. } }()
  426. try { if let v = self._b {
  427. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  428. } }()
  429. try unknownFields.traverse(visitor: &visitor)
  430. }
  431. static func ==(lhs: EditionsUnittest_GroupLikeFileScope, rhs: EditionsUnittest_GroupLikeFileScope) -> Bool {
  432. if lhs._a != rhs._a {return false}
  433. if lhs._b != rhs._b {return false}
  434. if lhs.unknownFields != rhs.unknownFields {return false}
  435. return true
  436. }
  437. }
  438. extension EditionsUnittest_TestDelimited: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  439. static let protoMessageName: String = _protobuf_package + ".TestDelimited"
  440. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}lengthprefixed\0\u{1}nested\0\u{7}GroupLike\0\u{1}notgrouplike\0\u{1}notgrouplikescope\0\u{1}messageimport\0")
  441. fileprivate class _StorageClass {
  442. var _lengthprefixed: EditionsUnittest_TestDelimited.LengthPrefixed? = nil
  443. var _nested: EditionsUnittest_TestDelimited? = nil
  444. var _groupLike: EditionsUnittest_TestDelimited.GroupLike? = nil
  445. var _notgrouplike: EditionsUnittest_TestDelimited.GroupLike? = nil
  446. var _notgrouplikescope: EditionsUnittest_NotGroupLikeScope? = nil
  447. var _messageimport: EditionsUnittest_MessageImport? = nil
  448. // This property is used as the initial default value for new instances of the type.
  449. // The type itself is protecting the reference to its storage via CoW semantics.
  450. // This will force a copy to be made of this reference when the first mutation occurs;
  451. // hence, it is safe to mark this as `nonisolated(unsafe)`.
  452. static nonisolated(unsafe) let defaultInstance = _StorageClass()
  453. private init() {}
  454. init(copying source: _StorageClass) {
  455. _lengthprefixed = source._lengthprefixed
  456. _nested = source._nested
  457. _groupLike = source._groupLike
  458. _notgrouplike = source._notgrouplike
  459. _notgrouplikescope = source._notgrouplikescope
  460. _messageimport = source._messageimport
  461. }
  462. }
  463. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  464. if !isKnownUniquelyReferenced(&_storage) {
  465. _storage = _StorageClass(copying: _storage)
  466. }
  467. return _storage
  468. }
  469. public var isInitialized: Bool {
  470. if !_protobuf_extensionFieldValues.isInitialized {return false}
  471. return withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  472. if let v = _storage._nested, !v.isInitialized {return false}
  473. return true
  474. }
  475. }
  476. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  477. _ = _uniqueStorage()
  478. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  479. while let fieldNumber = try decoder.nextFieldNumber() {
  480. // The use of inline closures is to circumvent an issue where the compiler
  481. // allocates stack space for every case branch when no optimizations are
  482. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  483. switch fieldNumber {
  484. case 1: try { try decoder.decodeSingularMessageField(value: &_storage._lengthprefixed) }()
  485. case 2: try { try decoder.decodeSingularGroupField(value: &_storage._nested) }()
  486. case 3: try { try decoder.decodeSingularGroupField(value: &_storage._groupLike) }()
  487. case 4: try { try decoder.decodeSingularGroupField(value: &_storage._notgrouplike) }()
  488. case 5: try { try decoder.decodeSingularGroupField(value: &_storage._notgrouplikescope) }()
  489. case 6: try { try decoder.decodeSingularGroupField(value: &_storage._messageimport) }()
  490. case 1000..<536870912:
  491. try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: EditionsUnittest_TestDelimited.self, fieldNumber: fieldNumber) }()
  492. default: break
  493. }
  494. }
  495. }
  496. }
  497. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  498. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  499. // The use of inline closures is to circumvent an issue where the compiler
  500. // allocates stack space for every if/case branch local when no optimizations
  501. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  502. // https://github.com/apple/swift-protobuf/issues/1182
  503. try { if let v = _storage._lengthprefixed {
  504. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  505. } }()
  506. try { if let v = _storage._nested {
  507. try visitor.visitSingularGroupField(value: v, fieldNumber: 2)
  508. } }()
  509. try { if let v = _storage._groupLike {
  510. try visitor.visitSingularGroupField(value: v, fieldNumber: 3)
  511. } }()
  512. try { if let v = _storage._notgrouplike {
  513. try visitor.visitSingularGroupField(value: v, fieldNumber: 4)
  514. } }()
  515. try { if let v = _storage._notgrouplikescope {
  516. try visitor.visitSingularGroupField(value: v, fieldNumber: 5)
  517. } }()
  518. try { if let v = _storage._messageimport {
  519. try visitor.visitSingularGroupField(value: v, fieldNumber: 6)
  520. } }()
  521. try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912)
  522. }
  523. try unknownFields.traverse(visitor: &visitor)
  524. }
  525. static func ==(lhs: EditionsUnittest_TestDelimited, rhs: EditionsUnittest_TestDelimited) -> Bool {
  526. if lhs._storage !== rhs._storage {
  527. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  528. let _storage = _args.0
  529. let rhs_storage = _args.1
  530. if _storage._lengthprefixed != rhs_storage._lengthprefixed {return false}
  531. if _storage._nested != rhs_storage._nested {return false}
  532. if _storage._groupLike != rhs_storage._groupLike {return false}
  533. if _storage._notgrouplike != rhs_storage._notgrouplike {return false}
  534. if _storage._notgrouplikescope != rhs_storage._notgrouplikescope {return false}
  535. if _storage._messageimport != rhs_storage._messageimport {return false}
  536. return true
  537. }
  538. if !storagesAreEqual {return false}
  539. }
  540. if lhs.unknownFields != rhs.unknownFields {return false}
  541. if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false}
  542. return true
  543. }
  544. }
  545. extension EditionsUnittest_TestDelimited.LengthPrefixed: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  546. static let protoMessageName: String = EditionsUnittest_TestDelimited.protoMessageName + ".LengthPrefixed"
  547. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}a\0\u{1}b\0")
  548. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  549. while let fieldNumber = try decoder.nextFieldNumber() {
  550. // The use of inline closures is to circumvent an issue where the compiler
  551. // allocates stack space for every case branch when no optimizations are
  552. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  553. switch fieldNumber {
  554. case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }()
  555. case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
  556. default: break
  557. }
  558. }
  559. }
  560. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  561. // The use of inline closures is to circumvent an issue where the compiler
  562. // allocates stack space for every if/case branch local when no optimizations
  563. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  564. // https://github.com/apple/swift-protobuf/issues/1182
  565. try { if let v = self._a {
  566. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  567. } }()
  568. try { if let v = self._b {
  569. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  570. } }()
  571. try unknownFields.traverse(visitor: &visitor)
  572. }
  573. static func ==(lhs: EditionsUnittest_TestDelimited.LengthPrefixed, rhs: EditionsUnittest_TestDelimited.LengthPrefixed) -> Bool {
  574. if lhs._a != rhs._a {return false}
  575. if lhs._b != rhs._b {return false}
  576. if lhs.unknownFields != rhs.unknownFields {return false}
  577. return true
  578. }
  579. }
  580. extension EditionsUnittest_TestDelimited.GroupLike: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  581. static let protoMessageName: String = EditionsUnittest_TestDelimited.protoMessageName + ".GroupLike"
  582. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}a\0\u{1}b\0")
  583. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  584. while let fieldNumber = try decoder.nextFieldNumber() {
  585. // The use of inline closures is to circumvent an issue where the compiler
  586. // allocates stack space for every case branch when no optimizations are
  587. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  588. switch fieldNumber {
  589. case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }()
  590. case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
  591. default: break
  592. }
  593. }
  594. }
  595. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  596. // The use of inline closures is to circumvent an issue where the compiler
  597. // allocates stack space for every if/case branch local when no optimizations
  598. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  599. // https://github.com/apple/swift-protobuf/issues/1182
  600. try { if let v = self._a {
  601. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  602. } }()
  603. try { if let v = self._b {
  604. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  605. } }()
  606. try unknownFields.traverse(visitor: &visitor)
  607. }
  608. static func ==(lhs: EditionsUnittest_TestDelimited.GroupLike, rhs: EditionsUnittest_TestDelimited.GroupLike) -> Bool {
  609. if lhs._a != rhs._a {return false}
  610. if lhs._b != rhs._b {return false}
  611. if lhs.unknownFields != rhs.unknownFields {return false}
  612. return true
  613. }
  614. }