unittest_arena.pb.swift 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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/unittest_arena.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. // Protocol Buffers - Google's data interchange format
  11. // Copyright 2008 Google Inc. All rights reserved.
  12. //
  13. // Use of this source code is governed by a BSD-style
  14. // license that can be found in the LICENSE file or at
  15. // https://developers.google.com/open-source/licenses/bsd
  16. import SwiftProtobuf
  17. // If the compiler emits an error on this type, it is because this file
  18. // was generated by a version of the `protoc` Swift plug-in that is
  19. // incompatible with the version of SwiftProtobuf to which you are linking.
  20. // Please ensure that you are building against the same version of the API
  21. // that was used to generate this file.
  22. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  23. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  24. typealias Version = _2
  25. }
  26. struct Proto2ArenaUnittest_NestedMessage: Sendable {
  27. // SwiftProtobuf.Message conformance is added in an extension below. See the
  28. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  29. // methods supported on all messages.
  30. var d: Int32 {
  31. get {_d ?? 0}
  32. set {_d = newValue}
  33. }
  34. /// Returns true if `d` has been explicitly set.
  35. var hasD: Bool {self._d != nil}
  36. /// Clears the value of `d`. Subsequent reads from it will return its default value.
  37. mutating func clearD() {self._d = nil}
  38. var unknownFields = SwiftProtobuf.UnknownStorage()
  39. init() {}
  40. fileprivate var _d: Int32? = nil
  41. }
  42. struct Proto2ArenaUnittest_ArenaMessage: Sendable {
  43. // SwiftProtobuf.Message conformance is added in an extension below. See the
  44. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  45. // methods supported on all messages.
  46. var repeatedNestedMessage: [Proto2ArenaUnittest_NestedMessage] = []
  47. var unknownFields = SwiftProtobuf.UnknownStorage()
  48. init() {}
  49. }
  50. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  51. fileprivate let _protobuf_package = "proto2_arena_unittest"
  52. extension Proto2ArenaUnittest_NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  53. static let protoMessageName: String = _protobuf_package + ".NestedMessage"
  54. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}d\0")
  55. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  56. while let fieldNumber = try decoder.nextFieldNumber() {
  57. // The use of inline closures is to circumvent an issue where the compiler
  58. // allocates stack space for every case branch when no optimizations are
  59. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  60. switch fieldNumber {
  61. case 1: try { try decoder.decodeSingularInt32Field(value: &self._d) }()
  62. default: break
  63. }
  64. }
  65. }
  66. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  67. // The use of inline closures is to circumvent an issue where the compiler
  68. // allocates stack space for every if/case branch local when no optimizations
  69. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  70. // https://github.com/apple/swift-protobuf/issues/1182
  71. try { if let v = self._d {
  72. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  73. } }()
  74. try unknownFields.traverse(visitor: &visitor)
  75. }
  76. static func ==(lhs: Proto2ArenaUnittest_NestedMessage, rhs: Proto2ArenaUnittest_NestedMessage) -> Bool {
  77. if lhs._d != rhs._d {return false}
  78. if lhs.unknownFields != rhs.unknownFields {return false}
  79. return true
  80. }
  81. }
  82. extension Proto2ArenaUnittest_ArenaMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  83. static let protoMessageName: String = _protobuf_package + ".ArenaMessage"
  84. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}repeated_nested_message\0")
  85. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  86. while let fieldNumber = try decoder.nextFieldNumber() {
  87. // The use of inline closures is to circumvent an issue where the compiler
  88. // allocates stack space for every case branch when no optimizations are
  89. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  90. switch fieldNumber {
  91. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedNestedMessage) }()
  92. default: break
  93. }
  94. }
  95. }
  96. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  97. if !self.repeatedNestedMessage.isEmpty {
  98. try visitor.visitRepeatedMessageField(value: self.repeatedNestedMessage, fieldNumber: 1)
  99. }
  100. try unknownFields.traverse(visitor: &visitor)
  101. }
  102. static func ==(lhs: Proto2ArenaUnittest_ArenaMessage, rhs: Proto2ArenaUnittest_ArenaMessage) -> Bool {
  103. if lhs.repeatedNestedMessage != rhs.repeatedNestedMessage {return false}
  104. if lhs.unknownFields != rhs.unknownFields {return false}
  105. return true
  106. }
  107. }