/src/brpc/build/test/snappy_message.pb.cc
Line | Count | Source |
1 | | // Generated by the protocol buffer compiler. DO NOT EDIT! |
2 | | // source: snappy_message.proto |
3 | | |
4 | | #include "snappy_message.pb.h" |
5 | | |
6 | | #include <algorithm> |
7 | | |
8 | | #include <google/protobuf/io/coded_stream.h> |
9 | | #include <google/protobuf/extension_set.h> |
10 | | #include <google/protobuf/wire_format_lite.h> |
11 | | #include <google/protobuf/descriptor.h> |
12 | | #include <google/protobuf/generated_message_reflection.h> |
13 | | #include <google/protobuf/reflection_ops.h> |
14 | | #include <google/protobuf/wire_format.h> |
15 | | // @@protoc_insertion_point(includes) |
16 | | #include <google/protobuf/port_def.inc> |
17 | | |
18 | | PROTOBUF_PRAGMA_INIT_SEG |
19 | | |
20 | | namespace _pb = ::PROTOBUF_NAMESPACE_ID; |
21 | | namespace _pbi = _pb::internal; |
22 | | |
23 | | namespace snappy_message { |
24 | | PROTOBUF_CONSTEXPR SnappyMessageProto::SnappyMessageProto( |
25 | | ::_pbi::ConstantInitialized): _impl_{ |
26 | | /*decltype(_impl_._has_bits_)*/{} |
27 | | , /*decltype(_impl_._cached_size_)*/{} |
28 | | , /*decltype(_impl_.numbers_)*/{} |
29 | | , /*decltype(_impl_.text_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {} |
30 | | struct SnappyMessageProtoDefaultTypeInternal { |
31 | | PROTOBUF_CONSTEXPR SnappyMessageProtoDefaultTypeInternal() |
32 | 0 | : _instance(::_pbi::ConstantInitialized{}) {} |
33 | 0 | ~SnappyMessageProtoDefaultTypeInternal() {} |
34 | | union { |
35 | | SnappyMessageProto _instance; |
36 | | }; |
37 | | }; |
38 | | PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SnappyMessageProtoDefaultTypeInternal _SnappyMessageProto_default_instance_; |
39 | | } // namespace snappy_message |
40 | | static ::_pb::Metadata file_level_metadata_snappy_5fmessage_2eproto[1]; |
41 | | static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_snappy_5fmessage_2eproto = nullptr; |
42 | | static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_snappy_5fmessage_2eproto = nullptr; |
43 | | |
44 | | const uint32_t TableStruct_snappy_5fmessage_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { |
45 | | PROTOBUF_FIELD_OFFSET(::snappy_message::SnappyMessageProto, _impl_._has_bits_), |
46 | | PROTOBUF_FIELD_OFFSET(::snappy_message::SnappyMessageProto, _internal_metadata_), |
47 | | ~0u, // no _extensions_ |
48 | | ~0u, // no _oneof_case_ |
49 | | ~0u, // no _weak_field_map_ |
50 | | ~0u, // no _inlined_string_donated_ |
51 | | PROTOBUF_FIELD_OFFSET(::snappy_message::SnappyMessageProto, _impl_.text_), |
52 | | PROTOBUF_FIELD_OFFSET(::snappy_message::SnappyMessageProto, _impl_.numbers_), |
53 | | 0, |
54 | | ~0u, |
55 | | }; |
56 | | static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { |
57 | | { 0, 8, -1, sizeof(::snappy_message::SnappyMessageProto)}, |
58 | | }; |
59 | | |
60 | | static const ::_pb::Message* const file_default_instances[] = { |
61 | | &::snappy_message::_SnappyMessageProto_default_instance_._instance, |
62 | | }; |
63 | | |
64 | | const char descriptor_table_protodef_snappy_5fmessage_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = |
65 | | "\n\024snappy_message.proto\022\016snappy_message\"3" |
66 | | "\n\022SnappyMessageProto\022\014\n\004text\030\001 \001(\t\022\017\n\007nu" |
67 | | "mbers\030\002 \003(\005" |
68 | | ; |
69 | | static ::_pbi::once_flag descriptor_table_snappy_5fmessage_2eproto_once; |
70 | | const ::_pbi::DescriptorTable descriptor_table_snappy_5fmessage_2eproto = { |
71 | | false, false, 91, descriptor_table_protodef_snappy_5fmessage_2eproto, |
72 | | "snappy_message.proto", |
73 | | &descriptor_table_snappy_5fmessage_2eproto_once, nullptr, 0, 1, |
74 | | schemas, file_default_instances, TableStruct_snappy_5fmessage_2eproto::offsets, |
75 | | file_level_metadata_snappy_5fmessage_2eproto, file_level_enum_descriptors_snappy_5fmessage_2eproto, |
76 | | file_level_service_descriptors_snappy_5fmessage_2eproto, |
77 | | }; |
78 | 0 | PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_snappy_5fmessage_2eproto_getter() { |
79 | 0 | return &descriptor_table_snappy_5fmessage_2eproto; |
80 | 0 | } |
81 | | |
82 | | // Force running AddDescriptors() at dynamic initialization time. |
83 | | PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_snappy_5fmessage_2eproto(&descriptor_table_snappy_5fmessage_2eproto); |
84 | | namespace snappy_message { |
85 | | |
86 | | // =================================================================== |
87 | | |
88 | | class SnappyMessageProto::_Internal { |
89 | | public: |
90 | | using HasBits = decltype(std::declval<SnappyMessageProto>()._impl_._has_bits_); |
91 | 0 | static void set_has_text(HasBits* has_bits) { |
92 | 0 | (*has_bits)[0] |= 1u; |
93 | 0 | } |
94 | | }; |
95 | | |
96 | | SnappyMessageProto::SnappyMessageProto(::PROTOBUF_NAMESPACE_ID::Arena* arena, |
97 | | bool is_message_owned) |
98 | 0 | : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { |
99 | 0 | SharedCtor(arena, is_message_owned); |
100 | | // @@protoc_insertion_point(arena_constructor:snappy_message.SnappyMessageProto) |
101 | 0 | } |
102 | | SnappyMessageProto::SnappyMessageProto(const SnappyMessageProto& from) |
103 | 0 | : ::PROTOBUF_NAMESPACE_ID::Message() { |
104 | 0 | SnappyMessageProto* const _this = this; (void)_this; |
105 | 0 | new (&_impl_) Impl_{ |
106 | 0 | decltype(_impl_._has_bits_){from._impl_._has_bits_} |
107 | 0 | , /*decltype(_impl_._cached_size_)*/{} |
108 | 0 | , decltype(_impl_.numbers_){from._impl_.numbers_} |
109 | 0 | , decltype(_impl_.text_){}}; |
110 | |
|
111 | 0 | _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); |
112 | 0 | _impl_.text_.InitDefault(); |
113 | | #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING |
114 | | _impl_.text_.Set("", GetArenaForAllocation()); |
115 | | #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING |
116 | 0 | if (from._internal_has_text()) { |
117 | 0 | _this->_impl_.text_.Set(from._internal_text(), |
118 | 0 | _this->GetArenaForAllocation()); |
119 | 0 | } |
120 | | // @@protoc_insertion_point(copy_constructor:snappy_message.SnappyMessageProto) |
121 | 0 | } |
122 | | |
123 | | inline void SnappyMessageProto::SharedCtor( |
124 | 0 | ::_pb::Arena* arena, bool is_message_owned) { |
125 | 0 | (void)arena; |
126 | 0 | (void)is_message_owned; |
127 | 0 | new (&_impl_) Impl_{ |
128 | 0 | decltype(_impl_._has_bits_){} |
129 | 0 | , /*decltype(_impl_._cached_size_)*/{} |
130 | 0 | , decltype(_impl_.numbers_){arena} |
131 | 0 | , decltype(_impl_.text_){} |
132 | 0 | }; |
133 | 0 | _impl_.text_.InitDefault(); |
134 | | #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING |
135 | | _impl_.text_.Set("", GetArenaForAllocation()); |
136 | | #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING |
137 | 0 | } |
138 | | |
139 | 0 | SnappyMessageProto::~SnappyMessageProto() { |
140 | | // @@protoc_insertion_point(destructor:snappy_message.SnappyMessageProto) |
141 | 0 | if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { |
142 | 0 | (void)arena; |
143 | 0 | return; |
144 | 0 | } |
145 | 0 | SharedDtor(); |
146 | 0 | } |
147 | | |
148 | 0 | inline void SnappyMessageProto::SharedDtor() { |
149 | 0 | GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); |
150 | 0 | _impl_.numbers_.~RepeatedField(); |
151 | 0 | _impl_.text_.Destroy(); |
152 | 0 | } |
153 | | |
154 | 0 | void SnappyMessageProto::SetCachedSize(int size) const { |
155 | 0 | _impl_._cached_size_.Set(size); |
156 | 0 | } |
157 | | |
158 | 0 | void SnappyMessageProto::Clear() { |
159 | | // @@protoc_insertion_point(message_clear_start:snappy_message.SnappyMessageProto) |
160 | 0 | uint32_t cached_has_bits = 0; |
161 | | // Prevent compiler warnings about cached_has_bits being unused |
162 | 0 | (void) cached_has_bits; |
163 | |
|
164 | 0 | _impl_.numbers_.Clear(); |
165 | 0 | cached_has_bits = _impl_._has_bits_[0]; |
166 | 0 | if (cached_has_bits & 0x00000001u) { |
167 | 0 | _impl_.text_.ClearNonDefaultToEmpty(); |
168 | 0 | } |
169 | 0 | _impl_._has_bits_.Clear(); |
170 | 0 | _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); |
171 | 0 | } |
172 | | |
173 | 0 | const char* SnappyMessageProto::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { |
174 | 0 | #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
175 | 0 | _Internal::HasBits has_bits{}; |
176 | 0 | while (!ctx->Done(&ptr)) { |
177 | 0 | uint32_t tag; |
178 | 0 | ptr = ::_pbi::ReadTag(ptr, &tag); |
179 | 0 | switch (tag >> 3) { |
180 | | // optional string text = 1; |
181 | 0 | case 1: |
182 | 0 | if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) { |
183 | 0 | auto str = _internal_mutable_text(); |
184 | 0 | ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); |
185 | 0 | CHK_(ptr); |
186 | 0 | #ifndef NDEBUG |
187 | 0 | ::_pbi::VerifyUTF8(str, "snappy_message.SnappyMessageProto.text"); |
188 | 0 | #endif // !NDEBUG |
189 | 0 | } else |
190 | 0 | goto handle_unusual; |
191 | 0 | continue; |
192 | | // repeated int32 numbers = 2; |
193 | 0 | case 2: |
194 | 0 | if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) { |
195 | 0 | ptr -= 1; |
196 | 0 | do { |
197 | 0 | ptr += 1; |
198 | 0 | _internal_add_numbers(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr)); |
199 | 0 | CHK_(ptr); |
200 | 0 | if (!ctx->DataAvailable(ptr)) break; |
201 | 0 | } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<16>(ptr)); |
202 | 0 | } else if (static_cast<uint8_t>(tag) == 18) { |
203 | 0 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_numbers(), ptr, ctx); |
204 | 0 | CHK_(ptr); |
205 | 0 | } else |
206 | 0 | goto handle_unusual; |
207 | 0 | continue; |
208 | 0 | default: |
209 | 0 | goto handle_unusual; |
210 | 0 | } // switch |
211 | 0 | handle_unusual: |
212 | 0 | if ((tag == 0) || ((tag & 7) == 4)) { |
213 | 0 | CHK_(ptr); |
214 | 0 | ctx->SetLastTag(tag); |
215 | 0 | goto message_done; |
216 | 0 | } |
217 | 0 | ptr = UnknownFieldParse( |
218 | 0 | tag, |
219 | 0 | _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), |
220 | 0 | ptr, ctx); |
221 | 0 | CHK_(ptr != nullptr); |
222 | 0 | } // while |
223 | 0 | message_done: |
224 | 0 | _impl_._has_bits_.Or(has_bits); |
225 | 0 | return ptr; |
226 | 0 | failure: |
227 | 0 | ptr = nullptr; |
228 | 0 | goto message_done; |
229 | 0 | #undef CHK_ |
230 | 0 | } |
231 | | |
232 | | uint8_t* SnappyMessageProto::_InternalSerialize( |
233 | 0 | uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { |
234 | | // @@protoc_insertion_point(serialize_to_array_start:snappy_message.SnappyMessageProto) |
235 | 0 | uint32_t cached_has_bits = 0; |
236 | 0 | (void) cached_has_bits; |
237 | |
|
238 | 0 | cached_has_bits = _impl_._has_bits_[0]; |
239 | | // optional string text = 1; |
240 | 0 | if (cached_has_bits & 0x00000001u) { |
241 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( |
242 | 0 | this->_internal_text().data(), static_cast<int>(this->_internal_text().length()), |
243 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, |
244 | 0 | "snappy_message.SnappyMessageProto.text"); |
245 | 0 | target = stream->WriteStringMaybeAliased( |
246 | 0 | 1, this->_internal_text(), target); |
247 | 0 | } |
248 | | |
249 | | // repeated int32 numbers = 2; |
250 | 0 | for (int i = 0, n = this->_internal_numbers_size(); i < n; i++) { |
251 | 0 | target = stream->EnsureSpace(target); |
252 | 0 | target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_numbers(i), target); |
253 | 0 | } |
254 | |
|
255 | 0 | if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { |
256 | 0 | target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( |
257 | 0 | _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); |
258 | 0 | } |
259 | | // @@protoc_insertion_point(serialize_to_array_end:snappy_message.SnappyMessageProto) |
260 | 0 | return target; |
261 | 0 | } |
262 | | |
263 | 0 | size_t SnappyMessageProto::ByteSizeLong() const { |
264 | | // @@protoc_insertion_point(message_byte_size_start:snappy_message.SnappyMessageProto) |
265 | 0 | size_t total_size = 0; |
266 | |
|
267 | 0 | uint32_t cached_has_bits = 0; |
268 | | // Prevent compiler warnings about cached_has_bits being unused |
269 | 0 | (void) cached_has_bits; |
270 | | |
271 | | // repeated int32 numbers = 2; |
272 | 0 | { |
273 | 0 | size_t data_size = ::_pbi::WireFormatLite:: |
274 | 0 | Int32Size(this->_impl_.numbers_); |
275 | 0 | total_size += 1 * |
276 | 0 | ::_pbi::FromIntSize(this->_internal_numbers_size()); |
277 | 0 | total_size += data_size; |
278 | 0 | } |
279 | | |
280 | | // optional string text = 1; |
281 | 0 | cached_has_bits = _impl_._has_bits_[0]; |
282 | 0 | if (cached_has_bits & 0x00000001u) { |
283 | 0 | total_size += 1 + |
284 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( |
285 | 0 | this->_internal_text()); |
286 | 0 | } |
287 | |
|
288 | 0 | return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); |
289 | 0 | } |
290 | | |
291 | | const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SnappyMessageProto::_class_data_ = { |
292 | | ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, |
293 | | SnappyMessageProto::MergeImpl |
294 | | }; |
295 | 0 | const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SnappyMessageProto::GetClassData() const { return &_class_data_; } |
296 | | |
297 | | |
298 | 0 | void SnappyMessageProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { |
299 | 0 | auto* const _this = static_cast<SnappyMessageProto*>(&to_msg); |
300 | 0 | auto& from = static_cast<const SnappyMessageProto&>(from_msg); |
301 | | // @@protoc_insertion_point(class_specific_merge_from_start:snappy_message.SnappyMessageProto) |
302 | 0 | GOOGLE_DCHECK_NE(&from, _this); |
303 | 0 | uint32_t cached_has_bits = 0; |
304 | 0 | (void) cached_has_bits; |
305 | |
|
306 | 0 | _this->_impl_.numbers_.MergeFrom(from._impl_.numbers_); |
307 | 0 | if (from._internal_has_text()) { |
308 | 0 | _this->_internal_set_text(from._internal_text()); |
309 | 0 | } |
310 | 0 | _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); |
311 | 0 | } |
312 | | |
313 | 0 | void SnappyMessageProto::CopyFrom(const SnappyMessageProto& from) { |
314 | | // @@protoc_insertion_point(class_specific_copy_from_start:snappy_message.SnappyMessageProto) |
315 | 0 | if (&from == this) return; |
316 | 0 | Clear(); |
317 | 0 | MergeFrom(from); |
318 | 0 | } |
319 | | |
320 | 0 | bool SnappyMessageProto::IsInitialized() const { |
321 | 0 | return true; |
322 | 0 | } |
323 | | |
324 | 0 | void SnappyMessageProto::InternalSwap(SnappyMessageProto* other) { |
325 | 0 | using std::swap; |
326 | 0 | auto* lhs_arena = GetArenaForAllocation(); |
327 | 0 | auto* rhs_arena = other->GetArenaForAllocation(); |
328 | 0 | _internal_metadata_.InternalSwap(&other->_internal_metadata_); |
329 | 0 | swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); |
330 | 0 | _impl_.numbers_.InternalSwap(&other->_impl_.numbers_); |
331 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( |
332 | 0 | &_impl_.text_, lhs_arena, |
333 | 0 | &other->_impl_.text_, rhs_arena |
334 | 0 | ); |
335 | 0 | } |
336 | | |
337 | 0 | ::PROTOBUF_NAMESPACE_ID::Metadata SnappyMessageProto::GetMetadata() const { |
338 | 0 | return ::_pbi::AssignDescriptors( |
339 | 0 | &descriptor_table_snappy_5fmessage_2eproto_getter, &descriptor_table_snappy_5fmessage_2eproto_once, |
340 | 0 | file_level_metadata_snappy_5fmessage_2eproto[0]); |
341 | 0 | } |
342 | | |
343 | | // @@protoc_insertion_point(namespace_scope) |
344 | | } // namespace snappy_message |
345 | | PROTOBUF_NAMESPACE_OPEN |
346 | | template<> PROTOBUF_NOINLINE ::snappy_message::SnappyMessageProto* |
347 | 0 | Arena::CreateMaybeMessage< ::snappy_message::SnappyMessageProto >(Arena* arena) { |
348 | 0 | return Arena::CreateMessageInternal< ::snappy_message::SnappyMessageProto >(arena); |
349 | 0 | } |
350 | | PROTOBUF_NAMESPACE_CLOSE |
351 | | |
352 | | // @@protoc_insertion_point(global_scope) |
353 | | #include <google/protobuf/port_undef.inc> |