| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243 |
- // DO NOT EDIT.
- // swift-format-ignore-file
- // swiftlint:disable all
- //
- // Generated by the Swift generator plugin for the protocol buffer compiler.
- // Source: google/protobuf/map_unittest.proto
- //
- // For information on using the generated types, please see the documentation:
- // https://github.com/apple/swift-protobuf/
- // Protocol Buffers - Google's data interchange format
- // Copyright 2008 Google Inc. All rights reserved.
- //
- // Use of this source code is governed by a BSD-style
- // license that can be found in the LICENSE file or at
- // https://developers.google.com/open-source/licenses/bsd
- import Foundation
- import SwiftProtobuf
- // If the compiler emits an error on this type, it is because this file
- // was generated by a version of the `protoc` Swift plug-in that is
- // incompatible with the version of SwiftProtobuf to which you are linking.
- // Please ensure that you are building against the same version of the API
- // that was used to generate this file.
- fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
- struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
- typealias Version = _2
- }
- enum Proto2Unittest_MapEnum: SwiftProtobuf.Enum, Swift.CaseIterable {
- typealias RawValue = Int
- case foo // = 0
- case bar // = 1
- case baz // = 2
- case UNRECOGNIZED(Int)
- init() {
- self = .foo
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .foo
- case 1: self = .bar
- case 2: self = .baz
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .foo: return 0
- case .bar: return 1
- case .baz: return 2
- case .UNRECOGNIZED(let i): return i
- }
- }
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static let allCases: [Proto2Unittest_MapEnum] = [
- .foo,
- .bar,
- .baz,
- ]
- }
- /// Tests maps.
- struct Proto2Unittest_TestMap: @unchecked Sendable {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- var mapInt32Int32: Dictionary<Int32,Int32> {
- get {return _storage._mapInt32Int32}
- set {_uniqueStorage()._mapInt32Int32 = newValue}
- }
- var mapInt64Int64: Dictionary<Int64,Int64> {
- get {return _storage._mapInt64Int64}
- set {_uniqueStorage()._mapInt64Int64 = newValue}
- }
- var mapUint32Uint32: Dictionary<UInt32,UInt32> {
- get {return _storage._mapUint32Uint32}
- set {_uniqueStorage()._mapUint32Uint32 = newValue}
- }
- var mapUint64Uint64: Dictionary<UInt64,UInt64> {
- get {return _storage._mapUint64Uint64}
- set {_uniqueStorage()._mapUint64Uint64 = newValue}
- }
- var mapSint32Sint32: Dictionary<Int32,Int32> {
- get {return _storage._mapSint32Sint32}
- set {_uniqueStorage()._mapSint32Sint32 = newValue}
- }
- var mapSint64Sint64: Dictionary<Int64,Int64> {
- get {return _storage._mapSint64Sint64}
- set {_uniqueStorage()._mapSint64Sint64 = newValue}
- }
- var mapFixed32Fixed32: Dictionary<UInt32,UInt32> {
- get {return _storage._mapFixed32Fixed32}
- set {_uniqueStorage()._mapFixed32Fixed32 = newValue}
- }
- var mapFixed64Fixed64: Dictionary<UInt64,UInt64> {
- get {return _storage._mapFixed64Fixed64}
- set {_uniqueStorage()._mapFixed64Fixed64 = newValue}
- }
- var mapSfixed32Sfixed32: Dictionary<Int32,Int32> {
- get {return _storage._mapSfixed32Sfixed32}
- set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue}
- }
- var mapSfixed64Sfixed64: Dictionary<Int64,Int64> {
- get {return _storage._mapSfixed64Sfixed64}
- set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue}
- }
- var mapInt32Float: Dictionary<Int32,Float> {
- get {return _storage._mapInt32Float}
- set {_uniqueStorage()._mapInt32Float = newValue}
- }
- var mapInt32Double: Dictionary<Int32,Double> {
- get {return _storage._mapInt32Double}
- set {_uniqueStorage()._mapInt32Double = newValue}
- }
- var mapBoolBool: Dictionary<Bool,Bool> {
- get {return _storage._mapBoolBool}
- set {_uniqueStorage()._mapBoolBool = newValue}
- }
- var mapStringString: Dictionary<String,String> {
- get {return _storage._mapStringString}
- set {_uniqueStorage()._mapStringString = newValue}
- }
- var mapInt32Bytes: Dictionary<Int32,Data> {
- get {return _storage._mapInt32Bytes}
- set {_uniqueStorage()._mapInt32Bytes = newValue}
- }
- var mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnum> {
- get {return _storage._mapInt32Enum}
- set {_uniqueStorage()._mapInt32Enum = newValue}
- }
- var mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessage> {
- get {return _storage._mapInt32ForeignMessage}
- set {_uniqueStorage()._mapInt32ForeignMessage = newValue}
- }
- var mapStringForeignMessage: Dictionary<String,Proto2Unittest_ForeignMessage> {
- get {return _storage._mapStringForeignMessage}
- set {_uniqueStorage()._mapStringForeignMessage = newValue}
- }
- var mapInt32AllTypes: Dictionary<Int32,Proto2Unittest_TestAllTypes> {
- get {return _storage._mapInt32AllTypes}
- set {_uniqueStorage()._mapInt32AllTypes = newValue}
- }
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- struct Proto2Unittest_TestMapWithMessages: Sendable {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- var mapInt32AllTypes: Dictionary<Int32,Proto2Unittest_TestAllTypes> = [:]
- var mapInt64AllTypes: Dictionary<Int64,Proto2Unittest_TestAllTypes> = [:]
- var mapUint32AllTypes: Dictionary<UInt32,Proto2Unittest_TestAllTypes> = [:]
- var mapUint64AllTypes: Dictionary<UInt64,Proto2Unittest_TestAllTypes> = [:]
- var mapSint32AllTypes: Dictionary<Int32,Proto2Unittest_TestAllTypes> = [:]
- var mapSint64AllTypes: Dictionary<Int64,Proto2Unittest_TestAllTypes> = [:]
- var mapFixed32AllTypes: Dictionary<UInt32,Proto2Unittest_TestAllTypes> = [:]
- var mapFixed64AllTypes: Dictionary<UInt64,Proto2Unittest_TestAllTypes> = [:]
- var mapSfixed32AllTypes: Dictionary<Int32,Proto2Unittest_TestAllTypes> = [:]
- var mapSfixed64AllTypes: Dictionary<Int64,Proto2Unittest_TestAllTypes> = [:]
- var mapBoolAllTypes: Dictionary<Bool,Proto2Unittest_TestAllTypes> = [:]
- var mapStringAllTypes: Dictionary<String,Proto2Unittest_TestAllTypes> = [:]
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- struct Proto2Unittest_TestMapSubmessage: Sendable {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- var testMap: Proto2Unittest_TestMap {
- get {return _testMap ?? Proto2Unittest_TestMap()}
- set {_testMap = newValue}
- }
- /// Returns true if `testMap` has been explicitly set.
- var hasTestMap: Bool {return self._testMap != nil}
- /// Clears the value of `testMap`. Subsequent reads from it will return its default value.
- mutating func clearTestMap() {self._testMap = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _testMap: Proto2Unittest_TestMap? = nil
- }
- struct Proto2Unittest_TestMessageMap: Sendable {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- var mapInt32Message: Dictionary<Int32,Proto2Unittest_TestAllTypes> = [:]
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// Two map fields share the same entry default instance.
- struct Proto2Unittest_TestSameTypeMap: Sendable {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- var map1: Dictionary<Int32,Int32> = [:]
- var map2: Dictionary<Int32,Int32> = [:]
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// Test embedded message with required fields
- struct Proto2Unittest_TestRequiredMessageMap: Sendable {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- var mapField: Dictionary<Int32,Proto2Unittest_TestRequired> = [:]
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- struct Proto2Unittest_TestArenaMap: @unchecked Sendable {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- var mapInt32Int32: Dictionary<Int32,Int32> {
- get {return _storage._mapInt32Int32}
- set {_uniqueStorage()._mapInt32Int32 = newValue}
- }
- var mapInt64Int64: Dictionary<Int64,Int64> {
- get {return _storage._mapInt64Int64}
- set {_uniqueStorage()._mapInt64Int64 = newValue}
- }
- var mapUint32Uint32: Dictionary<UInt32,UInt32> {
- get {return _storage._mapUint32Uint32}
- set {_uniqueStorage()._mapUint32Uint32 = newValue}
- }
- var mapUint64Uint64: Dictionary<UInt64,UInt64> {
- get {return _storage._mapUint64Uint64}
- set {_uniqueStorage()._mapUint64Uint64 = newValue}
- }
- var mapSint32Sint32: Dictionary<Int32,Int32> {
- get {return _storage._mapSint32Sint32}
- set {_uniqueStorage()._mapSint32Sint32 = newValue}
- }
- var mapSint64Sint64: Dictionary<Int64,Int64> {
- get {return _storage._mapSint64Sint64}
- set {_uniqueStorage()._mapSint64Sint64 = newValue}
- }
- var mapFixed32Fixed32: Dictionary<UInt32,UInt32> {
- get {return _storage._mapFixed32Fixed32}
- set {_uniqueStorage()._mapFixed32Fixed32 = newValue}
- }
- var mapFixed64Fixed64: Dictionary<UInt64,UInt64> {
- get {return _storage._mapFixed64Fixed64}
- set {_uniqueStorage()._mapFixed64Fixed64 = newValue}
- }
- var mapSfixed32Sfixed32: Dictionary<Int32,Int32> {
- get {return _storage._mapSfixed32Sfixed32}
- set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue}
- }
- var mapSfixed64Sfixed64: Dictionary<Int64,Int64> {
- get {return _storage._mapSfixed64Sfixed64}
- set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue}
- }
- var mapInt32Float: Dictionary<Int32,Float> {
- get {return _storage._mapInt32Float}
- set {_uniqueStorage()._mapInt32Float = newValue}
- }
- var mapInt32Double: Dictionary<Int32,Double> {
- get {return _storage._mapInt32Double}
- set {_uniqueStorage()._mapInt32Double = newValue}
- }
- var mapBoolBool: Dictionary<Bool,Bool> {
- get {return _storage._mapBoolBool}
- set {_uniqueStorage()._mapBoolBool = newValue}
- }
- var mapStringString: Dictionary<String,String> {
- get {return _storage._mapStringString}
- set {_uniqueStorage()._mapStringString = newValue}
- }
- var mapInt32Bytes: Dictionary<Int32,Data> {
- get {return _storage._mapInt32Bytes}
- set {_uniqueStorage()._mapInt32Bytes = newValue}
- }
- var mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnum> {
- get {return _storage._mapInt32Enum}
- set {_uniqueStorage()._mapInt32Enum = newValue}
- }
- var mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessage> {
- get {return _storage._mapInt32ForeignMessage}
- set {_uniqueStorage()._mapInt32ForeignMessage = newValue}
- }
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- /// Previously, message containing enum called Type cannot be used as value of
- /// map field.
- struct Proto2Unittest_MessageContainingEnumCalledType: Sendable {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- var type: Dictionary<String,Proto2Unittest_MessageContainingEnumCalledType> = [:]
- var unknownFields = SwiftProtobuf.UnknownStorage()
- enum TypeEnum: SwiftProtobuf.Enum, Swift.CaseIterable {
- typealias RawValue = Int
- case foo // = 0
- case UNRECOGNIZED(Int)
- init() {
- self = .foo
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .foo
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .foo: return 0
- case .UNRECOGNIZED(let i): return i
- }
- }
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static let allCases: [Proto2Unittest_MessageContainingEnumCalledType.TypeEnum] = [
- .foo,
- ]
- }
- init() {}
- }
- /// Previously, message cannot contain map field called "entry".
- struct Proto2Unittest_MessageContainingMapCalledEntry: Sendable {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- var entry: Dictionary<Int32,Int32> = [:]
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- struct Proto2Unittest_TestRecursiveMapMessage: Sendable {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- var a: Dictionary<String,Proto2Unittest_TestRecursiveMapMessage> = [:]
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- struct Proto2Unittest_TestI32StrMap: Sendable {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- var m32Str: Dictionary<Int32,String> = [:]
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- // MARK: - Code below here is support for the SwiftProtobuf runtime.
- fileprivate let _protobuf_package = "proto2_unittest"
- extension Proto2Unittest_MapEnum: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "MAP_ENUM_FOO"),
- 1: .same(proto: "MAP_ENUM_BAR"),
- 2: .same(proto: "MAP_ENUM_BAZ"),
- ]
- }
- extension Proto2Unittest_TestMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestMap"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "map_int32_int32"),
- 2: .standard(proto: "map_int64_int64"),
- 3: .standard(proto: "map_uint32_uint32"),
- 4: .standard(proto: "map_uint64_uint64"),
- 5: .standard(proto: "map_sint32_sint32"),
- 6: .standard(proto: "map_sint64_sint64"),
- 7: .standard(proto: "map_fixed32_fixed32"),
- 8: .standard(proto: "map_fixed64_fixed64"),
- 9: .standard(proto: "map_sfixed32_sfixed32"),
- 10: .standard(proto: "map_sfixed64_sfixed64"),
- 11: .standard(proto: "map_int32_float"),
- 12: .standard(proto: "map_int32_double"),
- 13: .standard(proto: "map_bool_bool"),
- 14: .standard(proto: "map_string_string"),
- 15: .standard(proto: "map_int32_bytes"),
- 16: .standard(proto: "map_int32_enum"),
- 17: .standard(proto: "map_int32_foreign_message"),
- 18: .standard(proto: "map_string_foreign_message"),
- 19: .standard(proto: "map_int32_all_types"),
- ]
- fileprivate class _StorageClass {
- var _mapInt32Int32: Dictionary<Int32,Int32> = [:]
- var _mapInt64Int64: Dictionary<Int64,Int64> = [:]
- var _mapUint32Uint32: Dictionary<UInt32,UInt32> = [:]
- var _mapUint64Uint64: Dictionary<UInt64,UInt64> = [:]
- var _mapSint32Sint32: Dictionary<Int32,Int32> = [:]
- var _mapSint64Sint64: Dictionary<Int64,Int64> = [:]
- var _mapFixed32Fixed32: Dictionary<UInt32,UInt32> = [:]
- var _mapFixed64Fixed64: Dictionary<UInt64,UInt64> = [:]
- var _mapSfixed32Sfixed32: Dictionary<Int32,Int32> = [:]
- var _mapSfixed64Sfixed64: Dictionary<Int64,Int64> = [:]
- var _mapInt32Float: Dictionary<Int32,Float> = [:]
- var _mapInt32Double: Dictionary<Int32,Double> = [:]
- var _mapBoolBool: Dictionary<Bool,Bool> = [:]
- var _mapStringString: Dictionary<String,String> = [:]
- var _mapInt32Bytes: Dictionary<Int32,Data> = [:]
- var _mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnum> = [:]
- var _mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessage> = [:]
- var _mapStringForeignMessage: Dictionary<String,Proto2Unittest_ForeignMessage> = [:]
- var _mapInt32AllTypes: Dictionary<Int32,Proto2Unittest_TestAllTypes> = [:]
- // This property is used as the initial default value for new instances of the type.
- // The type itself is protecting the reference to its storage via CoW semantics.
- // This will force a copy to be made of this reference when the first mutation occurs;
- // hence, it is safe to mark this as `nonisolated(unsafe)`.
- static nonisolated(unsafe) let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _mapInt32Int32 = source._mapInt32Int32
- _mapInt64Int64 = source._mapInt64Int64
- _mapUint32Uint32 = source._mapUint32Uint32
- _mapUint64Uint64 = source._mapUint64Uint64
- _mapSint32Sint32 = source._mapSint32Sint32
- _mapSint64Sint64 = source._mapSint64Sint64
- _mapFixed32Fixed32 = source._mapFixed32Fixed32
- _mapFixed64Fixed64 = source._mapFixed64Fixed64
- _mapSfixed32Sfixed32 = source._mapSfixed32Sfixed32
- _mapSfixed64Sfixed64 = source._mapSfixed64Sfixed64
- _mapInt32Float = source._mapInt32Float
- _mapInt32Double = source._mapInt32Double
- _mapBoolBool = source._mapBoolBool
- _mapStringString = source._mapStringString
- _mapInt32Bytes = source._mapInt32Bytes
- _mapInt32Enum = source._mapInt32Enum
- _mapInt32ForeignMessage = source._mapInt32ForeignMessage
- _mapStringForeignMessage = source._mapStringForeignMessage
- _mapInt32AllTypes = source._mapInt32AllTypes
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &_storage._mapInt32Int32) }()
- case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: &_storage._mapInt64Int64) }()
- case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: &_storage._mapUint32Uint32) }()
- case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: &_storage._mapUint64Uint64) }()
- case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: &_storage._mapSint32Sint32) }()
- case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: &_storage._mapSint64Sint64) }()
- case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: &_storage._mapFixed32Fixed32) }()
- case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: &_storage._mapFixed64Fixed64) }()
- case 9: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: &_storage._mapSfixed32Sfixed32) }()
- case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: &_storage._mapSfixed64Sfixed64) }()
- case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: &_storage._mapInt32Float) }()
- case 12: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: &_storage._mapInt32Double) }()
- case 13: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: &_storage._mapBoolBool) }()
- case 14: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &_storage._mapStringString) }()
- case 15: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: &_storage._mapInt32Bytes) }()
- case 16: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_MapEnum>.self, value: &_storage._mapInt32Enum) }()
- case 17: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_ForeignMessage>.self, value: &_storage._mapInt32ForeignMessage) }()
- case 18: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_ForeignMessage>.self, value: &_storage._mapStringForeignMessage) }()
- case 19: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypes>.self, value: &_storage._mapInt32AllTypes) }()
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if !_storage._mapInt32Int32.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: _storage._mapInt32Int32, fieldNumber: 1)
- }
- if !_storage._mapInt64Int64.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: _storage._mapInt64Int64, fieldNumber: 2)
- }
- if !_storage._mapUint32Uint32.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: _storage._mapUint32Uint32, fieldNumber: 3)
- }
- if !_storage._mapUint64Uint64.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: _storage._mapUint64Uint64, fieldNumber: 4)
- }
- if !_storage._mapSint32Sint32.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: _storage._mapSint32Sint32, fieldNumber: 5)
- }
- if !_storage._mapSint64Sint64.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: _storage._mapSint64Sint64, fieldNumber: 6)
- }
- if !_storage._mapFixed32Fixed32.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: _storage._mapFixed32Fixed32, fieldNumber: 7)
- }
- if !_storage._mapFixed64Fixed64.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: _storage._mapFixed64Fixed64, fieldNumber: 8)
- }
- if !_storage._mapSfixed32Sfixed32.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: _storage._mapSfixed32Sfixed32, fieldNumber: 9)
- }
- if !_storage._mapSfixed64Sfixed64.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: _storage._mapSfixed64Sfixed64, fieldNumber: 10)
- }
- if !_storage._mapInt32Float.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: _storage._mapInt32Float, fieldNumber: 11)
- }
- if !_storage._mapInt32Double.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: _storage._mapInt32Double, fieldNumber: 12)
- }
- if !_storage._mapBoolBool.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: _storage._mapBoolBool, fieldNumber: 13)
- }
- if !_storage._mapStringString.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: _storage._mapStringString, fieldNumber: 14)
- }
- if !_storage._mapInt32Bytes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: _storage._mapInt32Bytes, fieldNumber: 15)
- }
- if !_storage._mapInt32Enum.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_MapEnum>.self, value: _storage._mapInt32Enum, fieldNumber: 16)
- }
- if !_storage._mapInt32ForeignMessage.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_ForeignMessage>.self, value: _storage._mapInt32ForeignMessage, fieldNumber: 17)
- }
- if !_storage._mapStringForeignMessage.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_ForeignMessage>.self, value: _storage._mapStringForeignMessage, fieldNumber: 18)
- }
- if !_storage._mapInt32AllTypes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypes>.self, value: _storage._mapInt32AllTypes, fieldNumber: 19)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Proto2Unittest_TestMap, rhs: Proto2Unittest_TestMap) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._mapInt32Int32 != rhs_storage._mapInt32Int32 {return false}
- if _storage._mapInt64Int64 != rhs_storage._mapInt64Int64 {return false}
- if _storage._mapUint32Uint32 != rhs_storage._mapUint32Uint32 {return false}
- if _storage._mapUint64Uint64 != rhs_storage._mapUint64Uint64 {return false}
- if _storage._mapSint32Sint32 != rhs_storage._mapSint32Sint32 {return false}
- if _storage._mapSint64Sint64 != rhs_storage._mapSint64Sint64 {return false}
- if _storage._mapFixed32Fixed32 != rhs_storage._mapFixed32Fixed32 {return false}
- if _storage._mapFixed64Fixed64 != rhs_storage._mapFixed64Fixed64 {return false}
- if _storage._mapSfixed32Sfixed32 != rhs_storage._mapSfixed32Sfixed32 {return false}
- if _storage._mapSfixed64Sfixed64 != rhs_storage._mapSfixed64Sfixed64 {return false}
- if _storage._mapInt32Float != rhs_storage._mapInt32Float {return false}
- if _storage._mapInt32Double != rhs_storage._mapInt32Double {return false}
- if _storage._mapBoolBool != rhs_storage._mapBoolBool {return false}
- if _storage._mapStringString != rhs_storage._mapStringString {return false}
- if _storage._mapInt32Bytes != rhs_storage._mapInt32Bytes {return false}
- if _storage._mapInt32Enum != rhs_storage._mapInt32Enum {return false}
- if _storage._mapInt32ForeignMessage != rhs_storage._mapInt32ForeignMessage {return false}
- if _storage._mapStringForeignMessage != rhs_storage._mapStringForeignMessage {return false}
- if _storage._mapInt32AllTypes != rhs_storage._mapInt32AllTypes {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Proto2Unittest_TestMapWithMessages: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestMapWithMessages"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "map_int32_all_types"),
- 2: .standard(proto: "map_int64_all_types"),
- 3: .standard(proto: "map_uint32_all_types"),
- 4: .standard(proto: "map_uint64_all_types"),
- 5: .standard(proto: "map_sint32_all_types"),
- 6: .standard(proto: "map_sint64_all_types"),
- 7: .standard(proto: "map_fixed32_all_types"),
- 8: .standard(proto: "map_fixed64_all_types"),
- 9: .standard(proto: "map_sfixed32_all_types"),
- 10: .standard(proto: "map_sfixed64_all_types"),
- 11: .standard(proto: "map_bool_all_types"),
- 12: .standard(proto: "map_string_all_types"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypes>.self, value: &self.mapInt32AllTypes) }()
- case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt64,Proto2Unittest_TestAllTypes>.self, value: &self.mapInt64AllTypes) }()
- case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufUInt32,Proto2Unittest_TestAllTypes>.self, value: &self.mapUint32AllTypes) }()
- case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufUInt64,Proto2Unittest_TestAllTypes>.self, value: &self.mapUint64AllTypes) }()
- case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSInt32,Proto2Unittest_TestAllTypes>.self, value: &self.mapSint32AllTypes) }()
- case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSInt64,Proto2Unittest_TestAllTypes>.self, value: &self.mapSint64AllTypes) }()
- case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufFixed32,Proto2Unittest_TestAllTypes>.self, value: &self.mapFixed32AllTypes) }()
- case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufFixed64,Proto2Unittest_TestAllTypes>.self, value: &self.mapFixed64AllTypes) }()
- case 9: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSFixed32,Proto2Unittest_TestAllTypes>.self, value: &self.mapSfixed32AllTypes) }()
- case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSFixed64,Proto2Unittest_TestAllTypes>.self, value: &self.mapSfixed64AllTypes) }()
- case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufBool,Proto2Unittest_TestAllTypes>.self, value: &self.mapBoolAllTypes) }()
- case 12: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_TestAllTypes>.self, value: &self.mapStringAllTypes) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.mapInt32AllTypes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypes>.self, value: self.mapInt32AllTypes, fieldNumber: 1)
- }
- if !self.mapInt64AllTypes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt64,Proto2Unittest_TestAllTypes>.self, value: self.mapInt64AllTypes, fieldNumber: 2)
- }
- if !self.mapUint32AllTypes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufUInt32,Proto2Unittest_TestAllTypes>.self, value: self.mapUint32AllTypes, fieldNumber: 3)
- }
- if !self.mapUint64AllTypes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufUInt64,Proto2Unittest_TestAllTypes>.self, value: self.mapUint64AllTypes, fieldNumber: 4)
- }
- if !self.mapSint32AllTypes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSInt32,Proto2Unittest_TestAllTypes>.self, value: self.mapSint32AllTypes, fieldNumber: 5)
- }
- if !self.mapSint64AllTypes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSInt64,Proto2Unittest_TestAllTypes>.self, value: self.mapSint64AllTypes, fieldNumber: 6)
- }
- if !self.mapFixed32AllTypes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufFixed32,Proto2Unittest_TestAllTypes>.self, value: self.mapFixed32AllTypes, fieldNumber: 7)
- }
- if !self.mapFixed64AllTypes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufFixed64,Proto2Unittest_TestAllTypes>.self, value: self.mapFixed64AllTypes, fieldNumber: 8)
- }
- if !self.mapSfixed32AllTypes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSFixed32,Proto2Unittest_TestAllTypes>.self, value: self.mapSfixed32AllTypes, fieldNumber: 9)
- }
- if !self.mapSfixed64AllTypes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufSFixed64,Proto2Unittest_TestAllTypes>.self, value: self.mapSfixed64AllTypes, fieldNumber: 10)
- }
- if !self.mapBoolAllTypes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufBool,Proto2Unittest_TestAllTypes>.self, value: self.mapBoolAllTypes, fieldNumber: 11)
- }
- if !self.mapStringAllTypes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_TestAllTypes>.self, value: self.mapStringAllTypes, fieldNumber: 12)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Proto2Unittest_TestMapWithMessages, rhs: Proto2Unittest_TestMapWithMessages) -> Bool {
- if lhs.mapInt32AllTypes != rhs.mapInt32AllTypes {return false}
- if lhs.mapInt64AllTypes != rhs.mapInt64AllTypes {return false}
- if lhs.mapUint32AllTypes != rhs.mapUint32AllTypes {return false}
- if lhs.mapUint64AllTypes != rhs.mapUint64AllTypes {return false}
- if lhs.mapSint32AllTypes != rhs.mapSint32AllTypes {return false}
- if lhs.mapSint64AllTypes != rhs.mapSint64AllTypes {return false}
- if lhs.mapFixed32AllTypes != rhs.mapFixed32AllTypes {return false}
- if lhs.mapFixed64AllTypes != rhs.mapFixed64AllTypes {return false}
- if lhs.mapSfixed32AllTypes != rhs.mapSfixed32AllTypes {return false}
- if lhs.mapSfixed64AllTypes != rhs.mapSfixed64AllTypes {return false}
- if lhs.mapBoolAllTypes != rhs.mapBoolAllTypes {return false}
- if lhs.mapStringAllTypes != rhs.mapStringAllTypes {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Proto2Unittest_TestMapSubmessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestMapSubmessage"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "test_map"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularMessageField(value: &self._testMap) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- try { if let v = self._testMap {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Proto2Unittest_TestMapSubmessage, rhs: Proto2Unittest_TestMapSubmessage) -> Bool {
- if lhs._testMap != rhs._testMap {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Proto2Unittest_TestMessageMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestMessageMap"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "map_int32_message"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypes>.self, value: &self.mapInt32Message) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.mapInt32Message.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestAllTypes>.self, value: self.mapInt32Message, fieldNumber: 1)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Proto2Unittest_TestMessageMap, rhs: Proto2Unittest_TestMessageMap) -> Bool {
- if lhs.mapInt32Message != rhs.mapInt32Message {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Proto2Unittest_TestSameTypeMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestSameTypeMap"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "map1"),
- 2: .same(proto: "map2"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &self.map1) }()
- case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &self.map2) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.map1.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: self.map1, fieldNumber: 1)
- }
- if !self.map2.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: self.map2, fieldNumber: 2)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Proto2Unittest_TestSameTypeMap, rhs: Proto2Unittest_TestSameTypeMap) -> Bool {
- if lhs.map1 != rhs.map1 {return false}
- if lhs.map2 != rhs.map2 {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Proto2Unittest_TestRequiredMessageMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestRequiredMessageMap"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "map_field"),
- ]
- public var isInitialized: Bool {
- if !SwiftProtobuf.Internal.areAllInitialized(self.mapField) {return false}
- return true
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestRequired>.self, value: &self.mapField) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.mapField.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_TestRequired>.self, value: self.mapField, fieldNumber: 1)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Proto2Unittest_TestRequiredMessageMap, rhs: Proto2Unittest_TestRequiredMessageMap) -> Bool {
- if lhs.mapField != rhs.mapField {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Proto2Unittest_TestArenaMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestArenaMap"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "map_int32_int32"),
- 2: .standard(proto: "map_int64_int64"),
- 3: .standard(proto: "map_uint32_uint32"),
- 4: .standard(proto: "map_uint64_uint64"),
- 5: .standard(proto: "map_sint32_sint32"),
- 6: .standard(proto: "map_sint64_sint64"),
- 7: .standard(proto: "map_fixed32_fixed32"),
- 8: .standard(proto: "map_fixed64_fixed64"),
- 9: .standard(proto: "map_sfixed32_sfixed32"),
- 10: .standard(proto: "map_sfixed64_sfixed64"),
- 11: .standard(proto: "map_int32_float"),
- 12: .standard(proto: "map_int32_double"),
- 13: .standard(proto: "map_bool_bool"),
- 14: .standard(proto: "map_string_string"),
- 15: .standard(proto: "map_int32_bytes"),
- 16: .standard(proto: "map_int32_enum"),
- 17: .standard(proto: "map_int32_foreign_message"),
- ]
- fileprivate class _StorageClass {
- var _mapInt32Int32: Dictionary<Int32,Int32> = [:]
- var _mapInt64Int64: Dictionary<Int64,Int64> = [:]
- var _mapUint32Uint32: Dictionary<UInt32,UInt32> = [:]
- var _mapUint64Uint64: Dictionary<UInt64,UInt64> = [:]
- var _mapSint32Sint32: Dictionary<Int32,Int32> = [:]
- var _mapSint64Sint64: Dictionary<Int64,Int64> = [:]
- var _mapFixed32Fixed32: Dictionary<UInt32,UInt32> = [:]
- var _mapFixed64Fixed64: Dictionary<UInt64,UInt64> = [:]
- var _mapSfixed32Sfixed32: Dictionary<Int32,Int32> = [:]
- var _mapSfixed64Sfixed64: Dictionary<Int64,Int64> = [:]
- var _mapInt32Float: Dictionary<Int32,Float> = [:]
- var _mapInt32Double: Dictionary<Int32,Double> = [:]
- var _mapBoolBool: Dictionary<Bool,Bool> = [:]
- var _mapStringString: Dictionary<String,String> = [:]
- var _mapInt32Bytes: Dictionary<Int32,Data> = [:]
- var _mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnum> = [:]
- var _mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessage> = [:]
- // This property is used as the initial default value for new instances of the type.
- // The type itself is protecting the reference to its storage via CoW semantics.
- // This will force a copy to be made of this reference when the first mutation occurs;
- // hence, it is safe to mark this as `nonisolated(unsafe)`.
- static nonisolated(unsafe) let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _mapInt32Int32 = source._mapInt32Int32
- _mapInt64Int64 = source._mapInt64Int64
- _mapUint32Uint32 = source._mapUint32Uint32
- _mapUint64Uint64 = source._mapUint64Uint64
- _mapSint32Sint32 = source._mapSint32Sint32
- _mapSint64Sint64 = source._mapSint64Sint64
- _mapFixed32Fixed32 = source._mapFixed32Fixed32
- _mapFixed64Fixed64 = source._mapFixed64Fixed64
- _mapSfixed32Sfixed32 = source._mapSfixed32Sfixed32
- _mapSfixed64Sfixed64 = source._mapSfixed64Sfixed64
- _mapInt32Float = source._mapInt32Float
- _mapInt32Double = source._mapInt32Double
- _mapBoolBool = source._mapBoolBool
- _mapStringString = source._mapStringString
- _mapInt32Bytes = source._mapInt32Bytes
- _mapInt32Enum = source._mapInt32Enum
- _mapInt32ForeignMessage = source._mapInt32ForeignMessage
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &_storage._mapInt32Int32) }()
- case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: &_storage._mapInt64Int64) }()
- case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: &_storage._mapUint32Uint32) }()
- case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: &_storage._mapUint64Uint64) }()
- case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: &_storage._mapSint32Sint32) }()
- case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: &_storage._mapSint64Sint64) }()
- case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: &_storage._mapFixed32Fixed32) }()
- case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: &_storage._mapFixed64Fixed64) }()
- case 9: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: &_storage._mapSfixed32Sfixed32) }()
- case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: &_storage._mapSfixed64Sfixed64) }()
- case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: &_storage._mapInt32Float) }()
- case 12: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: &_storage._mapInt32Double) }()
- case 13: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: &_storage._mapBoolBool) }()
- case 14: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &_storage._mapStringString) }()
- case 15: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: &_storage._mapInt32Bytes) }()
- case 16: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_MapEnum>.self, value: &_storage._mapInt32Enum) }()
- case 17: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_ForeignMessage>.self, value: &_storage._mapInt32ForeignMessage) }()
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if !_storage._mapInt32Int32.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: _storage._mapInt32Int32, fieldNumber: 1)
- }
- if !_storage._mapInt64Int64.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: _storage._mapInt64Int64, fieldNumber: 2)
- }
- if !_storage._mapUint32Uint32.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: _storage._mapUint32Uint32, fieldNumber: 3)
- }
- if !_storage._mapUint64Uint64.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: _storage._mapUint64Uint64, fieldNumber: 4)
- }
- if !_storage._mapSint32Sint32.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: _storage._mapSint32Sint32, fieldNumber: 5)
- }
- if !_storage._mapSint64Sint64.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: _storage._mapSint64Sint64, fieldNumber: 6)
- }
- if !_storage._mapFixed32Fixed32.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: _storage._mapFixed32Fixed32, fieldNumber: 7)
- }
- if !_storage._mapFixed64Fixed64.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: _storage._mapFixed64Fixed64, fieldNumber: 8)
- }
- if !_storage._mapSfixed32Sfixed32.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: _storage._mapSfixed32Sfixed32, fieldNumber: 9)
- }
- if !_storage._mapSfixed64Sfixed64.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: _storage._mapSfixed64Sfixed64, fieldNumber: 10)
- }
- if !_storage._mapInt32Float.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: _storage._mapInt32Float, fieldNumber: 11)
- }
- if !_storage._mapInt32Double.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: _storage._mapInt32Double, fieldNumber: 12)
- }
- if !_storage._mapBoolBool.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: _storage._mapBoolBool, fieldNumber: 13)
- }
- if !_storage._mapStringString.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: _storage._mapStringString, fieldNumber: 14)
- }
- if !_storage._mapInt32Bytes.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: _storage._mapInt32Bytes, fieldNumber: 15)
- }
- if !_storage._mapInt32Enum.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_MapEnum>.self, value: _storage._mapInt32Enum, fieldNumber: 16)
- }
- if !_storage._mapInt32ForeignMessage.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,Proto2Unittest_ForeignMessage>.self, value: _storage._mapInt32ForeignMessage, fieldNumber: 17)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Proto2Unittest_TestArenaMap, rhs: Proto2Unittest_TestArenaMap) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._mapInt32Int32 != rhs_storage._mapInt32Int32 {return false}
- if _storage._mapInt64Int64 != rhs_storage._mapInt64Int64 {return false}
- if _storage._mapUint32Uint32 != rhs_storage._mapUint32Uint32 {return false}
- if _storage._mapUint64Uint64 != rhs_storage._mapUint64Uint64 {return false}
- if _storage._mapSint32Sint32 != rhs_storage._mapSint32Sint32 {return false}
- if _storage._mapSint64Sint64 != rhs_storage._mapSint64Sint64 {return false}
- if _storage._mapFixed32Fixed32 != rhs_storage._mapFixed32Fixed32 {return false}
- if _storage._mapFixed64Fixed64 != rhs_storage._mapFixed64Fixed64 {return false}
- if _storage._mapSfixed32Sfixed32 != rhs_storage._mapSfixed32Sfixed32 {return false}
- if _storage._mapSfixed64Sfixed64 != rhs_storage._mapSfixed64Sfixed64 {return false}
- if _storage._mapInt32Float != rhs_storage._mapInt32Float {return false}
- if _storage._mapInt32Double != rhs_storage._mapInt32Double {return false}
- if _storage._mapBoolBool != rhs_storage._mapBoolBool {return false}
- if _storage._mapStringString != rhs_storage._mapStringString {return false}
- if _storage._mapInt32Bytes != rhs_storage._mapInt32Bytes {return false}
- if _storage._mapInt32Enum != rhs_storage._mapInt32Enum {return false}
- if _storage._mapInt32ForeignMessage != rhs_storage._mapInt32ForeignMessage {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Proto2Unittest_MessageContainingEnumCalledType: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".MessageContainingEnumCalledType"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "type"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_MessageContainingEnumCalledType>.self, value: &self.type) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.type.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_MessageContainingEnumCalledType>.self, value: self.type, fieldNumber: 1)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Proto2Unittest_MessageContainingEnumCalledType, rhs: Proto2Unittest_MessageContainingEnumCalledType) -> Bool {
- if lhs.type != rhs.type {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Proto2Unittest_MessageContainingEnumCalledType.TypeEnum: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "TYPE_FOO"),
- ]
- }
- extension Proto2Unittest_MessageContainingMapCalledEntry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".MessageContainingMapCalledEntry"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "entry"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &self.entry) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.entry.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: self.entry, fieldNumber: 1)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Proto2Unittest_MessageContainingMapCalledEntry, rhs: Proto2Unittest_MessageContainingMapCalledEntry) -> Bool {
- if lhs.entry != rhs.entry {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Proto2Unittest_TestRecursiveMapMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestRecursiveMapMessage"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "a"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_TestRecursiveMapMessage>.self, value: &self.a) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.a.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Proto2Unittest_TestRecursiveMapMessage>.self, value: self.a, fieldNumber: 1)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Proto2Unittest_TestRecursiveMapMessage, rhs: Proto2Unittest_TestRecursiveMapMessage) -> Bool {
- if lhs.a != rhs.a {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Proto2Unittest_TestI32StrMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestI32StrMap"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "m_32_str"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufString>.self, value: &self.m32Str) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.m32Str.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufString>.self, value: self.m32Str, fieldNumber: 1)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Proto2Unittest_TestI32StrMap, rhs: Proto2Unittest_TestI32StrMap) -> Bool {
- if lhs.m32Str != rhs.m32Str {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
|