| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729 |
- // DO NOT EDIT.
- // swift-format-ignore-file
- // swiftlint:disable all
- //
- // Generated by the Swift generator plugin for the protocol buffer compiler.
- // Source: google/protobuf/unittest_delimited.proto
- //
- // For information on using the generated types, please see the documentation:
- // https://github.com/apple/swift-protobuf/
- 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
- }
- struct EditionsUnittest_LengthPrefixed: 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: Int32 {
- get {return _a ?? 0}
- set {_a = newValue}
- }
- /// Returns true if `a` has been explicitly set.
- var hasA: Bool {return self._a != nil}
- /// Clears the value of `a`. Subsequent reads from it will return its default value.
- mutating func clearA() {self._a = nil}
- var b: Int32 {
- get {return _b ?? 0}
- set {_b = newValue}
- }
- /// Returns true if `b` has been explicitly set.
- var hasB: Bool {return self._b != nil}
- /// Clears the value of `b`. Subsequent reads from it will return its default value.
- mutating func clearB() {self._b = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _a: Int32? = nil
- fileprivate var _b: Int32? = nil
- }
- struct EditionsUnittest_NotGroupLikeScope: 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: Int32 {
- get {return _a ?? 0}
- set {_a = newValue}
- }
- /// Returns true if `a` has been explicitly set.
- var hasA: Bool {return self._a != nil}
- /// Clears the value of `a`. Subsequent reads from it will return its default value.
- mutating func clearA() {self._a = nil}
- var b: Int32 {
- get {return _b ?? 0}
- set {_b = newValue}
- }
- /// Returns true if `b` has been explicitly set.
- var hasB: Bool {return self._b != nil}
- /// Clears the value of `b`. Subsequent reads from it will return its default value.
- mutating func clearB() {self._b = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _a: Int32? = nil
- fileprivate var _b: Int32? = nil
- }
- struct EditionsUnittest_GroupLikeFileScope: 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: Int32 {
- get {return _a ?? 0}
- set {_a = newValue}
- }
- /// Returns true if `a` has been explicitly set.
- var hasA: Bool {return self._a != nil}
- /// Clears the value of `a`. Subsequent reads from it will return its default value.
- mutating func clearA() {self._a = nil}
- var b: Int32 {
- get {return _b ?? 0}
- set {_b = newValue}
- }
- /// Returns true if `b` has been explicitly set.
- var hasB: Bool {return self._b != nil}
- /// Clears the value of `b`. Subsequent reads from it will return its default value.
- mutating func clearB() {self._b = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _a: Int32? = nil
- fileprivate var _b: Int32? = nil
- }
- struct EditionsUnittest_TestDelimited: SwiftProtobuf.ExtensibleMessage, @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.
- /// Non-delimited field that otherwise looks group-like.
- var lengthprefixed: EditionsUnittest_TestDelimited.LengthPrefixed {
- get {return _storage._lengthprefixed ?? EditionsUnittest_TestDelimited.LengthPrefixed()}
- set {_uniqueStorage()._lengthprefixed = newValue}
- }
- /// Returns true if `lengthprefixed` has been explicitly set.
- var hasLengthprefixed: Bool {return _storage._lengthprefixed != nil}
- /// Clears the value of `lengthprefixed`. Subsequent reads from it will return its default value.
- mutating func clearLengthprefixed() {_uniqueStorage()._lengthprefixed = nil}
- /// Nested field for nested tests.
- var nested: EditionsUnittest_TestDelimited {
- get {return _storage._nested ?? EditionsUnittest_TestDelimited()}
- set {_uniqueStorage()._nested = newValue}
- }
- /// Returns true if `nested` has been explicitly set.
- var hasNested: Bool {return _storage._nested != nil}
- /// Clears the value of `nested`. Subsequent reads from it will return its default value.
- mutating func clearNested() {_uniqueStorage()._nested = nil}
- /// Truly group-like field.
- var groupLike: EditionsUnittest_TestDelimited.GroupLike {
- get {return _storage._groupLike ?? EditionsUnittest_TestDelimited.GroupLike()}
- set {_uniqueStorage()._groupLike = newValue}
- }
- /// Returns true if `groupLike` has been explicitly set.
- var hasGroupLike: Bool {return _storage._groupLike != nil}
- /// Clears the value of `groupLike`. Subsequent reads from it will return its default value.
- mutating func clearGroupLike() {_uniqueStorage()._groupLike = nil}
- /// Delimited field that isn't group-like solely because of its name.
- var notgrouplike: EditionsUnittest_TestDelimited.GroupLike {
- get {return _storage._notgrouplike ?? EditionsUnittest_TestDelimited.GroupLike()}
- set {_uniqueStorage()._notgrouplike = newValue}
- }
- /// Returns true if `notgrouplike` has been explicitly set.
- var hasNotgrouplike: Bool {return _storage._notgrouplike != nil}
- /// Clears the value of `notgrouplike`. Subsequent reads from it will return its default value.
- mutating func clearNotgrouplike() {_uniqueStorage()._notgrouplike = nil}
- /// Delimited field that isn't group-like because of the scope of its type.
- var notgrouplikescope: EditionsUnittest_NotGroupLikeScope {
- get {return _storage._notgrouplikescope ?? EditionsUnittest_NotGroupLikeScope()}
- set {_uniqueStorage()._notgrouplikescope = newValue}
- }
- /// Returns true if `notgrouplikescope` has been explicitly set.
- var hasNotgrouplikescope: Bool {return _storage._notgrouplikescope != nil}
- /// Clears the value of `notgrouplikescope`. Subsequent reads from it will return its default value.
- mutating func clearNotgrouplikescope() {_uniqueStorage()._notgrouplikescope = nil}
- /// Delimited field that's grouplike except that it's an imported type.
- var messageimport: EditionsUnittest_MessageImport {
- get {return _storage._messageimport ?? EditionsUnittest_MessageImport()}
- set {_uniqueStorage()._messageimport = newValue}
- }
- /// Returns true if `messageimport` has been explicitly set.
- var hasMessageimport: Bool {return _storage._messageimport != nil}
- /// Clears the value of `messageimport`. Subsequent reads from it will return its default value.
- mutating func clearMessageimport() {_uniqueStorage()._messageimport = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- struct LengthPrefixed: 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: Int32 {
- get {return _a ?? 0}
- set {_a = newValue}
- }
- /// Returns true if `a` has been explicitly set.
- var hasA: Bool {return self._a != nil}
- /// Clears the value of `a`. Subsequent reads from it will return its default value.
- mutating func clearA() {self._a = nil}
- var b: Int32 {
- get {return _b ?? 0}
- set {_b = newValue}
- }
- /// Returns true if `b` has been explicitly set.
- var hasB: Bool {return self._b != nil}
- /// Clears the value of `b`. Subsequent reads from it will return its default value.
- mutating func clearB() {self._b = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _a: Int32? = nil
- fileprivate var _b: Int32? = nil
- }
- struct GroupLike: 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: Int32 {
- get {return _a ?? 0}
- set {_a = newValue}
- }
- /// Returns true if `a` has been explicitly set.
- var hasA: Bool {return self._a != nil}
- /// Clears the value of `a`. Subsequent reads from it will return its default value.
- mutating func clearA() {self._a = nil}
- var b: Int32 {
- get {return _b ?? 0}
- set {_b = newValue}
- }
- /// Returns true if `b` has been explicitly set.
- var hasB: Bool {return self._b != nil}
- /// Clears the value of `b`. Subsequent reads from it will return its default value.
- mutating func clearB() {self._b = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _a: Int32? = nil
- fileprivate var _b: Int32? = nil
- }
- init() {}
- var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet()
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- // MARK: - Extension support defined in unittest_delimited.proto.
- // MARK: - Extension Properties
- // Swift Extensions on the extended Messages to add easy access to the declared
- // extension fields. The names are based on the extension field name from the proto
- // declaration. To avoid naming collisions, the names are prefixed with the name of
- // the scope where the extend directive occurs.
- extension EditionsUnittest_TestDelimited {
- /// Non-delimited field that otherwise looks group-like.
- var EditionsUnittest_lengthprefixed: EditionsUnittest_LengthPrefixed {
- get {return getExtensionValue(ext: EditionsUnittest_Extensions_lengthprefixed) ?? EditionsUnittest_LengthPrefixed()}
- set {setExtensionValue(ext: EditionsUnittest_Extensions_lengthprefixed, value: newValue)}
- }
- /// Returns true if extension `EditionsUnittest_Extensions_lengthprefixed`
- /// has been explicitly set.
- var hasEditionsUnittest_lengthprefixed: Bool {
- return hasExtensionValue(ext: EditionsUnittest_Extensions_lengthprefixed)
- }
- /// Clears the value of extension `EditionsUnittest_Extensions_lengthprefixed`.
- /// Subsequent reads from it will return its default value.
- mutating func clearEditionsUnittest_lengthprefixed() {
- clearExtensionValue(ext: EditionsUnittest_Extensions_lengthprefixed)
- }
- /// Truly group-like extension.
- var EditionsUnittest_groupLikeFileScope: EditionsUnittest_GroupLikeFileScope {
- get {return getExtensionValue(ext: EditionsUnittest_Extensions_GroupLikeFileScope) ?? EditionsUnittest_GroupLikeFileScope()}
- set {setExtensionValue(ext: EditionsUnittest_Extensions_GroupLikeFileScope, value: newValue)}
- }
- /// Returns true if extension `EditionsUnittest_Extensions_GroupLikeFileScope`
- /// has been explicitly set.
- var hasEditionsUnittest_groupLikeFileScope: Bool {
- return hasExtensionValue(ext: EditionsUnittest_Extensions_GroupLikeFileScope)
- }
- /// Clears the value of extension `EditionsUnittest_Extensions_GroupLikeFileScope`.
- /// Subsequent reads from it will return its default value.
- mutating func clearEditionsUnittest_groupLikeFileScope() {
- clearExtensionValue(ext: EditionsUnittest_Extensions_GroupLikeFileScope)
- }
- /// Delimited extension that isn't group-like because of its name.
- var EditionsUnittest_notGroupLikeScope: EditionsUnittest_NotGroupLikeScope {
- get {return getExtensionValue(ext: EditionsUnittest_Extensions_not_group_like_scope) ?? EditionsUnittest_NotGroupLikeScope()}
- set {setExtensionValue(ext: EditionsUnittest_Extensions_not_group_like_scope, value: newValue)}
- }
- /// Returns true if extension `EditionsUnittest_Extensions_not_group_like_scope`
- /// has been explicitly set.
- var hasEditionsUnittest_notGroupLikeScope: Bool {
- return hasExtensionValue(ext: EditionsUnittest_Extensions_not_group_like_scope)
- }
- /// Clears the value of extension `EditionsUnittest_Extensions_not_group_like_scope`.
- /// Subsequent reads from it will return its default value.
- mutating func clearEditionsUnittest_notGroupLikeScope() {
- clearExtensionValue(ext: EditionsUnittest_Extensions_not_group_like_scope)
- }
- /// Delimited extension that isn't group-like because of the scope of its type.
- var EditionsUnittest_grouplike: EditionsUnittest_TestDelimited.GroupLike {
- get {return getExtensionValue(ext: EditionsUnittest_Extensions_grouplike) ?? EditionsUnittest_TestDelimited.GroupLike()}
- set {setExtensionValue(ext: EditionsUnittest_Extensions_grouplike, value: newValue)}
- }
- /// Returns true if extension `EditionsUnittest_Extensions_grouplike`
- /// has been explicitly set.
- var hasEditionsUnittest_grouplike: Bool {
- return hasExtensionValue(ext: EditionsUnittest_Extensions_grouplike)
- }
- /// Clears the value of extension `EditionsUnittest_Extensions_grouplike`.
- /// Subsequent reads from it will return its default value.
- mutating func clearEditionsUnittest_grouplike() {
- clearExtensionValue(ext: EditionsUnittest_Extensions_grouplike)
- }
- /// Delimited extension that's grouplike except that it's an imported type.
- var EditionsUnittest_messageimport: EditionsUnittest_MessageImport {
- get {return getExtensionValue(ext: EditionsUnittest_Extensions_messageimport) ?? EditionsUnittest_MessageImport()}
- set {setExtensionValue(ext: EditionsUnittest_Extensions_messageimport, value: newValue)}
- }
- /// Returns true if extension `EditionsUnittest_Extensions_messageimport`
- /// has been explicitly set.
- var hasEditionsUnittest_messageimport: Bool {
- return hasExtensionValue(ext: EditionsUnittest_Extensions_messageimport)
- }
- /// Clears the value of extension `EditionsUnittest_Extensions_messageimport`.
- /// Subsequent reads from it will return its default value.
- mutating func clearEditionsUnittest_messageimport() {
- clearExtensionValue(ext: EditionsUnittest_Extensions_messageimport)
- }
- }
- // MARK: - File's ExtensionMap: EditionsUnittest_UnittestDelimited_Extensions
- /// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by
- /// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed
- /// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create
- /// a larger `SwiftProtobuf.SimpleExtensionMap`.
- let EditionsUnittest_UnittestDelimited_Extensions: SwiftProtobuf.SimpleExtensionMap = [
- EditionsUnittest_Extensions_lengthprefixed,
- EditionsUnittest_Extensions_GroupLikeFileScope,
- EditionsUnittest_Extensions_not_group_like_scope,
- EditionsUnittest_Extensions_grouplike,
- EditionsUnittest_Extensions_messageimport
- ]
- // Extension Objects - The only reason these might be needed is when manually
- // constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_
- // accessors for the extension fields on the messages directly.
- /// Non-delimited field that otherwise looks group-like.
- let EditionsUnittest_Extensions_lengthprefixed = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalMessageExtensionField<EditionsUnittest_LengthPrefixed>, EditionsUnittest_TestDelimited>(
- _protobuf_fieldNumber: 1004,
- fieldName: "editions_unittest.lengthprefixed"
- )
- /// Truly group-like extension.
- let EditionsUnittest_Extensions_GroupLikeFileScope = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalGroupExtensionField<EditionsUnittest_GroupLikeFileScope>, EditionsUnittest_TestDelimited>(
- _protobuf_fieldNumber: 1000,
- fieldName: "editions_unittest.grouplikefilescope"
- )
- /// Delimited extension that isn't group-like because of its name.
- let EditionsUnittest_Extensions_not_group_like_scope = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalGroupExtensionField<EditionsUnittest_NotGroupLikeScope>, EditionsUnittest_TestDelimited>(
- _protobuf_fieldNumber: 1001,
- fieldName: "editions_unittest.not_group_like_scope"
- )
- /// Delimited extension that isn't group-like because of the scope of its type.
- let EditionsUnittest_Extensions_grouplike = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalGroupExtensionField<EditionsUnittest_TestDelimited.GroupLike>, EditionsUnittest_TestDelimited>(
- _protobuf_fieldNumber: 1002,
- fieldName: "editions_unittest.grouplike"
- )
- /// Delimited extension that's grouplike except that it's an imported type.
- let EditionsUnittest_Extensions_messageimport = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalGroupExtensionField<EditionsUnittest_MessageImport>, EditionsUnittest_TestDelimited>(
- _protobuf_fieldNumber: 1003,
- fieldName: "editions_unittest.messageimport"
- )
- // MARK: - Code below here is support for the SwiftProtobuf runtime.
- fileprivate let _protobuf_package = "editions_unittest"
- extension EditionsUnittest_LengthPrefixed: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".LengthPrefixed"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "a"),
- 2: .same(proto: "b"),
- ]
- 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.decodeSingularInt32Field(value: &self._a) }()
- case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
- 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._a {
- try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
- } }()
- try { if let v = self._b {
- try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
- } }()
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: EditionsUnittest_LengthPrefixed, rhs: EditionsUnittest_LengthPrefixed) -> Bool {
- if lhs._a != rhs._a {return false}
- if lhs._b != rhs._b {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension EditionsUnittest_NotGroupLikeScope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".NotGroupLikeScope"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "a"),
- 2: .same(proto: "b"),
- ]
- 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.decodeSingularInt32Field(value: &self._a) }()
- case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
- 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._a {
- try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
- } }()
- try { if let v = self._b {
- try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
- } }()
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: EditionsUnittest_NotGroupLikeScope, rhs: EditionsUnittest_NotGroupLikeScope) -> Bool {
- if lhs._a != rhs._a {return false}
- if lhs._b != rhs._b {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension EditionsUnittest_GroupLikeFileScope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".GroupLikeFileScope"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "a"),
- 2: .same(proto: "b"),
- ]
- 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.decodeSingularInt32Field(value: &self._a) }()
- case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
- 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._a {
- try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
- } }()
- try { if let v = self._b {
- try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
- } }()
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: EditionsUnittest_GroupLikeFileScope, rhs: EditionsUnittest_GroupLikeFileScope) -> Bool {
- if lhs._a != rhs._a {return false}
- if lhs._b != rhs._b {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension EditionsUnittest_TestDelimited: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestDelimited"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "lengthprefixed"),
- 2: .same(proto: "nested"),
- 3: .same(proto: "grouplike"),
- 3: .unique(proto: "GroupLike", json: "grouplike"),
- 4: .same(proto: "notgrouplike"),
- 5: .same(proto: "notgrouplikescope"),
- 6: .same(proto: "messageimport"),
- ]
- fileprivate class _StorageClass {
- var _lengthprefixed: EditionsUnittest_TestDelimited.LengthPrefixed? = nil
- var _nested: EditionsUnittest_TestDelimited? = nil
- var _groupLike: EditionsUnittest_TestDelimited.GroupLike? = nil
- var _notgrouplike: EditionsUnittest_TestDelimited.GroupLike? = nil
- var _notgrouplikescope: EditionsUnittest_NotGroupLikeScope? = nil
- var _messageimport: EditionsUnittest_MessageImport? = nil
- // 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) {
- _lengthprefixed = source._lengthprefixed
- _nested = source._nested
- _groupLike = source._groupLike
- _notgrouplike = source._notgrouplike
- _notgrouplikescope = source._notgrouplikescope
- _messageimport = source._messageimport
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- public var isInitialized: Bool {
- if !_protobuf_extensionFieldValues.isInitialized {return false}
- return withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if let v = _storage._nested, !v.isInitialized {return false}
- return true
- }
- }
- 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.decodeSingularMessageField(value: &_storage._lengthprefixed) }()
- case 2: try { try decoder.decodeSingularGroupField(value: &_storage._nested) }()
- case 3: try { try decoder.decodeSingularGroupField(value: &_storage._groupLike) }()
- case 4: try { try decoder.decodeSingularGroupField(value: &_storage._notgrouplike) }()
- case 5: try { try decoder.decodeSingularGroupField(value: &_storage._notgrouplikescope) }()
- case 6: try { try decoder.decodeSingularGroupField(value: &_storage._messageimport) }()
- case 1000..<536870912:
- try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: EditionsUnittest_TestDelimited.self, fieldNumber: fieldNumber) }()
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- // 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 = _storage._lengthprefixed {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- try { if let v = _storage._nested {
- try visitor.visitSingularGroupField(value: v, fieldNumber: 2)
- } }()
- try { if let v = _storage._groupLike {
- try visitor.visitSingularGroupField(value: v, fieldNumber: 3)
- } }()
- try { if let v = _storage._notgrouplike {
- try visitor.visitSingularGroupField(value: v, fieldNumber: 4)
- } }()
- try { if let v = _storage._notgrouplikescope {
- try visitor.visitSingularGroupField(value: v, fieldNumber: 5)
- } }()
- try { if let v = _storage._messageimport {
- try visitor.visitSingularGroupField(value: v, fieldNumber: 6)
- } }()
- try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: EditionsUnittest_TestDelimited, rhs: EditionsUnittest_TestDelimited) -> 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._lengthprefixed != rhs_storage._lengthprefixed {return false}
- if _storage._nested != rhs_storage._nested {return false}
- if _storage._groupLike != rhs_storage._groupLike {return false}
- if _storage._notgrouplike != rhs_storage._notgrouplike {return false}
- if _storage._notgrouplikescope != rhs_storage._notgrouplikescope {return false}
- if _storage._messageimport != rhs_storage._messageimport {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false}
- return true
- }
- }
- extension EditionsUnittest_TestDelimited.LengthPrefixed: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = EditionsUnittest_TestDelimited.protoMessageName + ".LengthPrefixed"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "a"),
- 2: .same(proto: "b"),
- ]
- 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.decodeSingularInt32Field(value: &self._a) }()
- case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
- 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._a {
- try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
- } }()
- try { if let v = self._b {
- try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
- } }()
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: EditionsUnittest_TestDelimited.LengthPrefixed, rhs: EditionsUnittest_TestDelimited.LengthPrefixed) -> Bool {
- if lhs._a != rhs._a {return false}
- if lhs._b != rhs._b {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension EditionsUnittest_TestDelimited.GroupLike: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = EditionsUnittest_TestDelimited.protoMessageName + ".GroupLike"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "a"),
- 2: .same(proto: "b"),
- ]
- 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.decodeSingularInt32Field(value: &self._a) }()
- case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
- 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._a {
- try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
- } }()
- try { if let v = self._b {
- try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
- } }()
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: EditionsUnittest_TestDelimited.GroupLike, rhs: EditionsUnittest_TestDelimited.GroupLike) -> Bool {
- if lhs._a != rhs._a {return false}
- if lhs._b != rhs._b {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
|