/src/brpc/build/test/v2.pb.cc
Line | Count | Source |
1 | | // Generated by the protocol buffer compiler. DO NOT EDIT! |
2 | | // source: v2.proto |
3 | | |
4 | | #include "v2.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 v2 { |
24 | | PROTOBUF_CONSTEXPR EchoRequest::EchoRequest( |
25 | | ::_pbi::ConstantInitialized): _impl_{ |
26 | | /*decltype(_impl_._has_bits_)*/{} |
27 | | , /*decltype(_impl_._cached_size_)*/{} |
28 | | , /*decltype(_impl_.value_)*/0} {} |
29 | | struct EchoRequestDefaultTypeInternal { |
30 | | PROTOBUF_CONSTEXPR EchoRequestDefaultTypeInternal() |
31 | 0 | : _instance(::_pbi::ConstantInitialized{}) {} |
32 | 0 | ~EchoRequestDefaultTypeInternal() {} |
33 | | union { |
34 | | EchoRequest _instance; |
35 | | }; |
36 | | }; |
37 | | PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EchoRequestDefaultTypeInternal _EchoRequest_default_instance_; |
38 | | PROTOBUF_CONSTEXPR EchoResponse::EchoResponse( |
39 | | ::_pbi::ConstantInitialized): _impl_{ |
40 | | /*decltype(_impl_._has_bits_)*/{} |
41 | | , /*decltype(_impl_._cached_size_)*/{} |
42 | | , /*decltype(_impl_.value_)*/0} {} |
43 | | struct EchoResponseDefaultTypeInternal { |
44 | | PROTOBUF_CONSTEXPR EchoResponseDefaultTypeInternal() |
45 | 0 | : _instance(::_pbi::ConstantInitialized{}) {} |
46 | 0 | ~EchoResponseDefaultTypeInternal() {} |
47 | | union { |
48 | | EchoResponse _instance; |
49 | | }; |
50 | | }; |
51 | | PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EchoResponseDefaultTypeInternal _EchoResponse_default_instance_; |
52 | | } // namespace v2 |
53 | | static ::_pb::Metadata file_level_metadata_v2_2eproto[2]; |
54 | | static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_v2_2eproto = nullptr; |
55 | | static const ::_pb::ServiceDescriptor* file_level_service_descriptors_v2_2eproto[1]; |
56 | | |
57 | | const uint32_t TableStruct_v2_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { |
58 | | PROTOBUF_FIELD_OFFSET(::v2::EchoRequest, _impl_._has_bits_), |
59 | | PROTOBUF_FIELD_OFFSET(::v2::EchoRequest, _internal_metadata_), |
60 | | ~0u, // no _extensions_ |
61 | | ~0u, // no _oneof_case_ |
62 | | ~0u, // no _weak_field_map_ |
63 | | ~0u, // no _inlined_string_donated_ |
64 | | PROTOBUF_FIELD_OFFSET(::v2::EchoRequest, _impl_.value_), |
65 | | 0, |
66 | | PROTOBUF_FIELD_OFFSET(::v2::EchoResponse, _impl_._has_bits_), |
67 | | PROTOBUF_FIELD_OFFSET(::v2::EchoResponse, _internal_metadata_), |
68 | | ~0u, // no _extensions_ |
69 | | ~0u, // no _oneof_case_ |
70 | | ~0u, // no _weak_field_map_ |
71 | | ~0u, // no _inlined_string_donated_ |
72 | | PROTOBUF_FIELD_OFFSET(::v2::EchoResponse, _impl_.value_), |
73 | | 0, |
74 | | }; |
75 | | static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { |
76 | | { 0, 7, -1, sizeof(::v2::EchoRequest)}, |
77 | | { 8, 15, -1, sizeof(::v2::EchoResponse)}, |
78 | | }; |
79 | | |
80 | | static const ::_pb::Message* const file_default_instances[] = { |
81 | | &::v2::_EchoRequest_default_instance_._instance, |
82 | | &::v2::_EchoResponse_default_instance_._instance, |
83 | | }; |
84 | | |
85 | | const char descriptor_table_protodef_v2_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = |
86 | | "\n\010v2.proto\022\002v2\"\034\n\013EchoRequest\022\r\n\005value\030\001" |
87 | | " \002(\005\"\035\n\014EchoResponse\022\r\n\005value\030\001 \002(\00528\n\013E" |
88 | | "choService\022)\n\004Echo\022\017.v2.EchoRequest\032\020.v2" |
89 | | ".EchoResponseB\003\200\001\001" |
90 | | ; |
91 | | static ::_pbi::once_flag descriptor_table_v2_2eproto_once; |
92 | | const ::_pbi::DescriptorTable descriptor_table_v2_2eproto = { |
93 | | false, false, 138, descriptor_table_protodef_v2_2eproto, |
94 | | "v2.proto", |
95 | | &descriptor_table_v2_2eproto_once, nullptr, 0, 2, |
96 | | schemas, file_default_instances, TableStruct_v2_2eproto::offsets, |
97 | | file_level_metadata_v2_2eproto, file_level_enum_descriptors_v2_2eproto, |
98 | | file_level_service_descriptors_v2_2eproto, |
99 | | }; |
100 | 0 | PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_v2_2eproto_getter() { |
101 | 0 | return &descriptor_table_v2_2eproto; |
102 | 0 | } |
103 | | |
104 | | // Force running AddDescriptors() at dynamic initialization time. |
105 | | PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_v2_2eproto(&descriptor_table_v2_2eproto); |
106 | | namespace v2 { |
107 | | |
108 | | // =================================================================== |
109 | | |
110 | | class EchoRequest::_Internal { |
111 | | public: |
112 | | using HasBits = decltype(std::declval<EchoRequest>()._impl_._has_bits_); |
113 | 0 | static void set_has_value(HasBits* has_bits) { |
114 | 0 | (*has_bits)[0] |= 1u; |
115 | 0 | } |
116 | 0 | static bool MissingRequiredFields(const HasBits& has_bits) { |
117 | 0 | return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0; |
118 | 0 | } |
119 | | }; |
120 | | |
121 | | EchoRequest::EchoRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, |
122 | | bool is_message_owned) |
123 | 0 | : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { |
124 | 0 | SharedCtor(arena, is_message_owned); |
125 | | // @@protoc_insertion_point(arena_constructor:v2.EchoRequest) |
126 | 0 | } |
127 | | EchoRequest::EchoRequest(const EchoRequest& from) |
128 | 0 | : ::PROTOBUF_NAMESPACE_ID::Message() { |
129 | 0 | EchoRequest* const _this = this; (void)_this; |
130 | 0 | new (&_impl_) Impl_{ |
131 | 0 | decltype(_impl_._has_bits_){from._impl_._has_bits_} |
132 | 0 | , /*decltype(_impl_._cached_size_)*/{} |
133 | 0 | , decltype(_impl_.value_){}}; |
134 | |
|
135 | 0 | _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); |
136 | 0 | _this->_impl_.value_ = from._impl_.value_; |
137 | | // @@protoc_insertion_point(copy_constructor:v2.EchoRequest) |
138 | 0 | } |
139 | | |
140 | | inline void EchoRequest::SharedCtor( |
141 | 0 | ::_pb::Arena* arena, bool is_message_owned) { |
142 | 0 | (void)arena; |
143 | 0 | (void)is_message_owned; |
144 | 0 | new (&_impl_) Impl_{ |
145 | 0 | decltype(_impl_._has_bits_){} |
146 | 0 | , /*decltype(_impl_._cached_size_)*/{} |
147 | 0 | , decltype(_impl_.value_){0} |
148 | 0 | }; |
149 | 0 | } |
150 | | |
151 | 0 | EchoRequest::~EchoRequest() { |
152 | | // @@protoc_insertion_point(destructor:v2.EchoRequest) |
153 | 0 | if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { |
154 | 0 | (void)arena; |
155 | 0 | return; |
156 | 0 | } |
157 | 0 | SharedDtor(); |
158 | 0 | } |
159 | | |
160 | 0 | inline void EchoRequest::SharedDtor() { |
161 | 0 | GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); |
162 | 0 | } |
163 | | |
164 | 0 | void EchoRequest::SetCachedSize(int size) const { |
165 | 0 | _impl_._cached_size_.Set(size); |
166 | 0 | } |
167 | | |
168 | 0 | void EchoRequest::Clear() { |
169 | | // @@protoc_insertion_point(message_clear_start:v2.EchoRequest) |
170 | 0 | uint32_t cached_has_bits = 0; |
171 | | // Prevent compiler warnings about cached_has_bits being unused |
172 | 0 | (void) cached_has_bits; |
173 | |
|
174 | 0 | _impl_.value_ = 0; |
175 | 0 | _impl_._has_bits_.Clear(); |
176 | 0 | _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); |
177 | 0 | } |
178 | | |
179 | 0 | const char* EchoRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { |
180 | 0 | #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
181 | 0 | _Internal::HasBits has_bits{}; |
182 | 0 | while (!ctx->Done(&ptr)) { |
183 | 0 | uint32_t tag; |
184 | 0 | ptr = ::_pbi::ReadTag(ptr, &tag); |
185 | 0 | switch (tag >> 3) { |
186 | | // required int32 value = 1; |
187 | 0 | case 1: |
188 | 0 | if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) { |
189 | 0 | _Internal::set_has_value(&has_bits); |
190 | 0 | _impl_.value_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); |
191 | 0 | CHK_(ptr); |
192 | 0 | } else |
193 | 0 | goto handle_unusual; |
194 | 0 | continue; |
195 | 0 | default: |
196 | 0 | goto handle_unusual; |
197 | 0 | } // switch |
198 | 0 | handle_unusual: |
199 | 0 | if ((tag == 0) || ((tag & 7) == 4)) { |
200 | 0 | CHK_(ptr); |
201 | 0 | ctx->SetLastTag(tag); |
202 | 0 | goto message_done; |
203 | 0 | } |
204 | 0 | ptr = UnknownFieldParse( |
205 | 0 | tag, |
206 | 0 | _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), |
207 | 0 | ptr, ctx); |
208 | 0 | CHK_(ptr != nullptr); |
209 | 0 | } // while |
210 | 0 | message_done: |
211 | 0 | _impl_._has_bits_.Or(has_bits); |
212 | 0 | return ptr; |
213 | 0 | failure: |
214 | 0 | ptr = nullptr; |
215 | 0 | goto message_done; |
216 | 0 | #undef CHK_ |
217 | 0 | } |
218 | | |
219 | | uint8_t* EchoRequest::_InternalSerialize( |
220 | 0 | uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { |
221 | | // @@protoc_insertion_point(serialize_to_array_start:v2.EchoRequest) |
222 | 0 | uint32_t cached_has_bits = 0; |
223 | 0 | (void) cached_has_bits; |
224 | |
|
225 | 0 | cached_has_bits = _impl_._has_bits_[0]; |
226 | | // required int32 value = 1; |
227 | 0 | if (cached_has_bits & 0x00000001u) { |
228 | 0 | target = stream->EnsureSpace(target); |
229 | 0 | target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_value(), target); |
230 | 0 | } |
231 | |
|
232 | 0 | if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { |
233 | 0 | target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( |
234 | 0 | _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); |
235 | 0 | } |
236 | | // @@protoc_insertion_point(serialize_to_array_end:v2.EchoRequest) |
237 | 0 | return target; |
238 | 0 | } |
239 | | |
240 | 0 | size_t EchoRequest::ByteSizeLong() const { |
241 | | // @@protoc_insertion_point(message_byte_size_start:v2.EchoRequest) |
242 | 0 | size_t total_size = 0; |
243 | | |
244 | | // required int32 value = 1; |
245 | 0 | if (_internal_has_value()) { |
246 | 0 | total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_value()); |
247 | 0 | } |
248 | 0 | uint32_t cached_has_bits = 0; |
249 | | // Prevent compiler warnings about cached_has_bits being unused |
250 | 0 | (void) cached_has_bits; |
251 | |
|
252 | 0 | return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); |
253 | 0 | } |
254 | | |
255 | | const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EchoRequest::_class_data_ = { |
256 | | ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, |
257 | | EchoRequest::MergeImpl |
258 | | }; |
259 | 0 | const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EchoRequest::GetClassData() const { return &_class_data_; } |
260 | | |
261 | | |
262 | 0 | void EchoRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { |
263 | 0 | auto* const _this = static_cast<EchoRequest*>(&to_msg); |
264 | 0 | auto& from = static_cast<const EchoRequest&>(from_msg); |
265 | | // @@protoc_insertion_point(class_specific_merge_from_start:v2.EchoRequest) |
266 | 0 | GOOGLE_DCHECK_NE(&from, _this); |
267 | 0 | uint32_t cached_has_bits = 0; |
268 | 0 | (void) cached_has_bits; |
269 | |
|
270 | 0 | if (from._internal_has_value()) { |
271 | 0 | _this->_internal_set_value(from._internal_value()); |
272 | 0 | } |
273 | 0 | _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); |
274 | 0 | } |
275 | | |
276 | 0 | void EchoRequest::CopyFrom(const EchoRequest& from) { |
277 | | // @@protoc_insertion_point(class_specific_copy_from_start:v2.EchoRequest) |
278 | 0 | if (&from == this) return; |
279 | 0 | Clear(); |
280 | 0 | MergeFrom(from); |
281 | 0 | } |
282 | | |
283 | 0 | bool EchoRequest::IsInitialized() const { |
284 | 0 | if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; |
285 | 0 | return true; |
286 | 0 | } |
287 | | |
288 | 0 | void EchoRequest::InternalSwap(EchoRequest* other) { |
289 | 0 | using std::swap; |
290 | 0 | _internal_metadata_.InternalSwap(&other->_internal_metadata_); |
291 | 0 | swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); |
292 | 0 | swap(_impl_.value_, other->_impl_.value_); |
293 | 0 | } |
294 | | |
295 | 0 | ::PROTOBUF_NAMESPACE_ID::Metadata EchoRequest::GetMetadata() const { |
296 | 0 | return ::_pbi::AssignDescriptors( |
297 | 0 | &descriptor_table_v2_2eproto_getter, &descriptor_table_v2_2eproto_once, |
298 | 0 | file_level_metadata_v2_2eproto[0]); |
299 | 0 | } |
300 | | |
301 | | // =================================================================== |
302 | | |
303 | | class EchoResponse::_Internal { |
304 | | public: |
305 | | using HasBits = decltype(std::declval<EchoResponse>()._impl_._has_bits_); |
306 | 0 | static void set_has_value(HasBits* has_bits) { |
307 | 0 | (*has_bits)[0] |= 1u; |
308 | 0 | } |
309 | 0 | static bool MissingRequiredFields(const HasBits& has_bits) { |
310 | 0 | return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0; |
311 | 0 | } |
312 | | }; |
313 | | |
314 | | EchoResponse::EchoResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, |
315 | | bool is_message_owned) |
316 | 0 | : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { |
317 | 0 | SharedCtor(arena, is_message_owned); |
318 | | // @@protoc_insertion_point(arena_constructor:v2.EchoResponse) |
319 | 0 | } |
320 | | EchoResponse::EchoResponse(const EchoResponse& from) |
321 | 0 | : ::PROTOBUF_NAMESPACE_ID::Message() { |
322 | 0 | EchoResponse* const _this = this; (void)_this; |
323 | 0 | new (&_impl_) Impl_{ |
324 | 0 | decltype(_impl_._has_bits_){from._impl_._has_bits_} |
325 | 0 | , /*decltype(_impl_._cached_size_)*/{} |
326 | 0 | , decltype(_impl_.value_){}}; |
327 | |
|
328 | 0 | _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); |
329 | 0 | _this->_impl_.value_ = from._impl_.value_; |
330 | | // @@protoc_insertion_point(copy_constructor:v2.EchoResponse) |
331 | 0 | } |
332 | | |
333 | | inline void EchoResponse::SharedCtor( |
334 | 0 | ::_pb::Arena* arena, bool is_message_owned) { |
335 | 0 | (void)arena; |
336 | 0 | (void)is_message_owned; |
337 | 0 | new (&_impl_) Impl_{ |
338 | 0 | decltype(_impl_._has_bits_){} |
339 | 0 | , /*decltype(_impl_._cached_size_)*/{} |
340 | 0 | , decltype(_impl_.value_){0} |
341 | 0 | }; |
342 | 0 | } |
343 | | |
344 | 0 | EchoResponse::~EchoResponse() { |
345 | | // @@protoc_insertion_point(destructor:v2.EchoResponse) |
346 | 0 | if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { |
347 | 0 | (void)arena; |
348 | 0 | return; |
349 | 0 | } |
350 | 0 | SharedDtor(); |
351 | 0 | } |
352 | | |
353 | 0 | inline void EchoResponse::SharedDtor() { |
354 | 0 | GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); |
355 | 0 | } |
356 | | |
357 | 0 | void EchoResponse::SetCachedSize(int size) const { |
358 | 0 | _impl_._cached_size_.Set(size); |
359 | 0 | } |
360 | | |
361 | 0 | void EchoResponse::Clear() { |
362 | | // @@protoc_insertion_point(message_clear_start:v2.EchoResponse) |
363 | 0 | uint32_t cached_has_bits = 0; |
364 | | // Prevent compiler warnings about cached_has_bits being unused |
365 | 0 | (void) cached_has_bits; |
366 | |
|
367 | 0 | _impl_.value_ = 0; |
368 | 0 | _impl_._has_bits_.Clear(); |
369 | 0 | _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); |
370 | 0 | } |
371 | | |
372 | 0 | const char* EchoResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { |
373 | 0 | #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
374 | 0 | _Internal::HasBits has_bits{}; |
375 | 0 | while (!ctx->Done(&ptr)) { |
376 | 0 | uint32_t tag; |
377 | 0 | ptr = ::_pbi::ReadTag(ptr, &tag); |
378 | 0 | switch (tag >> 3) { |
379 | | // required int32 value = 1; |
380 | 0 | case 1: |
381 | 0 | if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) { |
382 | 0 | _Internal::set_has_value(&has_bits); |
383 | 0 | _impl_.value_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); |
384 | 0 | CHK_(ptr); |
385 | 0 | } else |
386 | 0 | goto handle_unusual; |
387 | 0 | continue; |
388 | 0 | default: |
389 | 0 | goto handle_unusual; |
390 | 0 | } // switch |
391 | 0 | handle_unusual: |
392 | 0 | if ((tag == 0) || ((tag & 7) == 4)) { |
393 | 0 | CHK_(ptr); |
394 | 0 | ctx->SetLastTag(tag); |
395 | 0 | goto message_done; |
396 | 0 | } |
397 | 0 | ptr = UnknownFieldParse( |
398 | 0 | tag, |
399 | 0 | _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), |
400 | 0 | ptr, ctx); |
401 | 0 | CHK_(ptr != nullptr); |
402 | 0 | } // while |
403 | 0 | message_done: |
404 | 0 | _impl_._has_bits_.Or(has_bits); |
405 | 0 | return ptr; |
406 | 0 | failure: |
407 | 0 | ptr = nullptr; |
408 | 0 | goto message_done; |
409 | 0 | #undef CHK_ |
410 | 0 | } |
411 | | |
412 | | uint8_t* EchoResponse::_InternalSerialize( |
413 | 0 | uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { |
414 | | // @@protoc_insertion_point(serialize_to_array_start:v2.EchoResponse) |
415 | 0 | uint32_t cached_has_bits = 0; |
416 | 0 | (void) cached_has_bits; |
417 | |
|
418 | 0 | cached_has_bits = _impl_._has_bits_[0]; |
419 | | // required int32 value = 1; |
420 | 0 | if (cached_has_bits & 0x00000001u) { |
421 | 0 | target = stream->EnsureSpace(target); |
422 | 0 | target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_value(), target); |
423 | 0 | } |
424 | |
|
425 | 0 | if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { |
426 | 0 | target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( |
427 | 0 | _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); |
428 | 0 | } |
429 | | // @@protoc_insertion_point(serialize_to_array_end:v2.EchoResponse) |
430 | 0 | return target; |
431 | 0 | } |
432 | | |
433 | 0 | size_t EchoResponse::ByteSizeLong() const { |
434 | | // @@protoc_insertion_point(message_byte_size_start:v2.EchoResponse) |
435 | 0 | size_t total_size = 0; |
436 | | |
437 | | // required int32 value = 1; |
438 | 0 | if (_internal_has_value()) { |
439 | 0 | total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_value()); |
440 | 0 | } |
441 | 0 | uint32_t cached_has_bits = 0; |
442 | | // Prevent compiler warnings about cached_has_bits being unused |
443 | 0 | (void) cached_has_bits; |
444 | |
|
445 | 0 | return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); |
446 | 0 | } |
447 | | |
448 | | const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EchoResponse::_class_data_ = { |
449 | | ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, |
450 | | EchoResponse::MergeImpl |
451 | | }; |
452 | 0 | const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EchoResponse::GetClassData() const { return &_class_data_; } |
453 | | |
454 | | |
455 | 0 | void EchoResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { |
456 | 0 | auto* const _this = static_cast<EchoResponse*>(&to_msg); |
457 | 0 | auto& from = static_cast<const EchoResponse&>(from_msg); |
458 | | // @@protoc_insertion_point(class_specific_merge_from_start:v2.EchoResponse) |
459 | 0 | GOOGLE_DCHECK_NE(&from, _this); |
460 | 0 | uint32_t cached_has_bits = 0; |
461 | 0 | (void) cached_has_bits; |
462 | |
|
463 | 0 | if (from._internal_has_value()) { |
464 | 0 | _this->_internal_set_value(from._internal_value()); |
465 | 0 | } |
466 | 0 | _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); |
467 | 0 | } |
468 | | |
469 | 0 | void EchoResponse::CopyFrom(const EchoResponse& from) { |
470 | | // @@protoc_insertion_point(class_specific_copy_from_start:v2.EchoResponse) |
471 | 0 | if (&from == this) return; |
472 | 0 | Clear(); |
473 | 0 | MergeFrom(from); |
474 | 0 | } |
475 | | |
476 | 0 | bool EchoResponse::IsInitialized() const { |
477 | 0 | if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; |
478 | 0 | return true; |
479 | 0 | } |
480 | | |
481 | 0 | void EchoResponse::InternalSwap(EchoResponse* other) { |
482 | 0 | using std::swap; |
483 | 0 | _internal_metadata_.InternalSwap(&other->_internal_metadata_); |
484 | 0 | swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); |
485 | 0 | swap(_impl_.value_, other->_impl_.value_); |
486 | 0 | } |
487 | | |
488 | 0 | ::PROTOBUF_NAMESPACE_ID::Metadata EchoResponse::GetMetadata() const { |
489 | 0 | return ::_pbi::AssignDescriptors( |
490 | 0 | &descriptor_table_v2_2eproto_getter, &descriptor_table_v2_2eproto_once, |
491 | 0 | file_level_metadata_v2_2eproto[1]); |
492 | 0 | } |
493 | | |
494 | | // =================================================================== |
495 | | |
496 | 0 | EchoService::~EchoService() {} |
497 | | |
498 | 0 | const ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor* EchoService::descriptor() { |
499 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_v2_2eproto); |
500 | 0 | return file_level_service_descriptors_v2_2eproto[0]; |
501 | 0 | } |
502 | | |
503 | 0 | const ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor* EchoService::GetDescriptor() { |
504 | 0 | return descriptor(); |
505 | 0 | } |
506 | | |
507 | | void EchoService::Echo(::PROTOBUF_NAMESPACE_ID::RpcController* controller, |
508 | | const ::v2::EchoRequest*, |
509 | | ::v2::EchoResponse*, |
510 | 0 | ::google::protobuf::Closure* done) { |
511 | 0 | controller->SetFailed("Method Echo() not implemented."); |
512 | 0 | done->Run(); |
513 | 0 | } |
514 | | |
515 | | void EchoService::CallMethod(const ::PROTOBUF_NAMESPACE_ID::MethodDescriptor* method, |
516 | | ::PROTOBUF_NAMESPACE_ID::RpcController* controller, |
517 | | const ::PROTOBUF_NAMESPACE_ID::Message* request, |
518 | | ::PROTOBUF_NAMESPACE_ID::Message* response, |
519 | 0 | ::google::protobuf::Closure* done) { |
520 | 0 | GOOGLE_DCHECK_EQ(method->service(), file_level_service_descriptors_v2_2eproto[0]); |
521 | 0 | switch(method->index()) { |
522 | 0 | case 0: |
523 | 0 | Echo(controller, |
524 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::DownCast<const ::v2::EchoRequest*>( |
525 | 0 | request), |
526 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::DownCast<::v2::EchoResponse*>( |
527 | 0 | response), |
528 | 0 | done); |
529 | 0 | break; |
530 | 0 | default: |
531 | 0 | GOOGLE_LOG(FATAL) << "Bad method index; this should never happen."; |
532 | 0 | break; |
533 | 0 | } |
534 | 0 | } |
535 | | |
536 | | const ::PROTOBUF_NAMESPACE_ID::Message& EchoService::GetRequestPrototype( |
537 | 0 | const ::PROTOBUF_NAMESPACE_ID::MethodDescriptor* method) const { |
538 | 0 | GOOGLE_DCHECK_EQ(method->service(), descriptor()); |
539 | 0 | switch(method->index()) { |
540 | 0 | case 0: |
541 | 0 | return ::v2::EchoRequest::default_instance(); |
542 | 0 | default: |
543 | 0 | GOOGLE_LOG(FATAL) << "Bad method index; this should never happen."; |
544 | 0 | return *::PROTOBUF_NAMESPACE_ID::MessageFactory::generated_factory() |
545 | 0 | ->GetPrototype(method->input_type()); |
546 | 0 | } |
547 | 0 | } |
548 | | |
549 | | const ::PROTOBUF_NAMESPACE_ID::Message& EchoService::GetResponsePrototype( |
550 | 0 | const ::PROTOBUF_NAMESPACE_ID::MethodDescriptor* method) const { |
551 | 0 | GOOGLE_DCHECK_EQ(method->service(), descriptor()); |
552 | 0 | switch(method->index()) { |
553 | 0 | case 0: |
554 | 0 | return ::v2::EchoResponse::default_instance(); |
555 | 0 | default: |
556 | 0 | GOOGLE_LOG(FATAL) << "Bad method index; this should never happen."; |
557 | 0 | return *::PROTOBUF_NAMESPACE_ID::MessageFactory::generated_factory() |
558 | 0 | ->GetPrototype(method->output_type()); |
559 | 0 | } |
560 | 0 | } |
561 | | |
562 | | EchoService_Stub::EchoService_Stub(::PROTOBUF_NAMESPACE_ID::RpcChannel* channel) |
563 | 0 | : channel_(channel), owns_channel_(false) {} |
564 | | EchoService_Stub::EchoService_Stub( |
565 | | ::PROTOBUF_NAMESPACE_ID::RpcChannel* channel, |
566 | | ::PROTOBUF_NAMESPACE_ID::Service::ChannelOwnership ownership) |
567 | 0 | : channel_(channel), |
568 | 0 | owns_channel_(ownership == ::PROTOBUF_NAMESPACE_ID::Service::STUB_OWNS_CHANNEL) {} |
569 | 0 | EchoService_Stub::~EchoService_Stub() { |
570 | 0 | if (owns_channel_) delete channel_; |
571 | 0 | } |
572 | | |
573 | | void EchoService_Stub::Echo(::PROTOBUF_NAMESPACE_ID::RpcController* controller, |
574 | | const ::v2::EchoRequest* request, |
575 | | ::v2::EchoResponse* response, |
576 | 0 | ::google::protobuf::Closure* done) { |
577 | 0 | channel_->CallMethod(descriptor()->method(0), |
578 | 0 | controller, request, response, done); |
579 | 0 | } |
580 | | |
581 | | // @@protoc_insertion_point(namespace_scope) |
582 | | } // namespace v2 |
583 | | PROTOBUF_NAMESPACE_OPEN |
584 | | template<> PROTOBUF_NOINLINE ::v2::EchoRequest* |
585 | 0 | Arena::CreateMaybeMessage< ::v2::EchoRequest >(Arena* arena) { |
586 | 0 | return Arena::CreateMessageInternal< ::v2::EchoRequest >(arena); |
587 | 0 | } |
588 | | template<> PROTOBUF_NOINLINE ::v2::EchoResponse* |
589 | 0 | Arena::CreateMaybeMessage< ::v2::EchoResponse >(Arena* arena) { |
590 | 0 | return Arena::CreateMessageInternal< ::v2::EchoResponse >(arena); |
591 | 0 | } |
592 | | PROTOBUF_NAMESPACE_CLOSE |
593 | | |
594 | | // @@protoc_insertion_point(global_scope) |
595 | | #include <google/protobuf/port_undef.inc> |