map_lite_unittest.pb.swift 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027
  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/map_lite_unittest.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. // Protocol Buffers - Google's data interchange format
  11. // Copyright 2008 Google Inc. All rights reserved.
  12. //
  13. // Use of this source code is governed by a BSD-style
  14. // license that can be found in the LICENSE file or at
  15. // https://developers.google.com/open-source/licenses/bsd
  16. import Foundation
  17. import SwiftProtobuf
  18. // If the compiler emits an error on this type, it is because this file
  19. // was generated by a version of the `protoc` Swift plug-in that is
  20. // incompatible with the version of SwiftProtobuf to which you are linking.
  21. // Please ensure that you are building against the same version of the API
  22. // that was used to generate this file.
  23. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  24. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  25. typealias Version = _2
  26. }
  27. enum Proto2Unittest_Proto2MapEnumLite: Int, SwiftProtobuf.Enum, Swift.CaseIterable {
  28. case proto2MapEnumFooLite = 0
  29. case proto2MapEnumBarLite = 1
  30. case proto2MapEnumBazLite = 2
  31. init() {
  32. self = .proto2MapEnumFooLite
  33. }
  34. }
  35. enum Proto2Unittest_Proto2MapEnumPlusExtraLite: Int, SwiftProtobuf.Enum, Swift.CaseIterable {
  36. case eProto2MapEnumFooLite = 0
  37. case eProto2MapEnumBarLite = 1
  38. case eProto2MapEnumBazLite = 2
  39. case eProto2MapEnumExtraLite = 3
  40. init() {
  41. self = .eProto2MapEnumFooLite
  42. }
  43. }
  44. enum Proto2Unittest_MapEnumLite: Int, SwiftProtobuf.Enum, Swift.CaseIterable {
  45. case mapEnumFooLite = 0
  46. case mapEnumBarLite = 1
  47. case mapEnumBazLite = 2
  48. init() {
  49. self = .mapEnumFooLite
  50. }
  51. }
  52. struct Proto2Unittest_TestMapLite: @unchecked Sendable {
  53. // SwiftProtobuf.Message conformance is added in an extension below. See the
  54. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  55. // methods supported on all messages.
  56. var mapInt32Int32: Dictionary<Int32,Int32> {
  57. get {_storage._mapInt32Int32}
  58. set {_uniqueStorage()._mapInt32Int32 = newValue}
  59. }
  60. var mapInt64Int64: Dictionary<Int64,Int64> {
  61. get {_storage._mapInt64Int64}
  62. set {_uniqueStorage()._mapInt64Int64 = newValue}
  63. }
  64. var mapUint32Uint32: Dictionary<UInt32,UInt32> {
  65. get {_storage._mapUint32Uint32}
  66. set {_uniqueStorage()._mapUint32Uint32 = newValue}
  67. }
  68. var mapUint64Uint64: Dictionary<UInt64,UInt64> {
  69. get {_storage._mapUint64Uint64}
  70. set {_uniqueStorage()._mapUint64Uint64 = newValue}
  71. }
  72. var mapSint32Sint32: Dictionary<Int32,Int32> {
  73. get {_storage._mapSint32Sint32}
  74. set {_uniqueStorage()._mapSint32Sint32 = newValue}
  75. }
  76. var mapSint64Sint64: Dictionary<Int64,Int64> {
  77. get {_storage._mapSint64Sint64}
  78. set {_uniqueStorage()._mapSint64Sint64 = newValue}
  79. }
  80. var mapFixed32Fixed32: Dictionary<UInt32,UInt32> {
  81. get {_storage._mapFixed32Fixed32}
  82. set {_uniqueStorage()._mapFixed32Fixed32 = newValue}
  83. }
  84. var mapFixed64Fixed64: Dictionary<UInt64,UInt64> {
  85. get {_storage._mapFixed64Fixed64}
  86. set {_uniqueStorage()._mapFixed64Fixed64 = newValue}
  87. }
  88. var mapSfixed32Sfixed32: Dictionary<Int32,Int32> {
  89. get {_storage._mapSfixed32Sfixed32}
  90. set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue}
  91. }
  92. var mapSfixed64Sfixed64: Dictionary<Int64,Int64> {
  93. get {_storage._mapSfixed64Sfixed64}
  94. set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue}
  95. }
  96. var mapInt32Float: Dictionary<Int32,Float> {
  97. get {_storage._mapInt32Float}
  98. set {_uniqueStorage()._mapInt32Float = newValue}
  99. }
  100. var mapInt32Double: Dictionary<Int32,Double> {
  101. get {_storage._mapInt32Double}
  102. set {_uniqueStorage()._mapInt32Double = newValue}
  103. }
  104. var mapBoolBool: Dictionary<Bool,Bool> {
  105. get {_storage._mapBoolBool}
  106. set {_uniqueStorage()._mapBoolBool = newValue}
  107. }
  108. var mapStringString: Dictionary<String,String> {
  109. get {_storage._mapStringString}
  110. set {_uniqueStorage()._mapStringString = newValue}
  111. }
  112. var mapInt32Bytes: Dictionary<Int32,Data> {
  113. get {_storage._mapInt32Bytes}
  114. set {_uniqueStorage()._mapInt32Bytes = newValue}
  115. }
  116. var mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnumLite> {
  117. get {_storage._mapInt32Enum}
  118. set {_uniqueStorage()._mapInt32Enum = newValue}
  119. }
  120. var mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessageLite> {
  121. get {_storage._mapInt32ForeignMessage}
  122. set {_uniqueStorage()._mapInt32ForeignMessage = newValue}
  123. }
  124. var teboring: Dictionary<Int32,Int32> {
  125. get {_storage._teboring}
  126. set {_uniqueStorage()._teboring = newValue}
  127. }
  128. var unknownFields = SwiftProtobuf.UnknownStorage()
  129. init() {}
  130. fileprivate var _storage = _StorageClass.defaultInstance
  131. }
  132. struct Proto2Unittest_TestArenaMapLite: @unchecked Sendable {
  133. // SwiftProtobuf.Message conformance is added in an extension below. See the
  134. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  135. // methods supported on all messages.
  136. var mapInt32Int32: Dictionary<Int32,Int32> {
  137. get {_storage._mapInt32Int32}
  138. set {_uniqueStorage()._mapInt32Int32 = newValue}
  139. }
  140. var mapInt64Int64: Dictionary<Int64,Int64> {
  141. get {_storage._mapInt64Int64}
  142. set {_uniqueStorage()._mapInt64Int64 = newValue}
  143. }
  144. var mapUint32Uint32: Dictionary<UInt32,UInt32> {
  145. get {_storage._mapUint32Uint32}
  146. set {_uniqueStorage()._mapUint32Uint32 = newValue}
  147. }
  148. var mapUint64Uint64: Dictionary<UInt64,UInt64> {
  149. get {_storage._mapUint64Uint64}
  150. set {_uniqueStorage()._mapUint64Uint64 = newValue}
  151. }
  152. var mapSint32Sint32: Dictionary<Int32,Int32> {
  153. get {_storage._mapSint32Sint32}
  154. set {_uniqueStorage()._mapSint32Sint32 = newValue}
  155. }
  156. var mapSint64Sint64: Dictionary<Int64,Int64> {
  157. get {_storage._mapSint64Sint64}
  158. set {_uniqueStorage()._mapSint64Sint64 = newValue}
  159. }
  160. var mapFixed32Fixed32: Dictionary<UInt32,UInt32> {
  161. get {_storage._mapFixed32Fixed32}
  162. set {_uniqueStorage()._mapFixed32Fixed32 = newValue}
  163. }
  164. var mapFixed64Fixed64: Dictionary<UInt64,UInt64> {
  165. get {_storage._mapFixed64Fixed64}
  166. set {_uniqueStorage()._mapFixed64Fixed64 = newValue}
  167. }
  168. var mapSfixed32Sfixed32: Dictionary<Int32,Int32> {
  169. get {_storage._mapSfixed32Sfixed32}
  170. set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue}
  171. }
  172. var mapSfixed64Sfixed64: Dictionary<Int64,Int64> {
  173. get {_storage._mapSfixed64Sfixed64}
  174. set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue}
  175. }
  176. var mapInt32Float: Dictionary<Int32,Float> {
  177. get {_storage._mapInt32Float}
  178. set {_uniqueStorage()._mapInt32Float = newValue}
  179. }
  180. var mapInt32Double: Dictionary<Int32,Double> {
  181. get {_storage._mapInt32Double}
  182. set {_uniqueStorage()._mapInt32Double = newValue}
  183. }
  184. var mapBoolBool: Dictionary<Bool,Bool> {
  185. get {_storage._mapBoolBool}
  186. set {_uniqueStorage()._mapBoolBool = newValue}
  187. }
  188. var mapStringString: Dictionary<String,String> {
  189. get {_storage._mapStringString}
  190. set {_uniqueStorage()._mapStringString = newValue}
  191. }
  192. var mapInt32Bytes: Dictionary<Int32,Data> {
  193. get {_storage._mapInt32Bytes}
  194. set {_uniqueStorage()._mapInt32Bytes = newValue}
  195. }
  196. var mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnumLite> {
  197. get {_storage._mapInt32Enum}
  198. set {_uniqueStorage()._mapInt32Enum = newValue}
  199. }
  200. var mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessageArenaLite> {
  201. get {_storage._mapInt32ForeignMessage}
  202. set {_uniqueStorage()._mapInt32ForeignMessage = newValue}
  203. }
  204. var unknownFields = SwiftProtobuf.UnknownStorage()
  205. init() {}
  206. fileprivate var _storage = _StorageClass.defaultInstance
  207. }
  208. /// Test embedded message with required fields
  209. struct Proto2Unittest_TestRequiredMessageMapLite: Sendable {
  210. // SwiftProtobuf.Message conformance is added in an extension below. See the
  211. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  212. // methods supported on all messages.
  213. var mapField: Dictionary<Int32,Proto2Unittest_TestRequiredLite> = [:]
  214. var unknownFields = SwiftProtobuf.UnknownStorage()
  215. init() {}
  216. }
  217. struct Proto2Unittest_TestEnumMapLite: Sendable {
  218. // SwiftProtobuf.Message conformance is added in an extension below. See the
  219. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  220. // methods supported on all messages.
  221. var knownMapField: Dictionary<Int32,Proto2Unittest_Proto2MapEnumLite> = [:]
  222. var unknownMapField: Dictionary<Int32,Proto2Unittest_Proto2MapEnumLite> = [:]
  223. var unknownFields = SwiftProtobuf.UnknownStorage()
  224. init() {}
  225. }
  226. struct Proto2Unittest_TestEnumMapPlusExtraLite: Sendable {
  227. // SwiftProtobuf.Message conformance is added in an extension below. See the
  228. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  229. // methods supported on all messages.
  230. var knownMapField: Dictionary<Int32,Proto2Unittest_Proto2MapEnumPlusExtraLite> = [:]
  231. var unknownMapField: Dictionary<Int32,Proto2Unittest_Proto2MapEnumPlusExtraLite> = [:]
  232. var unknownFields = SwiftProtobuf.UnknownStorage()
  233. init() {}
  234. }
  235. struct Proto2Unittest_TestMessageMapLite: Sendable {
  236. // SwiftProtobuf.Message conformance is added in an extension below. See the
  237. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  238. // methods supported on all messages.
  239. var mapInt32Message: Dictionary<Int32,Proto2Unittest_TestAllTypesLite> = [:]
  240. var unknownFields = SwiftProtobuf.UnknownStorage()
  241. init() {}
  242. }
  243. struct Proto2Unittest_TestRequiredLite: Sendable {
  244. // SwiftProtobuf.Message conformance is added in an extension below. See the
  245. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  246. // methods supported on all messages.
  247. var a: Int32 {
  248. get {_a ?? 0}
  249. set {_a = newValue}
  250. }
  251. /// Returns true if `a` has been explicitly set.
  252. var hasA: Bool {self._a != nil}
  253. /// Clears the value of `a`. Subsequent reads from it will return its default value.
  254. mutating func clearA() {self._a = nil}
  255. var b: Int32 {
  256. get {_b ?? 0}
  257. set {_b = newValue}
  258. }
  259. /// Returns true if `b` has been explicitly set.
  260. var hasB: Bool {self._b != nil}
  261. /// Clears the value of `b`. Subsequent reads from it will return its default value.
  262. mutating func clearB() {self._b = nil}
  263. var c: Int32 {
  264. get {_c ?? 0}
  265. set {_c = newValue}
  266. }
  267. /// Returns true if `c` has been explicitly set.
  268. var hasC: Bool {self._c != nil}
  269. /// Clears the value of `c`. Subsequent reads from it will return its default value.
  270. mutating func clearC() {self._c = nil}
  271. var unknownFields = SwiftProtobuf.UnknownStorage()
  272. init() {}
  273. fileprivate var _a: Int32? = nil
  274. fileprivate var _b: Int32? = nil
  275. fileprivate var _c: Int32? = nil
  276. }
  277. struct Proto2Unittest_ForeignMessageArenaLite: Sendable {
  278. // SwiftProtobuf.Message conformance is added in an extension below. See the
  279. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  280. // methods supported on all messages.
  281. var c: Int32 {
  282. get {_c ?? 0}
  283. set {_c = newValue}
  284. }
  285. /// Returns true if `c` has been explicitly set.
  286. var hasC: Bool {self._c != nil}
  287. /// Clears the value of `c`. Subsequent reads from it will return its default value.
  288. mutating func clearC() {self._c = nil}
  289. var unknownFields = SwiftProtobuf.UnknownStorage()
  290. init() {}
  291. fileprivate var _c: Int32? = nil
  292. }
  293. // MARK: - Extension support defined in map_lite_unittest.proto.
  294. // MARK: - Extension Properties
  295. // Swift Extensions on the extended Messages to add easy access to the declared
  296. // extension fields. The names are based on the extension field name from the proto
  297. // declaration. To avoid naming collisions, the names are prefixed with the name of
  298. // the scope where the extend directive occurs.
  299. extension Proto2Unittest_TestAllExtensionsLite {
  300. var Proto2Unittest_TestRequiredLite_single: Proto2Unittest_TestRequiredLite {
  301. get {return getExtensionValue(ext: Proto2Unittest_TestRequiredLite.Extensions.single) ?? Proto2Unittest_TestRequiredLite()}
  302. set {setExtensionValue(ext: Proto2Unittest_TestRequiredLite.Extensions.single, value: newValue)}
  303. }
  304. /// Returns true if extension `Proto2Unittest_TestRequiredLite.Extensions.single`
  305. /// has been explicitly set.
  306. var hasProto2Unittest_TestRequiredLite_single: Bool {
  307. return hasExtensionValue(ext: Proto2Unittest_TestRequiredLite.Extensions.single)
  308. }
  309. /// Clears the value of extension `Proto2Unittest_TestRequiredLite.Extensions.single`.
  310. /// Subsequent reads from it will return its default value.
  311. mutating func clearProto2Unittest_TestRequiredLite_single() {
  312. clearExtensionValue(ext: Proto2Unittest_TestRequiredLite.Extensions.single)
  313. }
  314. }
  315. // MARK: - File's ExtensionMap: Proto2Unittest_MapLiteUnittest_Extensions
  316. /// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by
  317. /// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed
  318. /// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create
  319. /// a larger `SwiftProtobuf.SimpleExtensionMap`.
  320. let Proto2Unittest_MapLiteUnittest_Extensions: SwiftProtobuf.SimpleExtensionMap = [
  321. Proto2Unittest_TestRequiredLite.Extensions.single
  322. ]
  323. // Extension Objects - The only reason these might be needed is when manually
  324. // constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_
  325. // accessors for the extension fields on the messages directly.
  326. extension Proto2Unittest_TestRequiredLite {
  327. enum Extensions {
  328. static let single = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalMessageExtensionField<Proto2Unittest_TestRequiredLite>, Proto2Unittest_TestAllExtensionsLite>(
  329. _protobuf_fieldNumber: 1000,
  330. fieldName: "proto2_unittest.TestRequiredLite.single"
  331. )
  332. }
  333. }
  334. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  335. fileprivate let _protobuf_package = "proto2_unittest"
  336. extension Proto2Unittest_Proto2MapEnumLite: SwiftProtobuf._ProtoNameProviding {
  337. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0PROTO2_MAP_ENUM_FOO_LITE\0\u{1}PROTO2_MAP_ENUM_BAR_LITE\0\u{1}PROTO2_MAP_ENUM_BAZ_LITE\0")
  338. }
  339. extension Proto2Unittest_Proto2MapEnumPlusExtraLite: SwiftProtobuf._ProtoNameProviding {
  340. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0E_PROTO2_MAP_ENUM_FOO_LITE\0\u{1}E_PROTO2_MAP_ENUM_BAR_LITE\0\u{1}E_PROTO2_MAP_ENUM_BAZ_LITE\0\u{1}E_PROTO2_MAP_ENUM_EXTRA_LITE\0")
  341. }
  342. extension Proto2Unittest_MapEnumLite: SwiftProtobuf._ProtoNameProviding {
  343. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0MAP_ENUM_FOO_LITE\0\u{1}MAP_ENUM_BAR_LITE\0\u{1}MAP_ENUM_BAZ_LITE\0")
  344. }
  345. extension Proto2Unittest_TestMapLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  346. static let protoMessageName: String = _protobuf_package + ".TestMapLite"
  347. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}map_int32_int32\0\u{3}map_int64_int64\0\u{3}map_uint32_uint32\0\u{3}map_uint64_uint64\0\u{3}map_sint32_sint32\0\u{3}map_sint64_sint64\0\u{3}map_fixed32_fixed32\0\u{3}map_fixed64_fixed64\0\u{3}map_sfixed32_sfixed32\0\u{3}map_sfixed64_sfixed64\0\u{3}map_int32_float\0\u{3}map_int32_double\0\u{3}map_bool_bool\0\u{3}map_string_string\0\u{3}map_int32_bytes\0\u{3}map_int32_enum\0\u{3}map_int32_foreign_message\0\u{1}teboring\0")
  348. fileprivate class _StorageClass {
  349. var _mapInt32Int32: Dictionary<Int32,Int32> = [:]
  350. var _mapInt64Int64: Dictionary<Int64,Int64> = [:]
  351. var _mapUint32Uint32: Dictionary<UInt32,UInt32> = [:]
  352. var _mapUint64Uint64: Dictionary<UInt64,UInt64> = [:]
  353. var _mapSint32Sint32: Dictionary<Int32,Int32> = [:]
  354. var _mapSint64Sint64: Dictionary<Int64,Int64> = [:]
  355. var _mapFixed32Fixed32: Dictionary<UInt32,UInt32> = [:]
  356. var _mapFixed64Fixed64: Dictionary<UInt64,UInt64> = [:]
  357. var _mapSfixed32Sfixed32: Dictionary<Int32,Int32> = [:]
  358. var _mapSfixed64Sfixed64: Dictionary<Int64,Int64> = [:]
  359. var _mapInt32Float: Dictionary<Int32,Float> = [:]
  360. var _mapInt32Double: Dictionary<Int32,Double> = [:]
  361. var _mapBoolBool: Dictionary<Bool,Bool> = [:]
  362. var _mapStringString: Dictionary<String,String> = [:]
  363. var _mapInt32Bytes: Dictionary<Int32,Data> = [:]
  364. var _mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnumLite> = [:]
  365. var _mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessageLite> = [:]
  366. var _teboring: Dictionary<Int32,Int32> = [:]
  367. // This property is used as the initial default value for new instances of the type.
  368. // The type itself is protecting the reference to its storage via CoW semantics.
  369. // This will force a copy to be made of this reference when the first mutation occurs;
  370. // hence, it is safe to mark this as `nonisolated(unsafe)`.
  371. static nonisolated(unsafe) let defaultInstance = _StorageClass()
  372. private init() {}
  373. init(copying source: _StorageClass) {
  374. _mapInt32Int32 = source._mapInt32Int32
  375. _mapInt64Int64 = source._mapInt64Int64
  376. _mapUint32Uint32 = source._mapUint32Uint32
  377. _mapUint64Uint64 = source._mapUint64Uint64
  378. _mapSint32Sint32 = source._mapSint32Sint32
  379. _mapSint64Sint64 = source._mapSint64Sint64
  380. _mapFixed32Fixed32 = source._mapFixed32Fixed32
  381. _mapFixed64Fixed64 = source._mapFixed64Fixed64
  382. _mapSfixed32Sfixed32 = source._mapSfixed32Sfixed32
  383. _mapSfixed64Sfixed64 = source._mapSfixed64Sfixed64
  384. _mapInt32Float = source._mapInt32Float
  385. _mapInt32Double = source._mapInt32Double
  386. _mapBoolBool = source._mapBoolBool
  387. _mapStringString = source._mapStringString
  388. _mapInt32Bytes = source._mapInt32Bytes
  389. _mapInt32Enum = source._mapInt32Enum
  390. _mapInt32ForeignMessage = source._mapInt32ForeignMessage
  391. _teboring = source._teboring
  392. }
  393. }
  394. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  395. if !isKnownUniquelyReferenced(&_storage) {
  396. _storage = _StorageClass(copying: _storage)
  397. }
  398. return _storage
  399. }
  400. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  401. _ = _uniqueStorage()
  402. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  403. while let fieldNumber = try decoder.nextFieldNumber() {
  404. // The use of inline closures is to circumvent an issue where the compiler
  405. // allocates stack space for every case branch when no optimizations are
  406. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  407. switch fieldNumber {
  408. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &_storage._mapInt32Int32) }()
  409. case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: &_storage._mapInt64Int64) }()
  410. case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: &_storage._mapUint32Uint32) }()
  411. case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: &_storage._mapUint64Uint64) }()
  412. case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: &_storage._mapSint32Sint32) }()
  413. case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: &_storage._mapSint64Sint64) }()
  414. case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: &_storage._mapFixed32Fixed32) }()
  415. case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: &_storage._mapFixed64Fixed64) }()
  416. case 9: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: &_storage._mapSfixed32Sfixed32) }()
  417. case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: &_storage._mapSfixed64Sfixed64) }()
  418. case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: &_storage._mapInt32Float) }()
  419. case 12: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: &_storage._mapInt32Double) }()
  420. case 13: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: &_storage._mapBoolBool) }()
  421. case 14: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &_storage._mapStringString) }()
  422. case 15: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: &_storage._mapInt32Bytes) }()
  423. case 16: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_MapEnumLite>.self, value: &_storage._mapInt32Enum) }()
  424. case 17: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_ForeignMessageLite>.self, value: &_storage._mapInt32ForeignMessage) }()
  425. case 18: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &_storage._teboring) }()
  426. default: break
  427. }
  428. }
  429. }
  430. }
  431. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  432. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  433. if !_storage._mapInt32Int32.isEmpty {
  434. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: _storage._mapInt32Int32, fieldNumber: 1)
  435. }
  436. if !_storage._mapInt64Int64.isEmpty {
  437. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: _storage._mapInt64Int64, fieldNumber: 2)
  438. }
  439. if !_storage._mapUint32Uint32.isEmpty {
  440. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: _storage._mapUint32Uint32, fieldNumber: 3)
  441. }
  442. if !_storage._mapUint64Uint64.isEmpty {
  443. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: _storage._mapUint64Uint64, fieldNumber: 4)
  444. }
  445. if !_storage._mapSint32Sint32.isEmpty {
  446. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: _storage._mapSint32Sint32, fieldNumber: 5)
  447. }
  448. if !_storage._mapSint64Sint64.isEmpty {
  449. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: _storage._mapSint64Sint64, fieldNumber: 6)
  450. }
  451. if !_storage._mapFixed32Fixed32.isEmpty {
  452. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: _storage._mapFixed32Fixed32, fieldNumber: 7)
  453. }
  454. if !_storage._mapFixed64Fixed64.isEmpty {
  455. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: _storage._mapFixed64Fixed64, fieldNumber: 8)
  456. }
  457. if !_storage._mapSfixed32Sfixed32.isEmpty {
  458. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: _storage._mapSfixed32Sfixed32, fieldNumber: 9)
  459. }
  460. if !_storage._mapSfixed64Sfixed64.isEmpty {
  461. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: _storage._mapSfixed64Sfixed64, fieldNumber: 10)
  462. }
  463. if !_storage._mapInt32Float.isEmpty {
  464. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: _storage._mapInt32Float, fieldNumber: 11)
  465. }
  466. if !_storage._mapInt32Double.isEmpty {
  467. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: _storage._mapInt32Double, fieldNumber: 12)
  468. }
  469. if !_storage._mapBoolBool.isEmpty {
  470. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: _storage._mapBoolBool, fieldNumber: 13)
  471. }
  472. if !_storage._mapStringString.isEmpty {
  473. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: _storage._mapStringString, fieldNumber: 14)
  474. }
  475. if !_storage._mapInt32Bytes.isEmpty {
  476. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: _storage._mapInt32Bytes, fieldNumber: 15)
  477. }
  478. if !_storage._mapInt32Enum.isEmpty {
  479. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_MapEnumLite>.self, value: _storage._mapInt32Enum, fieldNumber: 16)
  480. }
  481. if !_storage._mapInt32ForeignMessage.isEmpty {
  482. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_ForeignMessageLite>.self, value: _storage._mapInt32ForeignMessage, fieldNumber: 17)
  483. }
  484. if !_storage._teboring.isEmpty {
  485. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: _storage._teboring, fieldNumber: 18)
  486. }
  487. }
  488. try unknownFields.traverse(visitor: &visitor)
  489. }
  490. static func ==(lhs: Proto2Unittest_TestMapLite, rhs: Proto2Unittest_TestMapLite) -> Bool {
  491. if lhs._storage !== rhs._storage {
  492. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  493. let _storage = _args.0
  494. let rhs_storage = _args.1
  495. if _storage._mapInt32Int32 != rhs_storage._mapInt32Int32 {return false}
  496. if _storage._mapInt64Int64 != rhs_storage._mapInt64Int64 {return false}
  497. if _storage._mapUint32Uint32 != rhs_storage._mapUint32Uint32 {return false}
  498. if _storage._mapUint64Uint64 != rhs_storage._mapUint64Uint64 {return false}
  499. if _storage._mapSint32Sint32 != rhs_storage._mapSint32Sint32 {return false}
  500. if _storage._mapSint64Sint64 != rhs_storage._mapSint64Sint64 {return false}
  501. if _storage._mapFixed32Fixed32 != rhs_storage._mapFixed32Fixed32 {return false}
  502. if _storage._mapFixed64Fixed64 != rhs_storage._mapFixed64Fixed64 {return false}
  503. if _storage._mapSfixed32Sfixed32 != rhs_storage._mapSfixed32Sfixed32 {return false}
  504. if _storage._mapSfixed64Sfixed64 != rhs_storage._mapSfixed64Sfixed64 {return false}
  505. if _storage._mapInt32Float != rhs_storage._mapInt32Float {return false}
  506. if _storage._mapInt32Double != rhs_storage._mapInt32Double {return false}
  507. if _storage._mapBoolBool != rhs_storage._mapBoolBool {return false}
  508. if _storage._mapStringString != rhs_storage._mapStringString {return false}
  509. if _storage._mapInt32Bytes != rhs_storage._mapInt32Bytes {return false}
  510. if _storage._mapInt32Enum != rhs_storage._mapInt32Enum {return false}
  511. if _storage._mapInt32ForeignMessage != rhs_storage._mapInt32ForeignMessage {return false}
  512. if _storage._teboring != rhs_storage._teboring {return false}
  513. return true
  514. }
  515. if !storagesAreEqual {return false}
  516. }
  517. if lhs.unknownFields != rhs.unknownFields {return false}
  518. return true
  519. }
  520. }
  521. extension Proto2Unittest_TestArenaMapLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  522. static let protoMessageName: String = _protobuf_package + ".TestArenaMapLite"
  523. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}map_int32_int32\0\u{3}map_int64_int64\0\u{3}map_uint32_uint32\0\u{3}map_uint64_uint64\0\u{3}map_sint32_sint32\0\u{3}map_sint64_sint64\0\u{3}map_fixed32_fixed32\0\u{3}map_fixed64_fixed64\0\u{3}map_sfixed32_sfixed32\0\u{3}map_sfixed64_sfixed64\0\u{3}map_int32_float\0\u{3}map_int32_double\0\u{3}map_bool_bool\0\u{3}map_string_string\0\u{3}map_int32_bytes\0\u{3}map_int32_enum\0\u{3}map_int32_foreign_message\0")
  524. fileprivate class _StorageClass {
  525. var _mapInt32Int32: Dictionary<Int32,Int32> = [:]
  526. var _mapInt64Int64: Dictionary<Int64,Int64> = [:]
  527. var _mapUint32Uint32: Dictionary<UInt32,UInt32> = [:]
  528. var _mapUint64Uint64: Dictionary<UInt64,UInt64> = [:]
  529. var _mapSint32Sint32: Dictionary<Int32,Int32> = [:]
  530. var _mapSint64Sint64: Dictionary<Int64,Int64> = [:]
  531. var _mapFixed32Fixed32: Dictionary<UInt32,UInt32> = [:]
  532. var _mapFixed64Fixed64: Dictionary<UInt64,UInt64> = [:]
  533. var _mapSfixed32Sfixed32: Dictionary<Int32,Int32> = [:]
  534. var _mapSfixed64Sfixed64: Dictionary<Int64,Int64> = [:]
  535. var _mapInt32Float: Dictionary<Int32,Float> = [:]
  536. var _mapInt32Double: Dictionary<Int32,Double> = [:]
  537. var _mapBoolBool: Dictionary<Bool,Bool> = [:]
  538. var _mapStringString: Dictionary<String,String> = [:]
  539. var _mapInt32Bytes: Dictionary<Int32,Data> = [:]
  540. var _mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnumLite> = [:]
  541. var _mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessageArenaLite> = [:]
  542. // This property is used as the initial default value for new instances of the type.
  543. // The type itself is protecting the reference to its storage via CoW semantics.
  544. // This will force a copy to be made of this reference when the first mutation occurs;
  545. // hence, it is safe to mark this as `nonisolated(unsafe)`.
  546. static nonisolated(unsafe) let defaultInstance = _StorageClass()
  547. private init() {}
  548. init(copying source: _StorageClass) {
  549. _mapInt32Int32 = source._mapInt32Int32
  550. _mapInt64Int64 = source._mapInt64Int64
  551. _mapUint32Uint32 = source._mapUint32Uint32
  552. _mapUint64Uint64 = source._mapUint64Uint64
  553. _mapSint32Sint32 = source._mapSint32Sint32
  554. _mapSint64Sint64 = source._mapSint64Sint64
  555. _mapFixed32Fixed32 = source._mapFixed32Fixed32
  556. _mapFixed64Fixed64 = source._mapFixed64Fixed64
  557. _mapSfixed32Sfixed32 = source._mapSfixed32Sfixed32
  558. _mapSfixed64Sfixed64 = source._mapSfixed64Sfixed64
  559. _mapInt32Float = source._mapInt32Float
  560. _mapInt32Double = source._mapInt32Double
  561. _mapBoolBool = source._mapBoolBool
  562. _mapStringString = source._mapStringString
  563. _mapInt32Bytes = source._mapInt32Bytes
  564. _mapInt32Enum = source._mapInt32Enum
  565. _mapInt32ForeignMessage = source._mapInt32ForeignMessage
  566. }
  567. }
  568. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  569. if !isKnownUniquelyReferenced(&_storage) {
  570. _storage = _StorageClass(copying: _storage)
  571. }
  572. return _storage
  573. }
  574. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  575. _ = _uniqueStorage()
  576. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  577. while let fieldNumber = try decoder.nextFieldNumber() {
  578. // The use of inline closures is to circumvent an issue where the compiler
  579. // allocates stack space for every case branch when no optimizations are
  580. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  581. switch fieldNumber {
  582. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &_storage._mapInt32Int32) }()
  583. case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: &_storage._mapInt64Int64) }()
  584. case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: &_storage._mapUint32Uint32) }()
  585. case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: &_storage._mapUint64Uint64) }()
  586. case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: &_storage._mapSint32Sint32) }()
  587. case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: &_storage._mapSint64Sint64) }()
  588. case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: &_storage._mapFixed32Fixed32) }()
  589. case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: &_storage._mapFixed64Fixed64) }()
  590. case 9: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: &_storage._mapSfixed32Sfixed32) }()
  591. case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: &_storage._mapSfixed64Sfixed64) }()
  592. case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: &_storage._mapInt32Float) }()
  593. case 12: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: &_storage._mapInt32Double) }()
  594. case 13: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: &_storage._mapBoolBool) }()
  595. case 14: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &_storage._mapStringString) }()
  596. case 15: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: &_storage._mapInt32Bytes) }()
  597. case 16: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_MapEnumLite>.self, value: &_storage._mapInt32Enum) }()
  598. case 17: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_ForeignMessageArenaLite>.self, value: &_storage._mapInt32ForeignMessage) }()
  599. default: break
  600. }
  601. }
  602. }
  603. }
  604. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  605. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  606. if !_storage._mapInt32Int32.isEmpty {
  607. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: _storage._mapInt32Int32, fieldNumber: 1)
  608. }
  609. if !_storage._mapInt64Int64.isEmpty {
  610. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: _storage._mapInt64Int64, fieldNumber: 2)
  611. }
  612. if !_storage._mapUint32Uint32.isEmpty {
  613. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: _storage._mapUint32Uint32, fieldNumber: 3)
  614. }
  615. if !_storage._mapUint64Uint64.isEmpty {
  616. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: _storage._mapUint64Uint64, fieldNumber: 4)
  617. }
  618. if !_storage._mapSint32Sint32.isEmpty {
  619. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: _storage._mapSint32Sint32, fieldNumber: 5)
  620. }
  621. if !_storage._mapSint64Sint64.isEmpty {
  622. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: _storage._mapSint64Sint64, fieldNumber: 6)
  623. }
  624. if !_storage._mapFixed32Fixed32.isEmpty {
  625. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: _storage._mapFixed32Fixed32, fieldNumber: 7)
  626. }
  627. if !_storage._mapFixed64Fixed64.isEmpty {
  628. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: _storage._mapFixed64Fixed64, fieldNumber: 8)
  629. }
  630. if !_storage._mapSfixed32Sfixed32.isEmpty {
  631. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: _storage._mapSfixed32Sfixed32, fieldNumber: 9)
  632. }
  633. if !_storage._mapSfixed64Sfixed64.isEmpty {
  634. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: _storage._mapSfixed64Sfixed64, fieldNumber: 10)
  635. }
  636. if !_storage._mapInt32Float.isEmpty {
  637. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: _storage._mapInt32Float, fieldNumber: 11)
  638. }
  639. if !_storage._mapInt32Double.isEmpty {
  640. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: _storage._mapInt32Double, fieldNumber: 12)
  641. }
  642. if !_storage._mapBoolBool.isEmpty {
  643. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: _storage._mapBoolBool, fieldNumber: 13)
  644. }
  645. if !_storage._mapStringString.isEmpty {
  646. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: _storage._mapStringString, fieldNumber: 14)
  647. }
  648. if !_storage._mapInt32Bytes.isEmpty {
  649. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: _storage._mapInt32Bytes, fieldNumber: 15)
  650. }
  651. if !_storage._mapInt32Enum.isEmpty {
  652. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_MapEnumLite>.self, value: _storage._mapInt32Enum, fieldNumber: 16)
  653. }
  654. if !_storage._mapInt32ForeignMessage.isEmpty {
  655. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_ForeignMessageArenaLite>.self, value: _storage._mapInt32ForeignMessage, fieldNumber: 17)
  656. }
  657. }
  658. try unknownFields.traverse(visitor: &visitor)
  659. }
  660. static func ==(lhs: Proto2Unittest_TestArenaMapLite, rhs: Proto2Unittest_TestArenaMapLite) -> Bool {
  661. if lhs._storage !== rhs._storage {
  662. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  663. let _storage = _args.0
  664. let rhs_storage = _args.1
  665. if _storage._mapInt32Int32 != rhs_storage._mapInt32Int32 {return false}
  666. if _storage._mapInt64Int64 != rhs_storage._mapInt64Int64 {return false}
  667. if _storage._mapUint32Uint32 != rhs_storage._mapUint32Uint32 {return false}
  668. if _storage._mapUint64Uint64 != rhs_storage._mapUint64Uint64 {return false}
  669. if _storage._mapSint32Sint32 != rhs_storage._mapSint32Sint32 {return false}
  670. if _storage._mapSint64Sint64 != rhs_storage._mapSint64Sint64 {return false}
  671. if _storage._mapFixed32Fixed32 != rhs_storage._mapFixed32Fixed32 {return false}
  672. if _storage._mapFixed64Fixed64 != rhs_storage._mapFixed64Fixed64 {return false}
  673. if _storage._mapSfixed32Sfixed32 != rhs_storage._mapSfixed32Sfixed32 {return false}
  674. if _storage._mapSfixed64Sfixed64 != rhs_storage._mapSfixed64Sfixed64 {return false}
  675. if _storage._mapInt32Float != rhs_storage._mapInt32Float {return false}
  676. if _storage._mapInt32Double != rhs_storage._mapInt32Double {return false}
  677. if _storage._mapBoolBool != rhs_storage._mapBoolBool {return false}
  678. if _storage._mapStringString != rhs_storage._mapStringString {return false}
  679. if _storage._mapInt32Bytes != rhs_storage._mapInt32Bytes {return false}
  680. if _storage._mapInt32Enum != rhs_storage._mapInt32Enum {return false}
  681. if _storage._mapInt32ForeignMessage != rhs_storage._mapInt32ForeignMessage {return false}
  682. return true
  683. }
  684. if !storagesAreEqual {return false}
  685. }
  686. if lhs.unknownFields != rhs.unknownFields {return false}
  687. return true
  688. }
  689. }
  690. extension Proto2Unittest_TestRequiredMessageMapLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  691. static let protoMessageName: String = _protobuf_package + ".TestRequiredMessageMapLite"
  692. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}map_field\0")
  693. public var isInitialized: Bool {
  694. if !SwiftProtobuf.Internal.areAllInitialized(self.mapField) {return false}
  695. return true
  696. }
  697. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  698. while let fieldNumber = try decoder.nextFieldNumber() {
  699. // The use of inline closures is to circumvent an issue where the compiler
  700. // allocates stack space for every case branch when no optimizations are
  701. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  702. switch fieldNumber {
  703. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestRequiredLite>.self, value: &self.mapField) }()
  704. default: break
  705. }
  706. }
  707. }
  708. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  709. if !self.mapField.isEmpty {
  710. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestRequiredLite>.self, value: self.mapField, fieldNumber: 1)
  711. }
  712. try unknownFields.traverse(visitor: &visitor)
  713. }
  714. static func ==(lhs: Proto2Unittest_TestRequiredMessageMapLite, rhs: Proto2Unittest_TestRequiredMessageMapLite) -> Bool {
  715. if lhs.mapField != rhs.mapField {return false}
  716. if lhs.unknownFields != rhs.unknownFields {return false}
  717. return true
  718. }
  719. }
  720. extension Proto2Unittest_TestEnumMapLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  721. static let protoMessageName: String = _protobuf_package + ".TestEnumMapLite"
  722. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{4}e\u{1}known_map_field\0\u{3}unknown_map_field\0")
  723. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  724. while let fieldNumber = try decoder.nextFieldNumber() {
  725. // The use of inline closures is to circumvent an issue where the compiler
  726. // allocates stack space for every case branch when no optimizations are
  727. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  728. switch fieldNumber {
  729. case 101: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_Proto2MapEnumLite>.self, value: &self.knownMapField) }()
  730. case 102: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_Proto2MapEnumLite>.self, value: &self.unknownMapField) }()
  731. default: break
  732. }
  733. }
  734. }
  735. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  736. if !self.knownMapField.isEmpty {
  737. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_Proto2MapEnumLite>.self, value: self.knownMapField, fieldNumber: 101)
  738. }
  739. if !self.unknownMapField.isEmpty {
  740. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_Proto2MapEnumLite>.self, value: self.unknownMapField, fieldNumber: 102)
  741. }
  742. try unknownFields.traverse(visitor: &visitor)
  743. }
  744. static func ==(lhs: Proto2Unittest_TestEnumMapLite, rhs: Proto2Unittest_TestEnumMapLite) -> Bool {
  745. if lhs.knownMapField != rhs.knownMapField {return false}
  746. if lhs.unknownMapField != rhs.unknownMapField {return false}
  747. if lhs.unknownFields != rhs.unknownFields {return false}
  748. return true
  749. }
  750. }
  751. extension Proto2Unittest_TestEnumMapPlusExtraLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  752. static let protoMessageName: String = _protobuf_package + ".TestEnumMapPlusExtraLite"
  753. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{4}e\u{1}known_map_field\0\u{3}unknown_map_field\0")
  754. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  755. while let fieldNumber = try decoder.nextFieldNumber() {
  756. // The use of inline closures is to circumvent an issue where the compiler
  757. // allocates stack space for every case branch when no optimizations are
  758. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  759. switch fieldNumber {
  760. case 101: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_Proto2MapEnumPlusExtraLite>.self, value: &self.knownMapField) }()
  761. case 102: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_Proto2MapEnumPlusExtraLite>.self, value: &self.unknownMapField) }()
  762. default: break
  763. }
  764. }
  765. }
  766. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  767. if !self.knownMapField.isEmpty {
  768. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_Proto2MapEnumPlusExtraLite>.self, value: self.knownMapField, fieldNumber: 101)
  769. }
  770. if !self.unknownMapField.isEmpty {
  771. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_Proto2MapEnumPlusExtraLite>.self, value: self.unknownMapField, fieldNumber: 102)
  772. }
  773. try unknownFields.traverse(visitor: &visitor)
  774. }
  775. static func ==(lhs: Proto2Unittest_TestEnumMapPlusExtraLite, rhs: Proto2Unittest_TestEnumMapPlusExtraLite) -> Bool {
  776. if lhs.knownMapField != rhs.knownMapField {return false}
  777. if lhs.unknownMapField != rhs.unknownMapField {return false}
  778. if lhs.unknownFields != rhs.unknownFields {return false}
  779. return true
  780. }
  781. }
  782. extension Proto2Unittest_TestMessageMapLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  783. static let protoMessageName: String = _protobuf_package + ".TestMessageMapLite"
  784. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}map_int32_message\0")
  785. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  786. while let fieldNumber = try decoder.nextFieldNumber() {
  787. // The use of inline closures is to circumvent an issue where the compiler
  788. // allocates stack space for every case branch when no optimizations are
  789. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  790. switch fieldNumber {
  791. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypesLite>.self, value: &self.mapInt32Message) }()
  792. default: break
  793. }
  794. }
  795. }
  796. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  797. if !self.mapInt32Message.isEmpty {
  798. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypesLite>.self, value: self.mapInt32Message, fieldNumber: 1)
  799. }
  800. try unknownFields.traverse(visitor: &visitor)
  801. }
  802. static func ==(lhs: Proto2Unittest_TestMessageMapLite, rhs: Proto2Unittest_TestMessageMapLite) -> Bool {
  803. if lhs.mapInt32Message != rhs.mapInt32Message {return false}
  804. if lhs.unknownFields != rhs.unknownFields {return false}
  805. return true
  806. }
  807. }
  808. extension Proto2Unittest_TestRequiredLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  809. static let protoMessageName: String = _protobuf_package + ".TestRequiredLite"
  810. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}a\0\u{1}b\0\u{1}c\0")
  811. public var isInitialized: Bool {
  812. if self._a == nil {return false}
  813. if self._b == nil {return false}
  814. if self._c == nil {return false}
  815. return true
  816. }
  817. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  818. while let fieldNumber = try decoder.nextFieldNumber() {
  819. // The use of inline closures is to circumvent an issue where the compiler
  820. // allocates stack space for every case branch when no optimizations are
  821. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  822. switch fieldNumber {
  823. case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }()
  824. case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
  825. case 3: try { try decoder.decodeSingularInt32Field(value: &self._c) }()
  826. default: break
  827. }
  828. }
  829. }
  830. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  831. // The use of inline closures is to circumvent an issue where the compiler
  832. // allocates stack space for every if/case branch local when no optimizations
  833. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  834. // https://github.com/apple/swift-protobuf/issues/1182
  835. try { if let v = self._a {
  836. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  837. } }()
  838. try { if let v = self._b {
  839. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  840. } }()
  841. try { if let v = self._c {
  842. try visitor.visitSingularInt32Field(value: v, fieldNumber: 3)
  843. } }()
  844. try unknownFields.traverse(visitor: &visitor)
  845. }
  846. static func ==(lhs: Proto2Unittest_TestRequiredLite, rhs: Proto2Unittest_TestRequiredLite) -> Bool {
  847. if lhs._a != rhs._a {return false}
  848. if lhs._b != rhs._b {return false}
  849. if lhs._c != rhs._c {return false}
  850. if lhs.unknownFields != rhs.unknownFields {return false}
  851. return true
  852. }
  853. }
  854. extension Proto2Unittest_ForeignMessageArenaLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  855. static let protoMessageName: String = _protobuf_package + ".ForeignMessageArenaLite"
  856. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}c\0")
  857. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  858. while let fieldNumber = try decoder.nextFieldNumber() {
  859. // The use of inline closures is to circumvent an issue where the compiler
  860. // allocates stack space for every case branch when no optimizations are
  861. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  862. switch fieldNumber {
  863. case 1: try { try decoder.decodeSingularInt32Field(value: &self._c) }()
  864. default: break
  865. }
  866. }
  867. }
  868. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  869. // The use of inline closures is to circumvent an issue where the compiler
  870. // allocates stack space for every if/case branch local when no optimizations
  871. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  872. // https://github.com/apple/swift-protobuf/issues/1182
  873. try { if let v = self._c {
  874. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  875. } }()
  876. try unknownFields.traverse(visitor: &visitor)
  877. }
  878. static func ==(lhs: Proto2Unittest_ForeignMessageArenaLite, rhs: Proto2Unittest_ForeignMessageArenaLite) -> Bool {
  879. if lhs._c != rhs._c {return false}
  880. if lhs.unknownFields != rhs.unknownFields {return false}
  881. return true
  882. }
  883. }