Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: pbpayload.proto
//
// For information on using the generated types, please see the documentation:
// https://github.com/apple/swift-protobuf/
import Foundation
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 CMIXText {
// 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 version: UInt32 = 0
var text: String = String()
var reply: TextReply {
get {return _reply ?? TextReply()}
set {_reply = newValue}
}
/// Returns true if `reply` has been explicitly set.
var hasReply: Bool {return self._reply != nil}
/// Clears the value of `reply`. Subsequent reads from it will return its default value.
mutating func clearReply() {self._reply = nil}
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
fileprivate var _reply: TextReply? = nil
}
struct TextReply {
// 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 messageID: Data = Data()
var senderID: Data = Data()
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
// MARK: - Code below here is support for the SwiftProtobuf runtime.
extension CMIXText: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = "CMIXText"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "version"),
2: .same(proto: "text"),
3: .same(proto: "reply"),
]
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.decodeSingularUInt32Field(value: &self.version) }()
case 2: try { try decoder.decodeSingularStringField(value: &self.text) }()
case 3: try { try decoder.decodeSingularMessageField(value: &self._reply) }()
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
if self.version != 0 {
try visitor.visitSingularUInt32Field(value: self.version, fieldNumber: 1)
}
if !self.text.isEmpty {
try visitor.visitSingularStringField(value: self.text, fieldNumber: 2)
}
try { if let v = self._reply {
try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
} }()
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: CMIXText, rhs: CMIXText) -> Bool {
if lhs.version != rhs.version {return false}
if lhs.text != rhs.text {return false}
if lhs._reply != rhs._reply {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension TextReply: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = "TextReply"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "messageId"),
2: .same(proto: "senderId"),
]
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.decodeSingularBytesField(value: &self.messageID) }()
case 2: try { try decoder.decodeSingularBytesField(value: &self.senderID) }()
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.messageID.isEmpty {
try visitor.visitSingularBytesField(value: self.messageID, fieldNumber: 1)
}
if !self.senderID.isEmpty {
try visitor.visitSingularBytesField(value: self.senderID, fieldNumber: 2)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: TextReply, rhs: TextReply) -> Bool {
if lhs.messageID != rhs.messageID {return false}
if lhs.senderID != rhs.senderID {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}