| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172 |
- // 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 {_storage._mapInt32Int32}
- set {_uniqueStorage()._mapInt32Int32 = newValue}
- }
- var mapInt64Int64: Dictionary<Int64,Int64> {
- get {_storage._mapInt64Int64}
- set {_uniqueStorage()._mapInt64Int64 = newValue}
- }
- var mapUint32Uint32: Dictionary<UInt32,UInt32> {
- get {_storage._mapUint32Uint32}
- set {_uniqueStorage()._mapUint32Uint32 = newValue}
- }
- var mapUint64Uint64: Dictionary<UInt64,UInt64> {
- get {_storage._mapUint64Uint64}
- set {_uniqueStorage()._mapUint64Uint64 = newValue}
- }
- var mapSint32Sint32: Dictionary<Int32,Int32> {
- get {_storage._mapSint32Sint32}
- set {_uniqueStorage()._mapSint32Sint32 = newValue}
- }
- var mapSint64Sint64: Dictionary<Int64,Int64> {
- get {_storage._mapSint64Sint64}
- set {_uniqueStorage()._mapSint64Sint64 = newValue}
- }
- var mapFixed32Fixed32: Dictionary<UInt32,UInt32> {
- get {_storage._mapFixed32Fixed32}
- set {_uniqueStorage()._mapFixed32Fixed32 = newValue}
- }
- var mapFixed64Fixed64: Dictionary<UInt64,UInt64> {
- get {_storage._mapFixed64Fixed64}
- set {_uniqueStorage()._mapFixed64Fixed64 = newValue}
- }
- var mapSfixed32Sfixed32: Dictionary<Int32,Int32> {
- get {_storage._mapSfixed32Sfixed32}
- set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue}
- }
- var mapSfixed64Sfixed64: Dictionary<Int64,Int64> {
- get {_storage._mapSfixed64Sfixed64}
- set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue}
- }
- var mapInt32Float: Dictionary<Int32,Float> {
- get {_storage._mapInt32Float}
- set {_uniqueStorage()._mapInt32Float = newValue}
- }
- var mapInt32Double: Dictionary<Int32,Double> {
- get {_storage._mapInt32Double}
- set {_uniqueStorage()._mapInt32Double = newValue}
- }
- var mapBoolBool: Dictionary<Bool,Bool> {
- get {_storage._mapBoolBool}
- set {_uniqueStorage()._mapBoolBool = newValue}
- }
- var mapStringString: Dictionary<String,String> {
- get {_storage._mapStringString}
- set {_uniqueStorage()._mapStringString = newValue}
- }
- var mapInt32Bytes: Dictionary<Int32,Data> {
- get {_storage._mapInt32Bytes}
- set {_uniqueStorage()._mapInt32Bytes = newValue}
- }
- var mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnum> {
- get {_storage._mapInt32Enum}
- set {_uniqueStorage()._mapInt32Enum = newValue}
- }
- var mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessage> {
- get {_storage._mapInt32ForeignMessage}
- set {_uniqueStorage()._mapInt32ForeignMessage = newValue}
- }
- var mapStringForeignMessage: Dictionary<String,Proto2Unittest_ForeignMessage> {
- get {_storage._mapStringForeignMessage}
- set {_uniqueStorage()._mapStringForeignMessage = newValue}
- }
- /// Caveat emptor: be careful adding new fields here.
- /// The TestMap proto is used to generate additional tests and couples tightly
- /// with map_test_util.h, which in turn couples tightly with TestMapLite.
- var mapInt32AllTypes: Dictionary<Int32,Proto2Unittest_TestAllTypes> {
- get {_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 {_testMap ?? Proto2Unittest_TestMap()}
- set {_testMap = newValue}
- }
- /// Returns true if `testMap` has been explicitly set.
- var hasTestMap: Bool {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 {_storage._mapInt32Int32}
- set {_uniqueStorage()._mapInt32Int32 = newValue}
- }
- var mapInt64Int64: Dictionary<Int64,Int64> {
- get {_storage._mapInt64Int64}
- set {_uniqueStorage()._mapInt64Int64 = newValue}
- }
- var mapUint32Uint32: Dictionary<UInt32,UInt32> {
- get {_storage._mapUint32Uint32}
- set {_uniqueStorage()._mapUint32Uint32 = newValue}
- }
- var mapUint64Uint64: Dictionary<UInt64,UInt64> {
- get {_storage._mapUint64Uint64}
- set {_uniqueStorage()._mapUint64Uint64 = newValue}
- }
- var mapSint32Sint32: Dictionary<Int32,Int32> {
- get {_storage._mapSint32Sint32}
- set {_uniqueStorage()._mapSint32Sint32 = newValue}
- }
- var mapSint64Sint64: Dictionary<Int64,Int64> {
- get {_storage._mapSint64Sint64}
- set {_uniqueStorage()._mapSint64Sint64 = newValue}
- }
- var mapFixed32Fixed32: Dictionary<UInt32,UInt32> {
- get {_storage._mapFixed32Fixed32}
- set {_uniqueStorage()._mapFixed32Fixed32 = newValue}
- }
- var mapFixed64Fixed64: Dictionary<UInt64,UInt64> {
- get {_storage._mapFixed64Fixed64}
- set {_uniqueStorage()._mapFixed64Fixed64 = newValue}
- }
- var mapSfixed32Sfixed32: Dictionary<Int32,Int32> {
- get {_storage._mapSfixed32Sfixed32}
- set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue}
- }
- var mapSfixed64Sfixed64: Dictionary<Int64,Int64> {
- get {_storage._mapSfixed64Sfixed64}
- set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue}
- }
- var mapInt32Float: Dictionary<Int32,Float> {
- get {_storage._mapInt32Float}
- set {_uniqueStorage()._mapInt32Float = newValue}
- }
- var mapInt32Double: Dictionary<Int32,Double> {
- get {_storage._mapInt32Double}
- set {_uniqueStorage()._mapInt32Double = newValue}
- }
- var mapBoolBool: Dictionary<Bool,Bool> {
- get {_storage._mapBoolBool}
- set {_uniqueStorage()._mapBoolBool = newValue}
- }
- var mapStringString: Dictionary<String,String> {
- get {_storage._mapStringString}
- set {_uniqueStorage()._mapStringString = newValue}
- }
- var mapInt32Bytes: Dictionary<Int32,Data> {
- get {_storage._mapInt32Bytes}
- set {_uniqueStorage()._mapInt32Bytes = newValue}
- }
- var mapInt32Enum: Dictionary<Int32,Proto2Unittest_MapEnum> {
- get {_storage._mapInt32Enum}
- set {_uniqueStorage()._mapInt32Enum = newValue}
- }
- var mapInt32ForeignMessage: Dictionary<Int32,Proto2Unittest_ForeignMessage> {
- get {_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(bytecode: "\0\u{2}\0MAP_ENUM_FOO\0\u{1}MAP_ENUM_BAR\0\u{1}MAP_ENUM_BAZ\0")
- }
- extension Proto2Unittest_TestMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestMap"
- 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")
- 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(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")
- 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(bytecode: "\0\u{3}test_map\0")
- 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(bytecode: "\0\u{3}map_int32_message\0")
- 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(bytecode: "\0\u{1}map1\0\u{1}map2\0")
- 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(bytecode: "\0\u{3}map_field\0")
- 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(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")
- 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(bytecode: "\0\u{1}type\0")
- 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(bytecode: "\0\u{2}\0TYPE_FOO\0")
- }
- extension Proto2Unittest_MessageContainingMapCalledEntry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".MessageContainingMapCalledEntry"
- static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}entry\0")
- 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(bytecode: "\0\u{1}a\0")
- 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(bytecode: "\0\u{3}m_32_str\0")
- 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
- }
- }
|