| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- // DO NOT EDIT.
- // swift-format-ignore-file
- // swiftlint:disable all
- //
- // Generated by the Swift generator plugin for the protocol buffer compiler.
- // Source: Tests/Test1/uses_a_transitively.proto
- //
- // For information on using the generated types, please see the documentation:
- // https://github.com/apple/swift-protobuf/
- import SwiftProtobuf
- import ImportsAPublicly
- // 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
- }
- public struct UsesATransitively: 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.
- public var a: ModuleA.A {
- get {_a ?? ModuleA.A()}
- set {_a = newValue}
- }
- /// Returns true if `a` has been explicitly set.
- public var hasA: Bool {self._a != nil}
- /// Clears the value of `a`. Subsequent reads from it will return its default value.
- public mutating func clearA() {self._a = nil}
- public var e: ModuleA.E {
- get {_e ?? .unset}
- set {_e = newValue}
- }
- /// Returns true if `e` has been explicitly set.
- public var hasE: Bool {self._e != nil}
- /// Clears the value of `e`. Subsequent reads from it will return its default value.
- public mutating func clearE() {self._e = nil}
- public var unknownFields = SwiftProtobuf.UnknownStorage()
- public init() {}
- fileprivate var _a: ModuleA.A? = nil
- fileprivate var _e: ModuleA.E? = nil
- }
- // MARK: - Code below here is support for the SwiftProtobuf runtime.
- extension UsesATransitively: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- public static let protoMessageName: String = "UsesATransitively"
- public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}e\u{1}a\0\u{1}e\0")
- public var isInitialized: Bool {
- if let v = self._a, !v.isInitialized {return false}
- return true
- }
- public 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 101: try { try decoder.decodeSingularMessageField(value: &self._a) }()
- case 102: try { try decoder.decodeSingularEnumField(value: &self._e) }()
- default: break
- }
- }
- }
- public 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.visitSingularMessageField(value: v, fieldNumber: 101)
- } }()
- try { if let v = self._e {
- try visitor.visitSingularEnumField(value: v, fieldNumber: 102)
- } }()
- try unknownFields.traverse(visitor: &visitor)
- }
- public static func ==(lhs: UsesATransitively, rhs: UsesATransitively) -> Bool {
- if lhs._a != rhs._a {return false}
- if lhs._e != rhs._e {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
|