| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435 |
- // DO NOT EDIT.
- // swift-format-ignore-file
- // swiftlint:disable all
- //
- // Generated by the Swift generator plugin for the protocol buffer compiler.
- // Source: unittest_swift_cycle.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 2015 Google Inc. All rights reserved.
- //
- // Redistribution and use in source and binary forms, with or without
- // modification, are permitted provided that the following conditions are
- // met:
- //
- // * Redistributions of source code must retain the above copyright
- // notice, this list of conditions and the following disclaimer.
- // * Redistributions in binary form must reproduce the above
- // copyright notice, this list of conditions and the following disclaimer
- // in the documentation and/or other materials provided with the
- // distribution.
- // * Neither the name of Google Inc. nor the names of its
- // contributors may be used to endorse or promote products derived from
- // this software without specific prior written permission.
- //
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- 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 SwiftProtoTesting_CycleFoo: @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 aFoo: SwiftProtoTesting_CycleFoo {
- get {return _storage._aFoo ?? SwiftProtoTesting_CycleFoo()}
- set {_uniqueStorage()._aFoo = newValue}
- }
- /// Returns true if `aFoo` has been explicitly set.
- var hasAFoo: Bool {return _storage._aFoo != nil}
- /// Clears the value of `aFoo`. Subsequent reads from it will return its default value.
- mutating func clearAFoo() {_uniqueStorage()._aFoo = nil}
- var aBar: SwiftProtoTesting_CycleBar {
- get {return _storage._aBar ?? SwiftProtoTesting_CycleBar()}
- set {_uniqueStorage()._aBar = newValue}
- }
- /// Returns true if `aBar` has been explicitly set.
- var hasABar: Bool {return _storage._aBar != nil}
- /// Clears the value of `aBar`. Subsequent reads from it will return its default value.
- mutating func clearABar() {_uniqueStorage()._aBar = nil}
- var aBaz: SwiftProtoTesting_CycleBaz {
- get {return _storage._aBaz ?? SwiftProtoTesting_CycleBaz()}
- set {_uniqueStorage()._aBaz = newValue}
- }
- /// Returns true if `aBaz` has been explicitly set.
- var hasABaz: Bool {return _storage._aBaz != nil}
- /// Clears the value of `aBaz`. Subsequent reads from it will return its default value.
- mutating func clearABaz() {_uniqueStorage()._aBaz = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- struct SwiftProtoTesting_CycleBar: @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 aBar: SwiftProtoTesting_CycleBar {
- get {return _storage._aBar ?? SwiftProtoTesting_CycleBar()}
- set {_uniqueStorage()._aBar = newValue}
- }
- /// Returns true if `aBar` has been explicitly set.
- var hasABar: Bool {return _storage._aBar != nil}
- /// Clears the value of `aBar`. Subsequent reads from it will return its default value.
- mutating func clearABar() {_uniqueStorage()._aBar = nil}
- var aBaz: SwiftProtoTesting_CycleBaz {
- get {return _storage._aBaz ?? SwiftProtoTesting_CycleBaz()}
- set {_uniqueStorage()._aBaz = newValue}
- }
- /// Returns true if `aBaz` has been explicitly set.
- var hasABaz: Bool {return _storage._aBaz != nil}
- /// Clears the value of `aBaz`. Subsequent reads from it will return its default value.
- mutating func clearABaz() {_uniqueStorage()._aBaz = nil}
- var aFoo: SwiftProtoTesting_CycleFoo {
- get {return _storage._aFoo ?? SwiftProtoTesting_CycleFoo()}
- set {_uniqueStorage()._aFoo = newValue}
- }
- /// Returns true if `aFoo` has been explicitly set.
- var hasAFoo: Bool {return _storage._aFoo != nil}
- /// Clears the value of `aFoo`. Subsequent reads from it will return its default value.
- mutating func clearAFoo() {_uniqueStorage()._aFoo = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- struct SwiftProtoTesting_CycleBaz: @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 aBaz: SwiftProtoTesting_CycleBaz {
- get {return _storage._aBaz ?? SwiftProtoTesting_CycleBaz()}
- set {_uniqueStorage()._aBaz = newValue}
- }
- /// Returns true if `aBaz` has been explicitly set.
- var hasABaz: Bool {return _storage._aBaz != nil}
- /// Clears the value of `aBaz`. Subsequent reads from it will return its default value.
- mutating func clearABaz() {_uniqueStorage()._aBaz = nil}
- var aFoo: SwiftProtoTesting_CycleFoo {
- get {return _storage._aFoo ?? SwiftProtoTesting_CycleFoo()}
- set {_uniqueStorage()._aFoo = newValue}
- }
- /// Returns true if `aFoo` has been explicitly set.
- var hasAFoo: Bool {return _storage._aFoo != nil}
- /// Clears the value of `aFoo`. Subsequent reads from it will return its default value.
- mutating func clearAFoo() {_uniqueStorage()._aFoo = nil}
- var aBar: SwiftProtoTesting_CycleBar {
- get {return _storage._aBar ?? SwiftProtoTesting_CycleBar()}
- set {_uniqueStorage()._aBar = newValue}
- }
- /// Returns true if `aBar` has been explicitly set.
- var hasABar: Bool {return _storage._aBar != nil}
- /// Clears the value of `aBar`. Subsequent reads from it will return its default value.
- mutating func clearABar() {_uniqueStorage()._aBar = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- // MARK: - Code below here is support for the SwiftProtobuf runtime.
- fileprivate let _protobuf_package = "swift_proto_testing"
- extension SwiftProtoTesting_CycleFoo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".CycleFoo"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "a_foo"),
- 2: .standard(proto: "a_bar"),
- 3: .standard(proto: "a_baz"),
- ]
- fileprivate class _StorageClass {
- var _aFoo: SwiftProtoTesting_CycleFoo? = nil
- var _aBar: SwiftProtoTesting_CycleBar? = nil
- var _aBaz: SwiftProtoTesting_CycleBaz? = 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) {
- _aFoo = source._aFoo
- _aBar = source._aBar
- _aBaz = source._aBaz
- }
- }
- 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.decodeSingularMessageField(value: &_storage._aFoo) }()
- case 2: try { try decoder.decodeSingularMessageField(value: &_storage._aBar) }()
- case 3: try { try decoder.decodeSingularMessageField(value: &_storage._aBaz) }()
- 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._aFoo {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- try { if let v = _storage._aBar {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
- } }()
- try { if let v = _storage._aBaz {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
- } }()
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: SwiftProtoTesting_CycleFoo, rhs: SwiftProtoTesting_CycleFoo) -> 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._aFoo != rhs_storage._aFoo {return false}
- if _storage._aBar != rhs_storage._aBar {return false}
- if _storage._aBaz != rhs_storage._aBaz {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension SwiftProtoTesting_CycleBar: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".CycleBar"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "a_bar"),
- 2: .standard(proto: "a_baz"),
- 3: .standard(proto: "a_foo"),
- ]
- fileprivate class _StorageClass {
- var _aBar: SwiftProtoTesting_CycleBar? = nil
- var _aBaz: SwiftProtoTesting_CycleBaz? = nil
- var _aFoo: SwiftProtoTesting_CycleFoo? = 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) {
- _aBar = source._aBar
- _aBaz = source._aBaz
- _aFoo = source._aFoo
- }
- }
- 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.decodeSingularMessageField(value: &_storage._aBar) }()
- case 2: try { try decoder.decodeSingularMessageField(value: &_storage._aBaz) }()
- case 3: try { try decoder.decodeSingularMessageField(value: &_storage._aFoo) }()
- 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._aBar {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- try { if let v = _storage._aBaz {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
- } }()
- try { if let v = _storage._aFoo {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
- } }()
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: SwiftProtoTesting_CycleBar, rhs: SwiftProtoTesting_CycleBar) -> 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._aBar != rhs_storage._aBar {return false}
- if _storage._aBaz != rhs_storage._aBaz {return false}
- if _storage._aFoo != rhs_storage._aFoo {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension SwiftProtoTesting_CycleBaz: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".CycleBaz"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "a_baz"),
- 2: .standard(proto: "a_foo"),
- 3: .standard(proto: "a_bar"),
- ]
- fileprivate class _StorageClass {
- var _aBaz: SwiftProtoTesting_CycleBaz? = nil
- var _aFoo: SwiftProtoTesting_CycleFoo? = nil
- var _aBar: SwiftProtoTesting_CycleBar? = 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) {
- _aBaz = source._aBaz
- _aFoo = source._aFoo
- _aBar = source._aBar
- }
- }
- 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.decodeSingularMessageField(value: &_storage._aBaz) }()
- case 2: try { try decoder.decodeSingularMessageField(value: &_storage._aFoo) }()
- case 3: try { try decoder.decodeSingularMessageField(value: &_storage._aBar) }()
- 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._aBaz {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- try { if let v = _storage._aFoo {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
- } }()
- try { if let v = _storage._aBar {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
- } }()
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: SwiftProtoTesting_CycleBaz, rhs: SwiftProtoTesting_CycleBaz) -> 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._aBaz != rhs_storage._aBaz {return false}
- if _storage._aFoo != rhs_storage._aFoo {return false}
- if _storage._aBar != rhs_storage._aBar {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
|