/src/brpc/build/test/v2.pb.cc
Line | Count | Source (jump to first uncovered line) |
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/stubs/common.h> |
9 | | #include <google/protobuf/stubs/port.h> |
10 | | #include <google/protobuf/io/coded_stream.h> |
11 | | #include <google/protobuf/wire_format_lite_inl.h> |
12 | | #include <google/protobuf/descriptor.h> |
13 | | #include <google/protobuf/generated_message_reflection.h> |
14 | | #include <google/protobuf/reflection_ops.h> |
15 | | #include <google/protobuf/wire_format.h> |
16 | | // This is a temporary google only hack |
17 | | #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS |
18 | | #include "third_party/protobuf/version.h" |
19 | | #endif |
20 | | // @@protoc_insertion_point(includes) |
21 | | |
22 | | namespace v2 { |
23 | | class EchoRequestDefaultTypeInternal { |
24 | | public: |
25 | | ::google::protobuf::internal::ExplicitlyConstructed<EchoRequest> |
26 | | _instance; |
27 | | } _EchoRequest_default_instance_; |
28 | | class EchoResponseDefaultTypeInternal { |
29 | | public: |
30 | | ::google::protobuf::internal::ExplicitlyConstructed<EchoResponse> |
31 | | _instance; |
32 | | } _EchoResponse_default_instance_; |
33 | | } // namespace v2 |
34 | | namespace protobuf_v2_2eproto { |
35 | 2 | static void InitDefaultsEchoRequest() { |
36 | 2 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
37 | | |
38 | 2 | { |
39 | 2 | void* ptr = &::v2::_EchoRequest_default_instance_; |
40 | 2 | new (ptr) ::v2::EchoRequest(); |
41 | 2 | ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); |
42 | 2 | } |
43 | 2 | ::v2::EchoRequest::InitAsDefaultInstance(); |
44 | 2 | } |
45 | | |
46 | | ::google::protobuf::internal::SCCInfo<0> scc_info_EchoRequest = |
47 | | {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsEchoRequest}, {}}; |
48 | | |
49 | 2 | static void InitDefaultsEchoResponse() { |
50 | 2 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
51 | | |
52 | 2 | { |
53 | 2 | void* ptr = &::v2::_EchoResponse_default_instance_; |
54 | 2 | new (ptr) ::v2::EchoResponse(); |
55 | 2 | ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); |
56 | 2 | } |
57 | 2 | ::v2::EchoResponse::InitAsDefaultInstance(); |
58 | 2 | } |
59 | | |
60 | | ::google::protobuf::internal::SCCInfo<0> scc_info_EchoResponse = |
61 | | {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsEchoResponse}, {}}; |
62 | | |
63 | 2 | void InitDefaults() { |
64 | 2 | ::google::protobuf::internal::InitSCC(&scc_info_EchoRequest.base); |
65 | 2 | ::google::protobuf::internal::InitSCC(&scc_info_EchoResponse.base); |
66 | 2 | } |
67 | | |
68 | | ::google::protobuf::Metadata file_level_metadata[2]; |
69 | | const ::google::protobuf::ServiceDescriptor* file_level_service_descriptors[1]; |
70 | | |
71 | | const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { |
72 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::v2::EchoRequest, _has_bits_), |
73 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::v2::EchoRequest, _internal_metadata_), |
74 | | ~0u, // no _extensions_ |
75 | | ~0u, // no _oneof_case_ |
76 | | ~0u, // no _weak_field_map_ |
77 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::v2::EchoRequest, value_), |
78 | | 0, |
79 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::v2::EchoResponse, _has_bits_), |
80 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::v2::EchoResponse, _internal_metadata_), |
81 | | ~0u, // no _extensions_ |
82 | | ~0u, // no _oneof_case_ |
83 | | ~0u, // no _weak_field_map_ |
84 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::v2::EchoResponse, value_), |
85 | | 0, |
86 | | }; |
87 | | static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { |
88 | | { 0, 6, sizeof(::v2::EchoRequest)}, |
89 | | { 7, 13, sizeof(::v2::EchoResponse)}, |
90 | | }; |
91 | | |
92 | | static ::google::protobuf::Message const * const file_default_instances[] = { |
93 | | reinterpret_cast<const ::google::protobuf::Message*>(&::v2::_EchoRequest_default_instance_), |
94 | | reinterpret_cast<const ::google::protobuf::Message*>(&::v2::_EchoResponse_default_instance_), |
95 | | }; |
96 | | |
97 | 0 | void protobuf_AssignDescriptors() { |
98 | 0 | AddDescriptors(); |
99 | 0 | AssignDescriptors( |
100 | 0 | "v2.proto", schemas, file_default_instances, TableStruct::offsets, |
101 | 0 | file_level_metadata, NULL, file_level_service_descriptors); |
102 | 0 | } |
103 | | |
104 | 0 | void protobuf_AssignDescriptorsOnce() { |
105 | 0 | static ::google::protobuf::internal::once_flag once; |
106 | 0 | ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); |
107 | 0 | } |
108 | | |
109 | | void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; |
110 | 0 | void protobuf_RegisterTypes(const ::std::string&) { |
111 | 0 | protobuf_AssignDescriptorsOnce(); |
112 | 0 | ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2); |
113 | 0 | } |
114 | | |
115 | 2 | void AddDescriptorsImpl() { |
116 | 2 | InitDefaults(); |
117 | 2 | static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { |
118 | 2 | "\n\010v2.proto\022\002v2\"\034\n\013EchoRequest\022\r\n\005value\030\001" |
119 | 2 | " \002(\005\"\035\n\014EchoResponse\022\r\n\005value\030\001 \002(\00528\n\013E" |
120 | 2 | "choService\022)\n\004Echo\022\017.v2.EchoRequest\032\020.v2" |
121 | 2 | ".EchoResponseB\003\200\001\001" |
122 | 2 | }; |
123 | 2 | ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( |
124 | 2 | descriptor, 138); |
125 | 2 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( |
126 | 2 | "v2.proto", &protobuf_RegisterTypes); |
127 | 2 | } |
128 | | |
129 | 2 | void AddDescriptors() { |
130 | 2 | static ::google::protobuf::internal::once_flag once; |
131 | 2 | ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); |
132 | 2 | } |
133 | | // Force AddDescriptors() to be called at dynamic initialization time. |
134 | | struct StaticDescriptorInitializer { |
135 | 2 | StaticDescriptorInitializer() { |
136 | 2 | AddDescriptors(); |
137 | 2 | } |
138 | | } static_descriptor_initializer; |
139 | | } // namespace protobuf_v2_2eproto |
140 | | namespace v2 { |
141 | | |
142 | | // =================================================================== |
143 | | |
144 | 2 | void EchoRequest::InitAsDefaultInstance() { |
145 | 2 | } |
146 | | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
147 | | const int EchoRequest::kValueFieldNumber; |
148 | | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
149 | | |
150 | | EchoRequest::EchoRequest() |
151 | 2 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
152 | 2 | ::google::protobuf::internal::InitSCC( |
153 | 2 | &protobuf_v2_2eproto::scc_info_EchoRequest.base); |
154 | 2 | SharedCtor(); |
155 | | // @@protoc_insertion_point(constructor:v2.EchoRequest) |
156 | 2 | } |
157 | | EchoRequest::EchoRequest(const EchoRequest& from) |
158 | 0 | : ::google::protobuf::Message(), |
159 | 0 | _internal_metadata_(NULL), |
160 | 0 | _has_bits_(from._has_bits_) { |
161 | 0 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
162 | 0 | value_ = from.value_; |
163 | | // @@protoc_insertion_point(copy_constructor:v2.EchoRequest) |
164 | 0 | } |
165 | | |
166 | 2 | void EchoRequest::SharedCtor() { |
167 | 2 | value_ = 0; |
168 | 2 | } |
169 | | |
170 | 0 | EchoRequest::~EchoRequest() { |
171 | | // @@protoc_insertion_point(destructor:v2.EchoRequest) |
172 | 0 | SharedDtor(); |
173 | 0 | } |
174 | | |
175 | 0 | void EchoRequest::SharedDtor() { |
176 | 0 | } |
177 | | |
178 | 0 | void EchoRequest::SetCachedSize(int size) const { |
179 | 0 | _cached_size_.Set(size); |
180 | 0 | } |
181 | 0 | const ::google::protobuf::Descriptor* EchoRequest::descriptor() { |
182 | 0 | ::protobuf_v2_2eproto::protobuf_AssignDescriptorsOnce(); |
183 | 0 | return ::protobuf_v2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; |
184 | 0 | } |
185 | | |
186 | 0 | const EchoRequest& EchoRequest::default_instance() { |
187 | 0 | ::google::protobuf::internal::InitSCC(&protobuf_v2_2eproto::scc_info_EchoRequest.base); |
188 | 0 | return *internal_default_instance(); |
189 | 0 | } |
190 | | |
191 | | |
192 | 0 | void EchoRequest::Clear() { |
193 | | // @@protoc_insertion_point(message_clear_start:v2.EchoRequest) |
194 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
195 | | // Prevent compiler warnings about cached_has_bits being unused |
196 | 0 | (void) cached_has_bits; |
197 | |
|
198 | 0 | value_ = 0; |
199 | 0 | _has_bits_.Clear(); |
200 | 0 | _internal_metadata_.Clear(); |
201 | 0 | } |
202 | | |
203 | | bool EchoRequest::MergePartialFromCodedStream( |
204 | 0 | ::google::protobuf::io::CodedInputStream* input) { |
205 | 0 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure |
206 | 0 | ::google::protobuf::uint32 tag; |
207 | | // @@protoc_insertion_point(parse_start:v2.EchoRequest) |
208 | 0 | for (;;) { |
209 | 0 | ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); |
210 | 0 | tag = p.first; |
211 | 0 | if (!p.second) goto handle_unusual; |
212 | 0 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
213 | | // required int32 value = 1; |
214 | 0 | case 1: { |
215 | 0 | if (static_cast< ::google::protobuf::uint8>(tag) == |
216 | 0 | static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { |
217 | 0 | set_has_value(); |
218 | 0 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
219 | 0 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( |
220 | 0 | input, &value_))); |
221 | 0 | } else { |
222 | 0 | goto handle_unusual; |
223 | 0 | } |
224 | 0 | break; |
225 | 0 | } |
226 | | |
227 | 0 | default: { |
228 | 0 | handle_unusual: |
229 | 0 | if (tag == 0) { |
230 | 0 | goto success; |
231 | 0 | } |
232 | 0 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
233 | 0 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
234 | 0 | break; |
235 | 0 | } |
236 | 0 | } |
237 | 0 | } |
238 | 0 | success: |
239 | | // @@protoc_insertion_point(parse_success:v2.EchoRequest) |
240 | 0 | return true; |
241 | 0 | failure: |
242 | | // @@protoc_insertion_point(parse_failure:v2.EchoRequest) |
243 | 0 | return false; |
244 | 0 | #undef DO_ |
245 | 0 | } |
246 | | |
247 | | void EchoRequest::SerializeWithCachedSizes( |
248 | 0 | ::google::protobuf::io::CodedOutputStream* output) const { |
249 | | // @@protoc_insertion_point(serialize_start:v2.EchoRequest) |
250 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
251 | 0 | (void) cached_has_bits; |
252 | |
|
253 | 0 | cached_has_bits = _has_bits_[0]; |
254 | | // required int32 value = 1; |
255 | 0 | if (cached_has_bits & 0x00000001u) { |
256 | 0 | ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->value(), output); |
257 | 0 | } |
258 | |
|
259 | 0 | if (_internal_metadata_.have_unknown_fields()) { |
260 | 0 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
261 | 0 | _internal_metadata_.unknown_fields(), output); |
262 | 0 | } |
263 | | // @@protoc_insertion_point(serialize_end:v2.EchoRequest) |
264 | 0 | } |
265 | | |
266 | | ::google::protobuf::uint8* EchoRequest::InternalSerializeWithCachedSizesToArray( |
267 | 0 | bool deterministic, ::google::protobuf::uint8* target) const { |
268 | 0 | (void)deterministic; // Unused |
269 | | // @@protoc_insertion_point(serialize_to_array_start:v2.EchoRequest) |
270 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
271 | 0 | (void) cached_has_bits; |
272 | |
|
273 | 0 | cached_has_bits = _has_bits_[0]; |
274 | | // required int32 value = 1; |
275 | 0 | if (cached_has_bits & 0x00000001u) { |
276 | 0 | target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->value(), target); |
277 | 0 | } |
278 | |
|
279 | 0 | if (_internal_metadata_.have_unknown_fields()) { |
280 | 0 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
281 | 0 | _internal_metadata_.unknown_fields(), target); |
282 | 0 | } |
283 | | // @@protoc_insertion_point(serialize_to_array_end:v2.EchoRequest) |
284 | 0 | return target; |
285 | 0 | } |
286 | | |
287 | 0 | size_t EchoRequest::ByteSizeLong() const { |
288 | | // @@protoc_insertion_point(message_byte_size_start:v2.EchoRequest) |
289 | 0 | size_t total_size = 0; |
290 | |
|
291 | 0 | if (_internal_metadata_.have_unknown_fields()) { |
292 | 0 | total_size += |
293 | 0 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
294 | 0 | _internal_metadata_.unknown_fields()); |
295 | 0 | } |
296 | | // required int32 value = 1; |
297 | 0 | if (has_value()) { |
298 | 0 | total_size += 1 + |
299 | 0 | ::google::protobuf::internal::WireFormatLite::Int32Size( |
300 | 0 | this->value()); |
301 | 0 | } |
302 | 0 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); |
303 | 0 | SetCachedSize(cached_size); |
304 | 0 | return total_size; |
305 | 0 | } |
306 | | |
307 | 0 | void EchoRequest::MergeFrom(const ::google::protobuf::Message& from) { |
308 | | // @@protoc_insertion_point(generalized_merge_from_start:v2.EchoRequest) |
309 | 0 | GOOGLE_DCHECK_NE(&from, this); |
310 | 0 | const EchoRequest* source = |
311 | 0 | ::google::protobuf::internal::DynamicCastToGenerated<const EchoRequest>( |
312 | 0 | &from); |
313 | 0 | if (source == NULL) { |
314 | | // @@protoc_insertion_point(generalized_merge_from_cast_fail:v2.EchoRequest) |
315 | 0 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
316 | 0 | } else { |
317 | | // @@protoc_insertion_point(generalized_merge_from_cast_success:v2.EchoRequest) |
318 | 0 | MergeFrom(*source); |
319 | 0 | } |
320 | 0 | } |
321 | | |
322 | 0 | void EchoRequest::MergeFrom(const EchoRequest& from) { |
323 | | // @@protoc_insertion_point(class_specific_merge_from_start:v2.EchoRequest) |
324 | 0 | GOOGLE_DCHECK_NE(&from, this); |
325 | 0 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
326 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
327 | 0 | (void) cached_has_bits; |
328 | |
|
329 | 0 | if (from.has_value()) { |
330 | 0 | set_value(from.value()); |
331 | 0 | } |
332 | 0 | } |
333 | | |
334 | 0 | void EchoRequest::CopyFrom(const ::google::protobuf::Message& from) { |
335 | | // @@protoc_insertion_point(generalized_copy_from_start:v2.EchoRequest) |
336 | 0 | if (&from == this) return; |
337 | 0 | Clear(); |
338 | 0 | MergeFrom(from); |
339 | 0 | } |
340 | | |
341 | 0 | void EchoRequest::CopyFrom(const EchoRequest& from) { |
342 | | // @@protoc_insertion_point(class_specific_copy_from_start:v2.EchoRequest) |
343 | 0 | if (&from == this) return; |
344 | 0 | Clear(); |
345 | 0 | MergeFrom(from); |
346 | 0 | } |
347 | | |
348 | 0 | bool EchoRequest::IsInitialized() const { |
349 | 0 | if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; |
350 | 0 | return true; |
351 | 0 | } |
352 | | |
353 | 0 | void EchoRequest::Swap(EchoRequest* other) { |
354 | 0 | if (other == this) return; |
355 | 0 | InternalSwap(other); |
356 | 0 | } |
357 | 0 | void EchoRequest::InternalSwap(EchoRequest* other) { |
358 | 0 | using std::swap; |
359 | 0 | swap(value_, other->value_); |
360 | 0 | swap(_has_bits_[0], other->_has_bits_[0]); |
361 | 0 | _internal_metadata_.Swap(&other->_internal_metadata_); |
362 | 0 | } |
363 | | |
364 | 0 | ::google::protobuf::Metadata EchoRequest::GetMetadata() const { |
365 | 0 | protobuf_v2_2eproto::protobuf_AssignDescriptorsOnce(); |
366 | 0 | return ::protobuf_v2_2eproto::file_level_metadata[kIndexInFileMessages]; |
367 | 0 | } |
368 | | |
369 | | |
370 | | // =================================================================== |
371 | | |
372 | 2 | void EchoResponse::InitAsDefaultInstance() { |
373 | 2 | } |
374 | | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
375 | | const int EchoResponse::kValueFieldNumber; |
376 | | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
377 | | |
378 | | EchoResponse::EchoResponse() |
379 | 2 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
380 | 2 | ::google::protobuf::internal::InitSCC( |
381 | 2 | &protobuf_v2_2eproto::scc_info_EchoResponse.base); |
382 | 2 | SharedCtor(); |
383 | | // @@protoc_insertion_point(constructor:v2.EchoResponse) |
384 | 2 | } |
385 | | EchoResponse::EchoResponse(const EchoResponse& from) |
386 | 0 | : ::google::protobuf::Message(), |
387 | 0 | _internal_metadata_(NULL), |
388 | 0 | _has_bits_(from._has_bits_) { |
389 | 0 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
390 | 0 | value_ = from.value_; |
391 | | // @@protoc_insertion_point(copy_constructor:v2.EchoResponse) |
392 | 0 | } |
393 | | |
394 | 2 | void EchoResponse::SharedCtor() { |
395 | 2 | value_ = 0; |
396 | 2 | } |
397 | | |
398 | 0 | EchoResponse::~EchoResponse() { |
399 | | // @@protoc_insertion_point(destructor:v2.EchoResponse) |
400 | 0 | SharedDtor(); |
401 | 0 | } |
402 | | |
403 | 0 | void EchoResponse::SharedDtor() { |
404 | 0 | } |
405 | | |
406 | 0 | void EchoResponse::SetCachedSize(int size) const { |
407 | 0 | _cached_size_.Set(size); |
408 | 0 | } |
409 | 0 | const ::google::protobuf::Descriptor* EchoResponse::descriptor() { |
410 | 0 | ::protobuf_v2_2eproto::protobuf_AssignDescriptorsOnce(); |
411 | 0 | return ::protobuf_v2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; |
412 | 0 | } |
413 | | |
414 | 0 | const EchoResponse& EchoResponse::default_instance() { |
415 | 0 | ::google::protobuf::internal::InitSCC(&protobuf_v2_2eproto::scc_info_EchoResponse.base); |
416 | 0 | return *internal_default_instance(); |
417 | 0 | } |
418 | | |
419 | | |
420 | 0 | void EchoResponse::Clear() { |
421 | | // @@protoc_insertion_point(message_clear_start:v2.EchoResponse) |
422 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
423 | | // Prevent compiler warnings about cached_has_bits being unused |
424 | 0 | (void) cached_has_bits; |
425 | |
|
426 | 0 | value_ = 0; |
427 | 0 | _has_bits_.Clear(); |
428 | 0 | _internal_metadata_.Clear(); |
429 | 0 | } |
430 | | |
431 | | bool EchoResponse::MergePartialFromCodedStream( |
432 | 0 | ::google::protobuf::io::CodedInputStream* input) { |
433 | 0 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure |
434 | 0 | ::google::protobuf::uint32 tag; |
435 | | // @@protoc_insertion_point(parse_start:v2.EchoResponse) |
436 | 0 | for (;;) { |
437 | 0 | ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); |
438 | 0 | tag = p.first; |
439 | 0 | if (!p.second) goto handle_unusual; |
440 | 0 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
441 | | // required int32 value = 1; |
442 | 0 | case 1: { |
443 | 0 | if (static_cast< ::google::protobuf::uint8>(tag) == |
444 | 0 | static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { |
445 | 0 | set_has_value(); |
446 | 0 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
447 | 0 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( |
448 | 0 | input, &value_))); |
449 | 0 | } else { |
450 | 0 | goto handle_unusual; |
451 | 0 | } |
452 | 0 | break; |
453 | 0 | } |
454 | | |
455 | 0 | default: { |
456 | 0 | handle_unusual: |
457 | 0 | if (tag == 0) { |
458 | 0 | goto success; |
459 | 0 | } |
460 | 0 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
461 | 0 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
462 | 0 | break; |
463 | 0 | } |
464 | 0 | } |
465 | 0 | } |
466 | 0 | success: |
467 | | // @@protoc_insertion_point(parse_success:v2.EchoResponse) |
468 | 0 | return true; |
469 | 0 | failure: |
470 | | // @@protoc_insertion_point(parse_failure:v2.EchoResponse) |
471 | 0 | return false; |
472 | 0 | #undef DO_ |
473 | 0 | } |
474 | | |
475 | | void EchoResponse::SerializeWithCachedSizes( |
476 | 0 | ::google::protobuf::io::CodedOutputStream* output) const { |
477 | | // @@protoc_insertion_point(serialize_start:v2.EchoResponse) |
478 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
479 | 0 | (void) cached_has_bits; |
480 | |
|
481 | 0 | cached_has_bits = _has_bits_[0]; |
482 | | // required int32 value = 1; |
483 | 0 | if (cached_has_bits & 0x00000001u) { |
484 | 0 | ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->value(), output); |
485 | 0 | } |
486 | |
|
487 | 0 | if (_internal_metadata_.have_unknown_fields()) { |
488 | 0 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
489 | 0 | _internal_metadata_.unknown_fields(), output); |
490 | 0 | } |
491 | | // @@protoc_insertion_point(serialize_end:v2.EchoResponse) |
492 | 0 | } |
493 | | |
494 | | ::google::protobuf::uint8* EchoResponse::InternalSerializeWithCachedSizesToArray( |
495 | 0 | bool deterministic, ::google::protobuf::uint8* target) const { |
496 | 0 | (void)deterministic; // Unused |
497 | | // @@protoc_insertion_point(serialize_to_array_start:v2.EchoResponse) |
498 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
499 | 0 | (void) cached_has_bits; |
500 | |
|
501 | 0 | cached_has_bits = _has_bits_[0]; |
502 | | // required int32 value = 1; |
503 | 0 | if (cached_has_bits & 0x00000001u) { |
504 | 0 | target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->value(), target); |
505 | 0 | } |
506 | |
|
507 | 0 | if (_internal_metadata_.have_unknown_fields()) { |
508 | 0 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
509 | 0 | _internal_metadata_.unknown_fields(), target); |
510 | 0 | } |
511 | | // @@protoc_insertion_point(serialize_to_array_end:v2.EchoResponse) |
512 | 0 | return target; |
513 | 0 | } |
514 | | |
515 | 0 | size_t EchoResponse::ByteSizeLong() const { |
516 | | // @@protoc_insertion_point(message_byte_size_start:v2.EchoResponse) |
517 | 0 | size_t total_size = 0; |
518 | |
|
519 | 0 | if (_internal_metadata_.have_unknown_fields()) { |
520 | 0 | total_size += |
521 | 0 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
522 | 0 | _internal_metadata_.unknown_fields()); |
523 | 0 | } |
524 | | // required int32 value = 1; |
525 | 0 | if (has_value()) { |
526 | 0 | total_size += 1 + |
527 | 0 | ::google::protobuf::internal::WireFormatLite::Int32Size( |
528 | 0 | this->value()); |
529 | 0 | } |
530 | 0 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); |
531 | 0 | SetCachedSize(cached_size); |
532 | 0 | return total_size; |
533 | 0 | } |
534 | | |
535 | 0 | void EchoResponse::MergeFrom(const ::google::protobuf::Message& from) { |
536 | | // @@protoc_insertion_point(generalized_merge_from_start:v2.EchoResponse) |
537 | 0 | GOOGLE_DCHECK_NE(&from, this); |
538 | 0 | const EchoResponse* source = |
539 | 0 | ::google::protobuf::internal::DynamicCastToGenerated<const EchoResponse>( |
540 | 0 | &from); |
541 | 0 | if (source == NULL) { |
542 | | // @@protoc_insertion_point(generalized_merge_from_cast_fail:v2.EchoResponse) |
543 | 0 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
544 | 0 | } else { |
545 | | // @@protoc_insertion_point(generalized_merge_from_cast_success:v2.EchoResponse) |
546 | 0 | MergeFrom(*source); |
547 | 0 | } |
548 | 0 | } |
549 | | |
550 | 0 | void EchoResponse::MergeFrom(const EchoResponse& from) { |
551 | | // @@protoc_insertion_point(class_specific_merge_from_start:v2.EchoResponse) |
552 | 0 | GOOGLE_DCHECK_NE(&from, this); |
553 | 0 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
554 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
555 | 0 | (void) cached_has_bits; |
556 | |
|
557 | 0 | if (from.has_value()) { |
558 | 0 | set_value(from.value()); |
559 | 0 | } |
560 | 0 | } |
561 | | |
562 | 0 | void EchoResponse::CopyFrom(const ::google::protobuf::Message& from) { |
563 | | // @@protoc_insertion_point(generalized_copy_from_start:v2.EchoResponse) |
564 | 0 | if (&from == this) return; |
565 | 0 | Clear(); |
566 | 0 | MergeFrom(from); |
567 | 0 | } |
568 | | |
569 | 0 | void EchoResponse::CopyFrom(const EchoResponse& from) { |
570 | | // @@protoc_insertion_point(class_specific_copy_from_start:v2.EchoResponse) |
571 | 0 | if (&from == this) return; |
572 | 0 | Clear(); |
573 | 0 | MergeFrom(from); |
574 | 0 | } |
575 | | |
576 | 0 | bool EchoResponse::IsInitialized() const { |
577 | 0 | if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; |
578 | 0 | return true; |
579 | 0 | } |
580 | | |
581 | 0 | void EchoResponse::Swap(EchoResponse* other) { |
582 | 0 | if (other == this) return; |
583 | 0 | InternalSwap(other); |
584 | 0 | } |
585 | 0 | void EchoResponse::InternalSwap(EchoResponse* other) { |
586 | 0 | using std::swap; |
587 | 0 | swap(value_, other->value_); |
588 | 0 | swap(_has_bits_[0], other->_has_bits_[0]); |
589 | 0 | _internal_metadata_.Swap(&other->_internal_metadata_); |
590 | 0 | } |
591 | | |
592 | 0 | ::google::protobuf::Metadata EchoResponse::GetMetadata() const { |
593 | 0 | protobuf_v2_2eproto::protobuf_AssignDescriptorsOnce(); |
594 | 0 | return ::protobuf_v2_2eproto::file_level_metadata[kIndexInFileMessages]; |
595 | 0 | } |
596 | | |
597 | | |
598 | | // =================================================================== |
599 | | |
600 | 0 | EchoService::~EchoService() {} |
601 | | |
602 | 0 | const ::google::protobuf::ServiceDescriptor* EchoService::descriptor() { |
603 | 0 | protobuf_v2_2eproto::protobuf_AssignDescriptorsOnce(); |
604 | 0 | return protobuf_v2_2eproto::file_level_service_descriptors[0]; |
605 | 0 | } |
606 | | |
607 | 0 | const ::google::protobuf::ServiceDescriptor* EchoService::GetDescriptor() { |
608 | 0 | return descriptor(); |
609 | 0 | } |
610 | | |
611 | | void EchoService::Echo(::google::protobuf::RpcController* controller, |
612 | | const ::v2::EchoRequest*, |
613 | | ::v2::EchoResponse*, |
614 | 0 | ::google::protobuf::Closure* done) { |
615 | 0 | controller->SetFailed("Method Echo() not implemented."); |
616 | 0 | done->Run(); |
617 | 0 | } |
618 | | |
619 | | void EchoService::CallMethod(const ::google::protobuf::MethodDescriptor* method, |
620 | | ::google::protobuf::RpcController* controller, |
621 | | const ::google::protobuf::Message* request, |
622 | | ::google::protobuf::Message* response, |
623 | 0 | ::google::protobuf::Closure* done) { |
624 | 0 | GOOGLE_DCHECK_EQ(method->service(), protobuf_v2_2eproto::file_level_service_descriptors[0]); |
625 | 0 | switch(method->index()) { |
626 | 0 | case 0: |
627 | 0 | Echo(controller, |
628 | 0 | ::google::protobuf::down_cast<const ::v2::EchoRequest*>(request), |
629 | 0 | ::google::protobuf::down_cast< ::v2::EchoResponse*>(response), |
630 | 0 | done); |
631 | 0 | break; |
632 | 0 | default: |
633 | 0 | GOOGLE_LOG(FATAL) << "Bad method index; this should never happen."; |
634 | 0 | break; |
635 | 0 | } |
636 | 0 | } |
637 | | |
638 | | const ::google::protobuf::Message& EchoService::GetRequestPrototype( |
639 | 0 | const ::google::protobuf::MethodDescriptor* method) const { |
640 | 0 | GOOGLE_DCHECK_EQ(method->service(), descriptor()); |
641 | 0 | switch(method->index()) { |
642 | 0 | case 0: |
643 | 0 | return ::v2::EchoRequest::default_instance(); |
644 | 0 | default: |
645 | 0 | GOOGLE_LOG(FATAL) << "Bad method index; this should never happen."; |
646 | 0 | return *::google::protobuf::MessageFactory::generated_factory() |
647 | 0 | ->GetPrototype(method->input_type()); |
648 | 0 | } |
649 | 0 | } |
650 | | |
651 | | const ::google::protobuf::Message& EchoService::GetResponsePrototype( |
652 | 0 | const ::google::protobuf::MethodDescriptor* method) const { |
653 | 0 | GOOGLE_DCHECK_EQ(method->service(), descriptor()); |
654 | 0 | switch(method->index()) { |
655 | 0 | case 0: |
656 | 0 | return ::v2::EchoResponse::default_instance(); |
657 | 0 | default: |
658 | 0 | GOOGLE_LOG(FATAL) << "Bad method index; this should never happen."; |
659 | 0 | return *::google::protobuf::MessageFactory::generated_factory() |
660 | 0 | ->GetPrototype(method->output_type()); |
661 | 0 | } |
662 | 0 | } |
663 | | |
664 | | EchoService_Stub::EchoService_Stub(::google::protobuf::RpcChannel* channel) |
665 | 0 | : channel_(channel), owns_channel_(false) {} |
666 | | EchoService_Stub::EchoService_Stub( |
667 | | ::google::protobuf::RpcChannel* channel, |
668 | | ::google::protobuf::Service::ChannelOwnership ownership) |
669 | 0 | : channel_(channel), |
670 | 0 | owns_channel_(ownership == ::google::protobuf::Service::STUB_OWNS_CHANNEL) {} |
671 | 0 | EchoService_Stub::~EchoService_Stub() { |
672 | 0 | if (owns_channel_) delete channel_; |
673 | 0 | } |
674 | | |
675 | | void EchoService_Stub::Echo(::google::protobuf::RpcController* controller, |
676 | | const ::v2::EchoRequest* request, |
677 | | ::v2::EchoResponse* response, |
678 | 0 | ::google::protobuf::Closure* done) { |
679 | 0 | channel_->CallMethod(descriptor()->method(0), |
680 | 0 | controller, request, response, done); |
681 | 0 | } |
682 | | |
683 | | // @@protoc_insertion_point(namespace_scope) |
684 | | } // namespace v2 |
685 | | namespace google { |
686 | | namespace protobuf { |
687 | 0 | template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::v2::EchoRequest* Arena::CreateMaybeMessage< ::v2::EchoRequest >(Arena* arena) { |
688 | 0 | return Arena::CreateInternal< ::v2::EchoRequest >(arena); |
689 | 0 | } |
690 | 0 | template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::v2::EchoResponse* Arena::CreateMaybeMessage< ::v2::EchoResponse >(Arena* arena) { |
691 | 0 | return Arena::CreateInternal< ::v2::EchoResponse >(arena); |
692 | 0 | } |
693 | | } // namespace protobuf |
694 | | } // namespace google |
695 | | |
696 | | // @@protoc_insertion_point(global_scope) |