map_unittest.pb.swift 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172
  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_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_MapEnum: SwiftProtobuf.Enum, Swift.CaseIterable {
  28. typealias RawValue = Int
  29. case foo // = 0
  30. case bar // = 1
  31. case baz // = 2
  32. case UNRECOGNIZED(Int)
  33. init() {
  34. self = .foo
  35. }
  36. init?(rawValue: Int) {
  37. switch rawValue {
  38. case 0: self = .foo
  39. case 1: self = .bar
  40. case 2: self = .baz
  41. default: self = .UNRECOGNIZED(rawValue)
  42. }
  43. }
  44. var rawValue: Int {
  45. switch self {
  46. case .foo: return 0
  47. case .bar: return 1
  48. case .baz: return 2
  49. case .UNRECOGNIZED(let i): return i
  50. }
  51. }
  52. // The compiler won't synthesize support with the UNRECOGNIZED case.
  53. static let allCases: [Proto2Unittest_MapEnum] = [
  54. .foo,
  55. .bar,
  56. .baz,
  57. ]
  58. }
  59. /// Tests maps.
  60. struct Proto2Unittest_TestMap: @unchecked Sendable {
  61. // SwiftProtobuf.Message conformance is added in an extension below. See the
  62. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  63. // methods supported on all messages.
  64. var mapInt32Int32: Dictionary<Int32,Int32> {
  65. get {_storage._mapInt32Int32}
  66. set {_uniqueStorage()._mapInt32Int32 = newValue}
  67. }
  68. var mapInt64Int64: Dictionary<Int64,Int64> {
  69. get {_storage._mapInt64Int64}
  70. set {_uniqueStorage()._mapInt64Int64 = newValue}
  71. }
  72. var mapUint32Uint32: Dictionary<UInt32,UInt32> {
  73. get {_storage._mapUint32Uint32}
  74. set {_uniqueStorage()._mapUint32Uint32 = newValue}
  75. }
  76. var mapUint64Uint64: Dictionary<UInt64,UInt64> {
  77. get {_storage._mapUint64Uint64}
  78. set {_uniqueStorage()._mapUint64Uint64 = newValue}
  79. }
  80. var mapSint32Sint32: Dictionary<Int32,Int32> {
  81. get {_storage._mapSint32Sint32}
  82. set {_uniqueStorage()._mapSint32Sint32 = newValue}
  83. }
  84. var mapSint64Sint64: Dictionary<Int64,Int64> {
  85. get {_storage._mapSint64Sint64}
  86. set {_uniqueStorage()._mapSint64Sint64 = newValue}
  87. }
  88. var mapFixed32Fixed32: Dictionary<UInt32,UInt32> {
  89. get {_storage._mapFixed32Fixed32}
  90. set {_uniqueStorage()._mapFixed32Fixed32 = newValue}
  91. }
  92. var mapFixed64Fixed64: Dictionary<UInt64,UInt64> {
  93. get {_storage._mapFixed64Fixed64}
  94. set {_uniqueStorage()._mapFixed64Fixed64 = newValue}
  95. }
  96. var mapSfixed32Sfixed32: Dictionary<Int32,Int32> {
  97. get {_storage._mapSfixed32Sfixed32}
  98. set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue}
  99. }
  100. var mapSfixed64Sfixed64: Dictionary<Int64,Int64> {
  101. get {_storage._mapSfixed64Sfixed64}
  102. set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue}
  103. }
  104. var mapInt32Float: Dictionary<Int32,Float> {
  105. get {_storage._mapInt32Float}
  106. set {_uniqueStorage()._mapInt32Float = newValue}
  107. }
  108. var mapInt32Double: Dictionary<Int32,Double> {
  109. get {_storage._mapInt32Double}
  110. set {_uniqueStorage()._mapInt32Double = newValue}
  111. }
  112. var mapBoolBool: Dictionary<Bool,Bool> {
  113. get {_storage._mapBoolBool}
  114. set {_uniqueStorage()._mapBoolBool = newValue}
  115. }
  116. var mapStringString: Dictionary<String,String> {
  117. get {_storage._mapStringString}
  118. set {_uniqueStorage()._mapStringString = newValue}
  119. }
  120. var mapInt32Bytes: Dictionary<Int32,Data> {
  121. get {_storage._mapInt32Bytes}
  122. set {_uniqueStorage()._mapInt32Bytes = newValue}
  123. }
  124. var mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnum> {
  125. get {_storage._mapInt32Enum}
  126. set {_uniqueStorage()._mapInt32Enum = newValue}
  127. }
  128. var mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessage> {
  129. get {_storage._mapInt32ForeignMessage}
  130. set {_uniqueStorage()._mapInt32ForeignMessage = newValue}
  131. }
  132. var mapStringForeignMessage: Dictionary<String,Proto2Unittest_ForeignMessage> {
  133. get {_storage._mapStringForeignMessage}
  134. set {_uniqueStorage()._mapStringForeignMessage = newValue}
  135. }
  136. /// Caveat emptor: be careful adding new fields here.
  137. /// The TestMap proto is used to generate additional tests and couples tightly
  138. /// with map_test_util.h, which in turn couples tightly with TestMapLite.
  139. var mapInt32AllTypes: Dictionary<Int32,Proto2Unittest_TestAllTypes> {
  140. get {_storage._mapInt32AllTypes}
  141. set {_uniqueStorage()._mapInt32AllTypes = newValue}
  142. }
  143. var unknownFields = SwiftProtobuf.UnknownStorage()
  144. init() {}
  145. fileprivate var _storage = _StorageClass.defaultInstance
  146. }
  147. struct Proto2Unittest_TestMapWithMessages: Sendable {
  148. // SwiftProtobuf.Message conformance is added in an extension below. See the
  149. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  150. // methods supported on all messages.
  151. var mapInt32AllTypes: Dictionary<Int32,Proto2Unittest_TestAllTypes> = [:]
  152. var mapInt64AllTypes: Dictionary<Int64,Proto2Unittest_TestAllTypes> = [:]
  153. var mapUint32AllTypes: Dictionary<UInt32,Proto2Unittest_TestAllTypes> = [:]
  154. var mapUint64AllTypes: Dictionary<UInt64,Proto2Unittest_TestAllTypes> = [:]
  155. var mapSint32AllTypes: Dictionary<Int32,Proto2Unittest_TestAllTypes> = [:]
  156. var mapSint64AllTypes: Dictionary<Int64,Proto2Unittest_TestAllTypes> = [:]
  157. var mapFixed32AllTypes: Dictionary<UInt32,Proto2Unittest_TestAllTypes> = [:]
  158. var mapFixed64AllTypes: Dictionary<UInt64,Proto2Unittest_TestAllTypes> = [:]
  159. var mapSfixed32AllTypes: Dictionary<Int32,Proto2Unittest_TestAllTypes> = [:]
  160. var mapSfixed64AllTypes: Dictionary<Int64,Proto2Unittest_TestAllTypes> = [:]
  161. var mapBoolAllTypes: Dictionary<Bool,Proto2Unittest_TestAllTypes> = [:]
  162. var mapStringAllTypes: Dictionary<String,Proto2Unittest_TestAllTypes> = [:]
  163. var unknownFields = SwiftProtobuf.UnknownStorage()
  164. init() {}
  165. }
  166. struct Proto2Unittest_TestMapSubmessage: Sendable {
  167. // SwiftProtobuf.Message conformance is added in an extension below. See the
  168. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  169. // methods supported on all messages.
  170. var testMap: Proto2Unittest_TestMap {
  171. get {_testMap ?? Proto2Unittest_TestMap()}
  172. set {_testMap = newValue}
  173. }
  174. /// Returns true if `testMap` has been explicitly set.
  175. var hasTestMap: Bool {self._testMap != nil}
  176. /// Clears the value of `testMap`. Subsequent reads from it will return its default value.
  177. mutating func clearTestMap() {self._testMap = nil}
  178. var unknownFields = SwiftProtobuf.UnknownStorage()
  179. init() {}
  180. fileprivate var _testMap: Proto2Unittest_TestMap? = nil
  181. }
  182. struct Proto2Unittest_TestMessageMap: Sendable {
  183. // SwiftProtobuf.Message conformance is added in an extension below. See the
  184. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  185. // methods supported on all messages.
  186. var mapInt32Message: Dictionary<Int32,Proto2Unittest_TestAllTypes> = [:]
  187. var unknownFields = SwiftProtobuf.UnknownStorage()
  188. init() {}
  189. }
  190. /// Two map fields share the same entry default instance.
  191. struct Proto2Unittest_TestSameTypeMap: Sendable {
  192. // SwiftProtobuf.Message conformance is added in an extension below. See the
  193. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  194. // methods supported on all messages.
  195. var map1: Dictionary<Int32,Int32> = [:]
  196. var map2: Dictionary<Int32,Int32> = [:]
  197. var unknownFields = SwiftProtobuf.UnknownStorage()
  198. init() {}
  199. }
  200. /// Test embedded message with required fields
  201. struct Proto2Unittest_TestRequiredMessageMap: Sendable {
  202. // SwiftProtobuf.Message conformance is added in an extension below. See the
  203. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  204. // methods supported on all messages.
  205. var mapField: Dictionary<Int32,Proto2Unittest_TestRequired> = [:]
  206. var unknownFields = SwiftProtobuf.UnknownStorage()
  207. init() {}
  208. }
  209. struct Proto2Unittest_TestArenaMap: @unchecked 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 mapInt32Int32: Dictionary<Int32,Int32> {
  214. get {_storage._mapInt32Int32}
  215. set {_uniqueStorage()._mapInt32Int32 = newValue}
  216. }
  217. var mapInt64Int64: Dictionary<Int64,Int64> {
  218. get {_storage._mapInt64Int64}
  219. set {_uniqueStorage()._mapInt64Int64 = newValue}
  220. }
  221. var mapUint32Uint32: Dictionary<UInt32,UInt32> {
  222. get {_storage._mapUint32Uint32}
  223. set {_uniqueStorage()._mapUint32Uint32 = newValue}
  224. }
  225. var mapUint64Uint64: Dictionary<UInt64,UInt64> {
  226. get {_storage._mapUint64Uint64}
  227. set {_uniqueStorage()._mapUint64Uint64 = newValue}
  228. }
  229. var mapSint32Sint32: Dictionary<Int32,Int32> {
  230. get {_storage._mapSint32Sint32}
  231. set {_uniqueStorage()._mapSint32Sint32 = newValue}
  232. }
  233. var mapSint64Sint64: Dictionary<Int64,Int64> {
  234. get {_storage._mapSint64Sint64}
  235. set {_uniqueStorage()._mapSint64Sint64 = newValue}
  236. }
  237. var mapFixed32Fixed32: Dictionary<UInt32,UInt32> {
  238. get {_storage._mapFixed32Fixed32}
  239. set {_uniqueStorage()._mapFixed32Fixed32 = newValue}
  240. }
  241. var mapFixed64Fixed64: Dictionary<UInt64,UInt64> {
  242. get {_storage._mapFixed64Fixed64}
  243. set {_uniqueStorage()._mapFixed64Fixed64 = newValue}
  244. }
  245. var mapSfixed32Sfixed32: Dictionary<Int32,Int32> {
  246. get {_storage._mapSfixed32Sfixed32}
  247. set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue}
  248. }
  249. var mapSfixed64Sfixed64: Dictionary<Int64,Int64> {
  250. get {_storage._mapSfixed64Sfixed64}
  251. set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue}
  252. }
  253. var mapInt32Float: Dictionary<Int32,Float> {
  254. get {_storage._mapInt32Float}
  255. set {_uniqueStorage()._mapInt32Float = newValue}
  256. }
  257. var mapInt32Double: Dictionary<Int32,Double> {
  258. get {_storage._mapInt32Double}
  259. set {_uniqueStorage()._mapInt32Double = newValue}
  260. }
  261. var mapBoolBool: Dictionary<Bool,Bool> {
  262. get {_storage._mapBoolBool}
  263. set {_uniqueStorage()._mapBoolBool = newValue}
  264. }
  265. var mapStringString: Dictionary<String,String> {
  266. get {_storage._mapStringString}
  267. set {_uniqueStorage()._mapStringString = newValue}
  268. }
  269. var mapInt32Bytes: Dictionary<Int32,Data> {
  270. get {_storage._mapInt32Bytes}
  271. set {_uniqueStorage()._mapInt32Bytes = newValue}
  272. }
  273. var mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnum> {
  274. get {_storage._mapInt32Enum}
  275. set {_uniqueStorage()._mapInt32Enum = newValue}
  276. }
  277. var mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessage> {
  278. get {_storage._mapInt32ForeignMessage}
  279. set {_uniqueStorage()._mapInt32ForeignMessage = newValue}
  280. }
  281. var unknownFields = SwiftProtobuf.UnknownStorage()
  282. init() {}
  283. fileprivate var _storage = _StorageClass.defaultInstance
  284. }
  285. /// Previously, message containing enum called Type cannot be used as value of
  286. /// map field.
  287. struct Proto2Unittest_MessageContainingEnumCalledType: Sendable {
  288. // SwiftProtobuf.Message conformance is added in an extension below. See the
  289. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  290. // methods supported on all messages.
  291. var type: Dictionary<String,Proto2Unittest_MessageContainingEnumCalledType> = [:]
  292. var unknownFields = SwiftProtobuf.UnknownStorage()
  293. enum TypeEnum: SwiftProtobuf.Enum, Swift.CaseIterable {
  294. typealias RawValue = Int
  295. case foo // = 0
  296. case UNRECOGNIZED(Int)
  297. init() {
  298. self = .foo
  299. }
  300. init?(rawValue: Int) {
  301. switch rawValue {
  302. case 0: self = .foo
  303. default: self = .UNRECOGNIZED(rawValue)
  304. }
  305. }
  306. var rawValue: Int {
  307. switch self {
  308. case .foo: return 0
  309. case .UNRECOGNIZED(let i): return i
  310. }
  311. }
  312. // The compiler won't synthesize support with the UNRECOGNIZED case.
  313. static let allCases: [Proto2Unittest_MessageContainingEnumCalledType.TypeEnum] = [
  314. .foo,
  315. ]
  316. }
  317. init() {}
  318. }
  319. /// Previously, message cannot contain map field called "entry".
  320. struct Proto2Unittest_MessageContainingMapCalledEntry: Sendable {
  321. // SwiftProtobuf.Message conformance is added in an extension below. See the
  322. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  323. // methods supported on all messages.
  324. var entry: Dictionary<Int32,Int32> = [:]
  325. var unknownFields = SwiftProtobuf.UnknownStorage()
  326. init() {}
  327. }
  328. struct Proto2Unittest_TestRecursiveMapMessage: Sendable {
  329. // SwiftProtobuf.Message conformance is added in an extension below. See the
  330. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  331. // methods supported on all messages.
  332. var a: Dictionary<String,Proto2Unittest_TestRecursiveMapMessage> = [:]
  333. var unknownFields = SwiftProtobuf.UnknownStorage()
  334. init() {}
  335. }
  336. struct Proto2Unittest_TestI32StrMap: Sendable {
  337. // SwiftProtobuf.Message conformance is added in an extension below. See the
  338. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  339. // methods supported on all messages.
  340. var m32Str: Dictionary<Int32,String> = [:]
  341. var unknownFields = SwiftProtobuf.UnknownStorage()
  342. init() {}
  343. }
  344. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  345. fileprivate let _protobuf_package = "proto2_unittest"
  346. extension Proto2Unittest_MapEnum: SwiftProtobuf._ProtoNameProviding {
  347. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0MAP_ENUM_FOO\0\u{1}MAP_ENUM_BAR\0\u{1}MAP_ENUM_BAZ\0")
  348. }
  349. extension Proto2Unittest_TestMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  350. static let protoMessageName: String = _protobuf_package + ".TestMap"
  351. 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{3}map_string_foreign_message\0\u{3}map_int32_all_types\0")
  352. fileprivate class _StorageClass {
  353. var _mapInt32Int32: Dictionary<Int32,Int32> = [:]
  354. var _mapInt64Int64: Dictionary<Int64,Int64> = [:]
  355. var _mapUint32Uint32: Dictionary<UInt32,UInt32> = [:]
  356. var _mapUint64Uint64: Dictionary<UInt64,UInt64> = [:]
  357. var _mapSint32Sint32: Dictionary<Int32,Int32> = [:]
  358. var _mapSint64Sint64: Dictionary<Int64,Int64> = [:]
  359. var _mapFixed32Fixed32: Dictionary<UInt32,UInt32> = [:]
  360. var _mapFixed64Fixed64: Dictionary<UInt64,UInt64> = [:]
  361. var _mapSfixed32Sfixed32: Dictionary<Int32,Int32> = [:]
  362. var _mapSfixed64Sfixed64: Dictionary<Int64,Int64> = [:]
  363. var _mapInt32Float: Dictionary<Int32,Float> = [:]
  364. var _mapInt32Double: Dictionary<Int32,Double> = [:]
  365. var _mapBoolBool: Dictionary<Bool,Bool> = [:]
  366. var _mapStringString: Dictionary<String,String> = [:]
  367. var _mapInt32Bytes: Dictionary<Int32,Data> = [:]
  368. var _mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnum> = [:]
  369. var _mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessage> = [:]
  370. var _mapStringForeignMessage: Dictionary<String,Proto2Unittest_ForeignMessage> = [:]
  371. var _mapInt32AllTypes: Dictionary<Int32,Proto2Unittest_TestAllTypes> = [:]
  372. // This property is used as the initial default value for new instances of the type.
  373. // The type itself is protecting the reference to its storage via CoW semantics.
  374. // This will force a copy to be made of this reference when the first mutation occurs;
  375. // hence, it is safe to mark this as `nonisolated(unsafe)`.
  376. static nonisolated(unsafe) let defaultInstance = _StorageClass()
  377. private init() {}
  378. init(copying source: _StorageClass) {
  379. _mapInt32Int32 = source._mapInt32Int32
  380. _mapInt64Int64 = source._mapInt64Int64
  381. _mapUint32Uint32 = source._mapUint32Uint32
  382. _mapUint64Uint64 = source._mapUint64Uint64
  383. _mapSint32Sint32 = source._mapSint32Sint32
  384. _mapSint64Sint64 = source._mapSint64Sint64
  385. _mapFixed32Fixed32 = source._mapFixed32Fixed32
  386. _mapFixed64Fixed64 = source._mapFixed64Fixed64
  387. _mapSfixed32Sfixed32 = source._mapSfixed32Sfixed32
  388. _mapSfixed64Sfixed64 = source._mapSfixed64Sfixed64
  389. _mapInt32Float = source._mapInt32Float
  390. _mapInt32Double = source._mapInt32Double
  391. _mapBoolBool = source._mapBoolBool
  392. _mapStringString = source._mapStringString
  393. _mapInt32Bytes = source._mapInt32Bytes
  394. _mapInt32Enum = source._mapInt32Enum
  395. _mapInt32ForeignMessage = source._mapInt32ForeignMessage
  396. _mapStringForeignMessage = source._mapStringForeignMessage
  397. _mapInt32AllTypes = source._mapInt32AllTypes
  398. }
  399. }
  400. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  401. if !isKnownUniquelyReferenced(&_storage) {
  402. _storage = _StorageClass(copying: _storage)
  403. }
  404. return _storage
  405. }
  406. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  407. _ = _uniqueStorage()
  408. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  409. while let fieldNumber = try decoder.nextFieldNumber() {
  410. // The use of inline closures is to circumvent an issue where the compiler
  411. // allocates stack space for every case branch when no optimizations are
  412. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  413. switch fieldNumber {
  414. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &_storage._mapInt32Int32) }()
  415. case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: &_storage._mapInt64Int64) }()
  416. case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: &_storage._mapUint32Uint32) }()
  417. case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: &_storage._mapUint64Uint64) }()
  418. case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: &_storage._mapSint32Sint32) }()
  419. case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: &_storage._mapSint64Sint64) }()
  420. case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: &_storage._mapFixed32Fixed32) }()
  421. case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: &_storage._mapFixed64Fixed64) }()
  422. case 9: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: &_storage._mapSfixed32Sfixed32) }()
  423. case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: &_storage._mapSfixed64Sfixed64) }()
  424. case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: &_storage._mapInt32Float) }()
  425. case 12: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: &_storage._mapInt32Double) }()
  426. case 13: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: &_storage._mapBoolBool) }()
  427. case 14: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &_storage._mapStringString) }()
  428. case 15: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: &_storage._mapInt32Bytes) }()
  429. case 16: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_MapEnum>.self, value: &_storage._mapInt32Enum) }()
  430. case 17: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_ForeignMessage>.self, value: &_storage._mapInt32ForeignMessage) }()
  431. case 18: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_ForeignMessage>.self, value: &_storage._mapStringForeignMessage) }()
  432. case 19: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypes>.self, value: &_storage._mapInt32AllTypes) }()
  433. default: break
  434. }
  435. }
  436. }
  437. }
  438. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  439. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  440. if !_storage._mapInt32Int32.isEmpty {
  441. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: _storage._mapInt32Int32, fieldNumber: 1)
  442. }
  443. if !_storage._mapInt64Int64.isEmpty {
  444. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: _storage._mapInt64Int64, fieldNumber: 2)
  445. }
  446. if !_storage._mapUint32Uint32.isEmpty {
  447. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: _storage._mapUint32Uint32, fieldNumber: 3)
  448. }
  449. if !_storage._mapUint64Uint64.isEmpty {
  450. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: _storage._mapUint64Uint64, fieldNumber: 4)
  451. }
  452. if !_storage._mapSint32Sint32.isEmpty {
  453. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: _storage._mapSint32Sint32, fieldNumber: 5)
  454. }
  455. if !_storage._mapSint64Sint64.isEmpty {
  456. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: _storage._mapSint64Sint64, fieldNumber: 6)
  457. }
  458. if !_storage._mapFixed32Fixed32.isEmpty {
  459. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: _storage._mapFixed32Fixed32, fieldNumber: 7)
  460. }
  461. if !_storage._mapFixed64Fixed64.isEmpty {
  462. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: _storage._mapFixed64Fixed64, fieldNumber: 8)
  463. }
  464. if !_storage._mapSfixed32Sfixed32.isEmpty {
  465. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: _storage._mapSfixed32Sfixed32, fieldNumber: 9)
  466. }
  467. if !_storage._mapSfixed64Sfixed64.isEmpty {
  468. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: _storage._mapSfixed64Sfixed64, fieldNumber: 10)
  469. }
  470. if !_storage._mapInt32Float.isEmpty {
  471. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: _storage._mapInt32Float, fieldNumber: 11)
  472. }
  473. if !_storage._mapInt32Double.isEmpty {
  474. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: _storage._mapInt32Double, fieldNumber: 12)
  475. }
  476. if !_storage._mapBoolBool.isEmpty {
  477. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: _storage._mapBoolBool, fieldNumber: 13)
  478. }
  479. if !_storage._mapStringString.isEmpty {
  480. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: _storage._mapStringString, fieldNumber: 14)
  481. }
  482. if !_storage._mapInt32Bytes.isEmpty {
  483. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: _storage._mapInt32Bytes, fieldNumber: 15)
  484. }
  485. if !_storage._mapInt32Enum.isEmpty {
  486. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_MapEnum>.self, value: _storage._mapInt32Enum, fieldNumber: 16)
  487. }
  488. if !_storage._mapInt32ForeignMessage.isEmpty {
  489. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_ForeignMessage>.self, value: _storage._mapInt32ForeignMessage, fieldNumber: 17)
  490. }
  491. if !_storage._mapStringForeignMessage.isEmpty {
  492. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_ForeignMessage>.self, value: _storage._mapStringForeignMessage, fieldNumber: 18)
  493. }
  494. if !_storage._mapInt32AllTypes.isEmpty {
  495. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypes>.self, value: _storage._mapInt32AllTypes, fieldNumber: 19)
  496. }
  497. }
  498. try unknownFields.traverse(visitor: &visitor)
  499. }
  500. static func ==(lhs: Proto2Unittest_TestMap, rhs: Proto2Unittest_TestMap) -> Bool {
  501. if lhs._storage !== rhs._storage {
  502. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  503. let _storage = _args.0
  504. let rhs_storage = _args.1
  505. if _storage._mapInt32Int32 != rhs_storage._mapInt32Int32 {return false}
  506. if _storage._mapInt64Int64 != rhs_storage._mapInt64Int64 {return false}
  507. if _storage._mapUint32Uint32 != rhs_storage._mapUint32Uint32 {return false}
  508. if _storage._mapUint64Uint64 != rhs_storage._mapUint64Uint64 {return false}
  509. if _storage._mapSint32Sint32 != rhs_storage._mapSint32Sint32 {return false}
  510. if _storage._mapSint64Sint64 != rhs_storage._mapSint64Sint64 {return false}
  511. if _storage._mapFixed32Fixed32 != rhs_storage._mapFixed32Fixed32 {return false}
  512. if _storage._mapFixed64Fixed64 != rhs_storage._mapFixed64Fixed64 {return false}
  513. if _storage._mapSfixed32Sfixed32 != rhs_storage._mapSfixed32Sfixed32 {return false}
  514. if _storage._mapSfixed64Sfixed64 != rhs_storage._mapSfixed64Sfixed64 {return false}
  515. if _storage._mapInt32Float != rhs_storage._mapInt32Float {return false}
  516. if _storage._mapInt32Double != rhs_storage._mapInt32Double {return false}
  517. if _storage._mapBoolBool != rhs_storage._mapBoolBool {return false}
  518. if _storage._mapStringString != rhs_storage._mapStringString {return false}
  519. if _storage._mapInt32Bytes != rhs_storage._mapInt32Bytes {return false}
  520. if _storage._mapInt32Enum != rhs_storage._mapInt32Enum {return false}
  521. if _storage._mapInt32ForeignMessage != rhs_storage._mapInt32ForeignMessage {return false}
  522. if _storage._mapStringForeignMessage != rhs_storage._mapStringForeignMessage {return false}
  523. if _storage._mapInt32AllTypes != rhs_storage._mapInt32AllTypes {return false}
  524. return true
  525. }
  526. if !storagesAreEqual {return false}
  527. }
  528. if lhs.unknownFields != rhs.unknownFields {return false}
  529. return true
  530. }
  531. }
  532. extension Proto2Unittest_TestMapWithMessages: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  533. static let protoMessageName: String = _protobuf_package + ".TestMapWithMessages"
  534. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}map_int32_all_types\0\u{3}map_int64_all_types\0\u{3}map_uint32_all_types\0\u{3}map_uint64_all_types\0\u{3}map_sint32_all_types\0\u{3}map_sint64_all_types\0\u{3}map_fixed32_all_types\0\u{3}map_fixed64_all_types\0\u{3}map_sfixed32_all_types\0\u{3}map_sfixed64_all_types\0\u{3}map_bool_all_types\0\u{3}map_string_all_types\0")
  535. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  536. while let fieldNumber = try decoder.nextFieldNumber() {
  537. // The use of inline closures is to circumvent an issue where the compiler
  538. // allocates stack space for every case branch when no optimizations are
  539. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  540. switch fieldNumber {
  541. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypes>.self, value: &self.mapInt32AllTypes) }()
  542. case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt64,Proto2Unittest_TestAllTypes>.self, value: &self.mapInt64AllTypes) }()
  543. case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufUInt32,Proto2Unittest_TestAllTypes>.self, value: &self.mapUint32AllTypes) }()
  544. case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufUInt64,Proto2Unittest_TestAllTypes>.self, value: &self.mapUint64AllTypes) }()
  545. case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSInt32,Proto2Unittest_TestAllTypes>.self, value: &self.mapSint32AllTypes) }()
  546. case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSInt64,Proto2Unittest_TestAllTypes>.self, value: &self.mapSint64AllTypes) }()
  547. case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufFixed32,Proto2Unittest_TestAllTypes>.self, value: &self.mapFixed32AllTypes) }()
  548. case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufFixed64,Proto2Unittest_TestAllTypes>.self, value: &self.mapFixed64AllTypes) }()
  549. case 9: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSFixed32,Proto2Unittest_TestAllTypes>.self, value: &self.mapSfixed32AllTypes) }()
  550. case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSFixed64,Proto2Unittest_TestAllTypes>.self, value: &self.mapSfixed64AllTypes) }()
  551. case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufBool,Proto2Unittest_TestAllTypes>.self, value: &self.mapBoolAllTypes) }()
  552. case 12: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_TestAllTypes>.self, value: &self.mapStringAllTypes) }()
  553. default: break
  554. }
  555. }
  556. }
  557. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  558. if !self.mapInt32AllTypes.isEmpty {
  559. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypes>.self, value: self.mapInt32AllTypes, fieldNumber: 1)
  560. }
  561. if !self.mapInt64AllTypes.isEmpty {
  562. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt64,Proto2Unittest_TestAllTypes>.self, value: self.mapInt64AllTypes, fieldNumber: 2)
  563. }
  564. if !self.mapUint32AllTypes.isEmpty {
  565. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufUInt32,Proto2Unittest_TestAllTypes>.self, value: self.mapUint32AllTypes, fieldNumber: 3)
  566. }
  567. if !self.mapUint64AllTypes.isEmpty {
  568. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufUInt64,Proto2Unittest_TestAllTypes>.self, value: self.mapUint64AllTypes, fieldNumber: 4)
  569. }
  570. if !self.mapSint32AllTypes.isEmpty {
  571. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSInt32,Proto2Unittest_TestAllTypes>.self, value: self.mapSint32AllTypes, fieldNumber: 5)
  572. }
  573. if !self.mapSint64AllTypes.isEmpty {
  574. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSInt64,Proto2Unittest_TestAllTypes>.self, value: self.mapSint64AllTypes, fieldNumber: 6)
  575. }
  576. if !self.mapFixed32AllTypes.isEmpty {
  577. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufFixed32,Proto2Unittest_TestAllTypes>.self, value: self.mapFixed32AllTypes, fieldNumber: 7)
  578. }
  579. if !self.mapFixed64AllTypes.isEmpty {
  580. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufFixed64,Proto2Unittest_TestAllTypes>.self, value: self.mapFixed64AllTypes, fieldNumber: 8)
  581. }
  582. if !self.mapSfixed32AllTypes.isEmpty {
  583. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSFixed32,Proto2Unittest_TestAllTypes>.self, value: self.mapSfixed32AllTypes, fieldNumber: 9)
  584. }
  585. if !self.mapSfixed64AllTypes.isEmpty {
  586. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSFixed64,Proto2Unittest_TestAllTypes>.self, value: self.mapSfixed64AllTypes, fieldNumber: 10)
  587. }
  588. if !self.mapBoolAllTypes.isEmpty {
  589. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufBool,Proto2Unittest_TestAllTypes>.self, value: self.mapBoolAllTypes, fieldNumber: 11)
  590. }
  591. if !self.mapStringAllTypes.isEmpty {
  592. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_TestAllTypes>.self, value: self.mapStringAllTypes, fieldNumber: 12)
  593. }
  594. try unknownFields.traverse(visitor: &visitor)
  595. }
  596. static func ==(lhs: Proto2Unittest_TestMapWithMessages, rhs: Proto2Unittest_TestMapWithMessages) -> Bool {
  597. if lhs.mapInt32AllTypes != rhs.mapInt32AllTypes {return false}
  598. if lhs.mapInt64AllTypes != rhs.mapInt64AllTypes {return false}
  599. if lhs.mapUint32AllTypes != rhs.mapUint32AllTypes {return false}
  600. if lhs.mapUint64AllTypes != rhs.mapUint64AllTypes {return false}
  601. if lhs.mapSint32AllTypes != rhs.mapSint32AllTypes {return false}
  602. if lhs.mapSint64AllTypes != rhs.mapSint64AllTypes {return false}
  603. if lhs.mapFixed32AllTypes != rhs.mapFixed32AllTypes {return false}
  604. if lhs.mapFixed64AllTypes != rhs.mapFixed64AllTypes {return false}
  605. if lhs.mapSfixed32AllTypes != rhs.mapSfixed32AllTypes {return false}
  606. if lhs.mapSfixed64AllTypes != rhs.mapSfixed64AllTypes {return false}
  607. if lhs.mapBoolAllTypes != rhs.mapBoolAllTypes {return false}
  608. if lhs.mapStringAllTypes != rhs.mapStringAllTypes {return false}
  609. if lhs.unknownFields != rhs.unknownFields {return false}
  610. return true
  611. }
  612. }
  613. extension Proto2Unittest_TestMapSubmessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  614. static let protoMessageName: String = _protobuf_package + ".TestMapSubmessage"
  615. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}test_map\0")
  616. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  617. while let fieldNumber = try decoder.nextFieldNumber() {
  618. // The use of inline closures is to circumvent an issue where the compiler
  619. // allocates stack space for every case branch when no optimizations are
  620. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  621. switch fieldNumber {
  622. case 1: try { try decoder.decodeSingularMessageField(value: &self._testMap) }()
  623. default: break
  624. }
  625. }
  626. }
  627. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  628. // The use of inline closures is to circumvent an issue where the compiler
  629. // allocates stack space for every if/case branch local when no optimizations
  630. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  631. // https://github.com/apple/swift-protobuf/issues/1182
  632. try { if let v = self._testMap {
  633. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  634. } }()
  635. try unknownFields.traverse(visitor: &visitor)
  636. }
  637. static func ==(lhs: Proto2Unittest_TestMapSubmessage, rhs: Proto2Unittest_TestMapSubmessage) -> Bool {
  638. if lhs._testMap != rhs._testMap {return false}
  639. if lhs.unknownFields != rhs.unknownFields {return false}
  640. return true
  641. }
  642. }
  643. extension Proto2Unittest_TestMessageMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  644. static let protoMessageName: String = _protobuf_package + ".TestMessageMap"
  645. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}map_int32_message\0")
  646. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  647. while let fieldNumber = try decoder.nextFieldNumber() {
  648. // The use of inline closures is to circumvent an issue where the compiler
  649. // allocates stack space for every case branch when no optimizations are
  650. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  651. switch fieldNumber {
  652. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypes>.self, value: &self.mapInt32Message) }()
  653. default: break
  654. }
  655. }
  656. }
  657. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  658. if !self.mapInt32Message.isEmpty {
  659. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypes>.self, value: self.mapInt32Message, fieldNumber: 1)
  660. }
  661. try unknownFields.traverse(visitor: &visitor)
  662. }
  663. static func ==(lhs: Proto2Unittest_TestMessageMap, rhs: Proto2Unittest_TestMessageMap) -> Bool {
  664. if lhs.mapInt32Message != rhs.mapInt32Message {return false}
  665. if lhs.unknownFields != rhs.unknownFields {return false}
  666. return true
  667. }
  668. }
  669. extension Proto2Unittest_TestSameTypeMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  670. static let protoMessageName: String = _protobuf_package + ".TestSameTypeMap"
  671. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}map1\0\u{1}map2\0")
  672. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  673. while let fieldNumber = try decoder.nextFieldNumber() {
  674. // The use of inline closures is to circumvent an issue where the compiler
  675. // allocates stack space for every case branch when no optimizations are
  676. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  677. switch fieldNumber {
  678. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &self.map1) }()
  679. case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &self.map2) }()
  680. default: break
  681. }
  682. }
  683. }
  684. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  685. if !self.map1.isEmpty {
  686. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: self.map1, fieldNumber: 1)
  687. }
  688. if !self.map2.isEmpty {
  689. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: self.map2, fieldNumber: 2)
  690. }
  691. try unknownFields.traverse(visitor: &visitor)
  692. }
  693. static func ==(lhs: Proto2Unittest_TestSameTypeMap, rhs: Proto2Unittest_TestSameTypeMap) -> Bool {
  694. if lhs.map1 != rhs.map1 {return false}
  695. if lhs.map2 != rhs.map2 {return false}
  696. if lhs.unknownFields != rhs.unknownFields {return false}
  697. return true
  698. }
  699. }
  700. extension Proto2Unittest_TestRequiredMessageMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  701. static let protoMessageName: String = _protobuf_package + ".TestRequiredMessageMap"
  702. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}map_field\0")
  703. public var isInitialized: Bool {
  704. if !SwiftProtobuf.Internal.areAllInitialized(self.mapField) {return false}
  705. return true
  706. }
  707. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  708. while let fieldNumber = try decoder.nextFieldNumber() {
  709. // The use of inline closures is to circumvent an issue where the compiler
  710. // allocates stack space for every case branch when no optimizations are
  711. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  712. switch fieldNumber {
  713. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestRequired>.self, value: &self.mapField) }()
  714. default: break
  715. }
  716. }
  717. }
  718. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  719. if !self.mapField.isEmpty {
  720. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestRequired>.self, value: self.mapField, fieldNumber: 1)
  721. }
  722. try unknownFields.traverse(visitor: &visitor)
  723. }
  724. static func ==(lhs: Proto2Unittest_TestRequiredMessageMap, rhs: Proto2Unittest_TestRequiredMessageMap) -> Bool {
  725. if lhs.mapField != rhs.mapField {return false}
  726. if lhs.unknownFields != rhs.unknownFields {return false}
  727. return true
  728. }
  729. }
  730. extension Proto2Unittest_TestArenaMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  731. static let protoMessageName: String = _protobuf_package + ".TestArenaMap"
  732. 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")
  733. fileprivate class _StorageClass {
  734. var _mapInt32Int32: Dictionary<Int32,Int32> = [:]
  735. var _mapInt64Int64: Dictionary<Int64,Int64> = [:]
  736. var _mapUint32Uint32: Dictionary<UInt32,UInt32> = [:]
  737. var _mapUint64Uint64: Dictionary<UInt64,UInt64> = [:]
  738. var _mapSint32Sint32: Dictionary<Int32,Int32> = [:]
  739. var _mapSint64Sint64: Dictionary<Int64,Int64> = [:]
  740. var _mapFixed32Fixed32: Dictionary<UInt32,UInt32> = [:]
  741. var _mapFixed64Fixed64: Dictionary<UInt64,UInt64> = [:]
  742. var _mapSfixed32Sfixed32: Dictionary<Int32,Int32> = [:]
  743. var _mapSfixed64Sfixed64: Dictionary<Int64,Int64> = [:]
  744. var _mapInt32Float: Dictionary<Int32,Float> = [:]
  745. var _mapInt32Double: Dictionary<Int32,Double> = [:]
  746. var _mapBoolBool: Dictionary<Bool,Bool> = [:]
  747. var _mapStringString: Dictionary<String,String> = [:]
  748. var _mapInt32Bytes: Dictionary<Int32,Data> = [:]
  749. var _mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnum> = [:]
  750. var _mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessage> = [:]
  751. // This property is used as the initial default value for new instances of the type.
  752. // The type itself is protecting the reference to its storage via CoW semantics.
  753. // This will force a copy to be made of this reference when the first mutation occurs;
  754. // hence, it is safe to mark this as `nonisolated(unsafe)`.
  755. static nonisolated(unsafe) let defaultInstance = _StorageClass()
  756. private init() {}
  757. init(copying source: _StorageClass) {
  758. _mapInt32Int32 = source._mapInt32Int32
  759. _mapInt64Int64 = source._mapInt64Int64
  760. _mapUint32Uint32 = source._mapUint32Uint32
  761. _mapUint64Uint64 = source._mapUint64Uint64
  762. _mapSint32Sint32 = source._mapSint32Sint32
  763. _mapSint64Sint64 = source._mapSint64Sint64
  764. _mapFixed32Fixed32 = source._mapFixed32Fixed32
  765. _mapFixed64Fixed64 = source._mapFixed64Fixed64
  766. _mapSfixed32Sfixed32 = source._mapSfixed32Sfixed32
  767. _mapSfixed64Sfixed64 = source._mapSfixed64Sfixed64
  768. _mapInt32Float = source._mapInt32Float
  769. _mapInt32Double = source._mapInt32Double
  770. _mapBoolBool = source._mapBoolBool
  771. _mapStringString = source._mapStringString
  772. _mapInt32Bytes = source._mapInt32Bytes
  773. _mapInt32Enum = source._mapInt32Enum
  774. _mapInt32ForeignMessage = source._mapInt32ForeignMessage
  775. }
  776. }
  777. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  778. if !isKnownUniquelyReferenced(&_storage) {
  779. _storage = _StorageClass(copying: _storage)
  780. }
  781. return _storage
  782. }
  783. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  784. _ = _uniqueStorage()
  785. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  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._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &_storage._mapInt32Int32) }()
  792. case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: &_storage._mapInt64Int64) }()
  793. case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: &_storage._mapUint32Uint32) }()
  794. case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: &_storage._mapUint64Uint64) }()
  795. case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: &_storage._mapSint32Sint32) }()
  796. case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: &_storage._mapSint64Sint64) }()
  797. case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: &_storage._mapFixed32Fixed32) }()
  798. case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: &_storage._mapFixed64Fixed64) }()
  799. case 9: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: &_storage._mapSfixed32Sfixed32) }()
  800. case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: &_storage._mapSfixed64Sfixed64) }()
  801. case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: &_storage._mapInt32Float) }()
  802. case 12: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: &_storage._mapInt32Double) }()
  803. case 13: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: &_storage._mapBoolBool) }()
  804. case 14: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &_storage._mapStringString) }()
  805. case 15: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: &_storage._mapInt32Bytes) }()
  806. case 16: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_MapEnum>.self, value: &_storage._mapInt32Enum) }()
  807. case 17: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_ForeignMessage>.self, value: &_storage._mapInt32ForeignMessage) }()
  808. default: break
  809. }
  810. }
  811. }
  812. }
  813. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  814. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  815. if !_storage._mapInt32Int32.isEmpty {
  816. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: _storage._mapInt32Int32, fieldNumber: 1)
  817. }
  818. if !_storage._mapInt64Int64.isEmpty {
  819. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: _storage._mapInt64Int64, fieldNumber: 2)
  820. }
  821. if !_storage._mapUint32Uint32.isEmpty {
  822. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: _storage._mapUint32Uint32, fieldNumber: 3)
  823. }
  824. if !_storage._mapUint64Uint64.isEmpty {
  825. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: _storage._mapUint64Uint64, fieldNumber: 4)
  826. }
  827. if !_storage._mapSint32Sint32.isEmpty {
  828. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: _storage._mapSint32Sint32, fieldNumber: 5)
  829. }
  830. if !_storage._mapSint64Sint64.isEmpty {
  831. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: _storage._mapSint64Sint64, fieldNumber: 6)
  832. }
  833. if !_storage._mapFixed32Fixed32.isEmpty {
  834. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: _storage._mapFixed32Fixed32, fieldNumber: 7)
  835. }
  836. if !_storage._mapFixed64Fixed64.isEmpty {
  837. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: _storage._mapFixed64Fixed64, fieldNumber: 8)
  838. }
  839. if !_storage._mapSfixed32Sfixed32.isEmpty {
  840. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: _storage._mapSfixed32Sfixed32, fieldNumber: 9)
  841. }
  842. if !_storage._mapSfixed64Sfixed64.isEmpty {
  843. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: _storage._mapSfixed64Sfixed64, fieldNumber: 10)
  844. }
  845. if !_storage._mapInt32Float.isEmpty {
  846. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: _storage._mapInt32Float, fieldNumber: 11)
  847. }
  848. if !_storage._mapInt32Double.isEmpty {
  849. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: _storage._mapInt32Double, fieldNumber: 12)
  850. }
  851. if !_storage._mapBoolBool.isEmpty {
  852. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: _storage._mapBoolBool, fieldNumber: 13)
  853. }
  854. if !_storage._mapStringString.isEmpty {
  855. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: _storage._mapStringString, fieldNumber: 14)
  856. }
  857. if !_storage._mapInt32Bytes.isEmpty {
  858. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: _storage._mapInt32Bytes, fieldNumber: 15)
  859. }
  860. if !_storage._mapInt32Enum.isEmpty {
  861. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_MapEnum>.self, value: _storage._mapInt32Enum, fieldNumber: 16)
  862. }
  863. if !_storage._mapInt32ForeignMessage.isEmpty {
  864. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_ForeignMessage>.self, value: _storage._mapInt32ForeignMessage, fieldNumber: 17)
  865. }
  866. }
  867. try unknownFields.traverse(visitor: &visitor)
  868. }
  869. static func ==(lhs: Proto2Unittest_TestArenaMap, rhs: Proto2Unittest_TestArenaMap) -> Bool {
  870. if lhs._storage !== rhs._storage {
  871. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  872. let _storage = _args.0
  873. let rhs_storage = _args.1
  874. if _storage._mapInt32Int32 != rhs_storage._mapInt32Int32 {return false}
  875. if _storage._mapInt64Int64 != rhs_storage._mapInt64Int64 {return false}
  876. if _storage._mapUint32Uint32 != rhs_storage._mapUint32Uint32 {return false}
  877. if _storage._mapUint64Uint64 != rhs_storage._mapUint64Uint64 {return false}
  878. if _storage._mapSint32Sint32 != rhs_storage._mapSint32Sint32 {return false}
  879. if _storage._mapSint64Sint64 != rhs_storage._mapSint64Sint64 {return false}
  880. if _storage._mapFixed32Fixed32 != rhs_storage._mapFixed32Fixed32 {return false}
  881. if _storage._mapFixed64Fixed64 != rhs_storage._mapFixed64Fixed64 {return false}
  882. if _storage._mapSfixed32Sfixed32 != rhs_storage._mapSfixed32Sfixed32 {return false}
  883. if _storage._mapSfixed64Sfixed64 != rhs_storage._mapSfixed64Sfixed64 {return false}
  884. if _storage._mapInt32Float != rhs_storage._mapInt32Float {return false}
  885. if _storage._mapInt32Double != rhs_storage._mapInt32Double {return false}
  886. if _storage._mapBoolBool != rhs_storage._mapBoolBool {return false}
  887. if _storage._mapStringString != rhs_storage._mapStringString {return false}
  888. if _storage._mapInt32Bytes != rhs_storage._mapInt32Bytes {return false}
  889. if _storage._mapInt32Enum != rhs_storage._mapInt32Enum {return false}
  890. if _storage._mapInt32ForeignMessage != rhs_storage._mapInt32ForeignMessage {return false}
  891. return true
  892. }
  893. if !storagesAreEqual {return false}
  894. }
  895. if lhs.unknownFields != rhs.unknownFields {return false}
  896. return true
  897. }
  898. }
  899. extension Proto2Unittest_MessageContainingEnumCalledType: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  900. static let protoMessageName: String = _protobuf_package + ".MessageContainingEnumCalledType"
  901. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}type\0")
  902. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  903. while let fieldNumber = try decoder.nextFieldNumber() {
  904. // The use of inline closures is to circumvent an issue where the compiler
  905. // allocates stack space for every case branch when no optimizations are
  906. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  907. switch fieldNumber {
  908. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_MessageContainingEnumCalledType>.self, value: &self.type) }()
  909. default: break
  910. }
  911. }
  912. }
  913. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  914. if !self.type.isEmpty {
  915. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_MessageContainingEnumCalledType>.self, value: self.type, fieldNumber: 1)
  916. }
  917. try unknownFields.traverse(visitor: &visitor)
  918. }
  919. static func ==(lhs: Proto2Unittest_MessageContainingEnumCalledType, rhs: Proto2Unittest_MessageContainingEnumCalledType) -> Bool {
  920. if lhs.type != rhs.type {return false}
  921. if lhs.unknownFields != rhs.unknownFields {return false}
  922. return true
  923. }
  924. }
  925. extension Proto2Unittest_MessageContainingEnumCalledType.TypeEnum: SwiftProtobuf._ProtoNameProviding {
  926. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0TYPE_FOO\0")
  927. }
  928. extension Proto2Unittest_MessageContainingMapCalledEntry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  929. static let protoMessageName: String = _protobuf_package + ".MessageContainingMapCalledEntry"
  930. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}entry\0")
  931. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  932. while let fieldNumber = try decoder.nextFieldNumber() {
  933. // The use of inline closures is to circumvent an issue where the compiler
  934. // allocates stack space for every case branch when no optimizations are
  935. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  936. switch fieldNumber {
  937. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &self.entry) }()
  938. default: break
  939. }
  940. }
  941. }
  942. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  943. if !self.entry.isEmpty {
  944. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: self.entry, fieldNumber: 1)
  945. }
  946. try unknownFields.traverse(visitor: &visitor)
  947. }
  948. static func ==(lhs: Proto2Unittest_MessageContainingMapCalledEntry, rhs: Proto2Unittest_MessageContainingMapCalledEntry) -> Bool {
  949. if lhs.entry != rhs.entry {return false}
  950. if lhs.unknownFields != rhs.unknownFields {return false}
  951. return true
  952. }
  953. }
  954. extension Proto2Unittest_TestRecursiveMapMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  955. static let protoMessageName: String = _protobuf_package + ".TestRecursiveMapMessage"
  956. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}a\0")
  957. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  958. while let fieldNumber = try decoder.nextFieldNumber() {
  959. // The use of inline closures is to circumvent an issue where the compiler
  960. // allocates stack space for every case branch when no optimizations are
  961. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  962. switch fieldNumber {
  963. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_TestRecursiveMapMessage>.self, value: &self.a) }()
  964. default: break
  965. }
  966. }
  967. }
  968. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  969. if !self.a.isEmpty {
  970. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_TestRecursiveMapMessage>.self, value: self.a, fieldNumber: 1)
  971. }
  972. try unknownFields.traverse(visitor: &visitor)
  973. }
  974. static func ==(lhs: Proto2Unittest_TestRecursiveMapMessage, rhs: Proto2Unittest_TestRecursiveMapMessage) -> Bool {
  975. if lhs.a != rhs.a {return false}
  976. if lhs.unknownFields != rhs.unknownFields {return false}
  977. return true
  978. }
  979. }
  980. extension Proto2Unittest_TestI32StrMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  981. static let protoMessageName: String = _protobuf_package + ".TestI32StrMap"
  982. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}m_32_str\0")
  983. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  984. while let fieldNumber = try decoder.nextFieldNumber() {
  985. // The use of inline closures is to circumvent an issue where the compiler
  986. // allocates stack space for every case branch when no optimizations are
  987. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  988. switch fieldNumber {
  989. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufString>.self, value: &self.m32Str) }()
  990. default: break
  991. }
  992. }
  993. }
  994. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  995. if !self.m32Str.isEmpty {
  996. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufString>.self, value: self.m32Str, fieldNumber: 1)
  997. }
  998. try unknownFields.traverse(visitor: &visitor)
  999. }
  1000. static func ==(lhs: Proto2Unittest_TestI32StrMap, rhs: Proto2Unittest_TestI32StrMap) -> Bool {
  1001. if lhs.m32Str != rhs.m32Str {return false}
  1002. if lhs.unknownFields != rhs.unknownFields {return false}
  1003. return true
  1004. }
  1005. }