late_loaded_option.pb.swift 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. // swiftlint:disable all
  4. //
  5. // Generated by the Swift generator plugin for the protocol buffer compiler.
  6. // Source: google/protobuf/late_loaded_option.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. import SwiftProtobuf
  11. // If the compiler emits an error on this type, it is because this file
  12. // was generated by a version of the `protoc` Swift plug-in that is
  13. // incompatible with the version of SwiftProtobuf to which you are linking.
  14. // Please ensure that you are building against the same version of the API
  15. // that was used to generate this file.
  16. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  17. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  18. typealias Version = _2
  19. }
  20. struct Proto2Unittest_LateLoadedOption: Sendable {
  21. // SwiftProtobuf.Message conformance is added in an extension below. See the
  22. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  23. // methods supported on all messages.
  24. var value: Int32 {
  25. get {_value ?? 0}
  26. set {_value = newValue}
  27. }
  28. /// Returns true if `value` has been explicitly set.
  29. var hasValue: Bool {self._value != nil}
  30. /// Clears the value of `value`. Subsequent reads from it will return its default value.
  31. mutating func clearValue() {self._value = nil}
  32. var unknownFields = SwiftProtobuf.UnknownStorage()
  33. init() {}
  34. fileprivate var _value: Int32? = nil
  35. }
  36. // MARK: - Extension support defined in late_loaded_option.proto.
  37. // MARK: - Extension Properties
  38. // Swift Extensions on the extended Messages to add easy access to the declared
  39. // extension fields. The names are based on the extension field name from the proto
  40. // declaration. To avoid naming collisions, the names are prefixed with the name of
  41. // the scope where the extend directive occurs.
  42. extension SwiftProtobuf.Google_Protobuf_MessageOptions {
  43. var Proto2Unittest_LateLoadedOption_ext: Proto2Unittest_LateLoadedOption {
  44. get {return getExtensionValue(ext: Proto2Unittest_LateLoadedOption.Extensions.ext) ?? Proto2Unittest_LateLoadedOption()}
  45. set {setExtensionValue(ext: Proto2Unittest_LateLoadedOption.Extensions.ext, value: newValue)}
  46. }
  47. /// Returns true if extension `Proto2Unittest_LateLoadedOption.Extensions.ext`
  48. /// has been explicitly set.
  49. var hasProto2Unittest_LateLoadedOption_ext: Bool {
  50. return hasExtensionValue(ext: Proto2Unittest_LateLoadedOption.Extensions.ext)
  51. }
  52. /// Clears the value of extension `Proto2Unittest_LateLoadedOption.Extensions.ext`.
  53. /// Subsequent reads from it will return its default value.
  54. mutating func clearProto2Unittest_LateLoadedOption_ext() {
  55. clearExtensionValue(ext: Proto2Unittest_LateLoadedOption.Extensions.ext)
  56. }
  57. }
  58. // MARK: - File's ExtensionMap: Proto2Unittest_LateLoadedOption_Extensions
  59. /// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by
  60. /// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed
  61. /// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create
  62. /// a larger `SwiftProtobuf.SimpleExtensionMap`.
  63. let Proto2Unittest_LateLoadedOption_Extensions: SwiftProtobuf.SimpleExtensionMap = [
  64. Proto2Unittest_LateLoadedOption.Extensions.ext
  65. ]
  66. // Extension Objects - The only reason these might be needed is when manually
  67. // constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_
  68. // accessors for the extension fields on the messages directly.
  69. extension Proto2Unittest_LateLoadedOption {
  70. enum Extensions {
  71. static let ext = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalMessageExtensionField<Proto2Unittest_LateLoadedOption>, SwiftProtobuf.Google_Protobuf_MessageOptions>(
  72. _protobuf_fieldNumber: 95126892,
  73. fieldName: "proto2_unittest.LateLoadedOption.ext"
  74. )
  75. }
  76. }
  77. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  78. fileprivate let _protobuf_package = "proto2_unittest"
  79. extension Proto2Unittest_LateLoadedOption: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  80. static let protoMessageName: String = _protobuf_package + ".LateLoadedOption"
  81. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0")
  82. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  83. while let fieldNumber = try decoder.nextFieldNumber() {
  84. // The use of inline closures is to circumvent an issue where the compiler
  85. // allocates stack space for every case branch when no optimizations are
  86. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  87. switch fieldNumber {
  88. case 1: try { try decoder.decodeSingularInt32Field(value: &self._value) }()
  89. default: break
  90. }
  91. }
  92. }
  93. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  94. // The use of inline closures is to circumvent an issue where the compiler
  95. // allocates stack space for every if/case branch local when no optimizations
  96. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  97. // https://github.com/apple/swift-protobuf/issues/1182
  98. try { if let v = self._value {
  99. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  100. } }()
  101. try unknownFields.traverse(visitor: &visitor)
  102. }
  103. static func ==(lhs: Proto2Unittest_LateLoadedOption, rhs: Proto2Unittest_LateLoadedOption) -> Bool {
  104. if lhs._value != rhs._value {return false}
  105. if lhs.unknownFields != rhs.unknownFields {return false}
  106. return true
  107. }
  108. }