/src/brpc/build/test/grpc.pb.cc
Line | Count | Source (jump to first uncovered line) |
1 | | // Generated by the protocol buffer compiler. DO NOT EDIT! |
2 | | // source: grpc.proto |
3 | | |
4 | | #include "grpc.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 test { |
23 | | class GrpcRequestDefaultTypeInternal { |
24 | | public: |
25 | | ::google::protobuf::internal::ExplicitlyConstructed<GrpcRequest> |
26 | | _instance; |
27 | | } _GrpcRequest_default_instance_; |
28 | | class GrpcResponseDefaultTypeInternal { |
29 | | public: |
30 | | ::google::protobuf::internal::ExplicitlyConstructed<GrpcResponse> |
31 | | _instance; |
32 | | } _GrpcResponse_default_instance_; |
33 | | } // namespace test |
34 | | namespace protobuf_grpc_2eproto { |
35 | 2 | static void InitDefaultsGrpcRequest() { |
36 | 2 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
37 | | |
38 | 2 | { |
39 | 2 | void* ptr = &::test::_GrpcRequest_default_instance_; |
40 | 2 | new (ptr) ::test::GrpcRequest(); |
41 | 2 | ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); |
42 | 2 | } |
43 | 2 | ::test::GrpcRequest::InitAsDefaultInstance(); |
44 | 2 | } |
45 | | |
46 | | ::google::protobuf::internal::SCCInfo<0> scc_info_GrpcRequest = |
47 | | {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGrpcRequest}, {}}; |
48 | | |
49 | 2 | static void InitDefaultsGrpcResponse() { |
50 | 2 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
51 | | |
52 | 2 | { |
53 | 2 | void* ptr = &::test::_GrpcResponse_default_instance_; |
54 | 2 | new (ptr) ::test::GrpcResponse(); |
55 | 2 | ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); |
56 | 2 | } |
57 | 2 | ::test::GrpcResponse::InitAsDefaultInstance(); |
58 | 2 | } |
59 | | |
60 | | ::google::protobuf::internal::SCCInfo<0> scc_info_GrpcResponse = |
61 | | {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGrpcResponse}, {}}; |
62 | | |
63 | 2 | void InitDefaults() { |
64 | 2 | ::google::protobuf::internal::InitSCC(&scc_info_GrpcRequest.base); |
65 | 2 | ::google::protobuf::internal::InitSCC(&scc_info_GrpcResponse.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(::test::GrpcRequest, _has_bits_), |
73 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::test::GrpcRequest, _internal_metadata_), |
74 | | ~0u, // no _extensions_ |
75 | | ~0u, // no _oneof_case_ |
76 | | ~0u, // no _weak_field_map_ |
77 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::test::GrpcRequest, message_), |
78 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::test::GrpcRequest, gzip_), |
79 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::test::GrpcRequest, return_error_), |
80 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::test::GrpcRequest, timeout_us_), |
81 | | 0, |
82 | | 2, |
83 | | 3, |
84 | | 1, |
85 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::test::GrpcResponse, _has_bits_), |
86 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::test::GrpcResponse, _internal_metadata_), |
87 | | ~0u, // no _extensions_ |
88 | | ~0u, // no _oneof_case_ |
89 | | ~0u, // no _weak_field_map_ |
90 | | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::test::GrpcResponse, message_), |
91 | | 0, |
92 | | }; |
93 | | static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { |
94 | | { 0, 9, sizeof(::test::GrpcRequest)}, |
95 | | { 13, 19, sizeof(::test::GrpcResponse)}, |
96 | | }; |
97 | | |
98 | | static ::google::protobuf::Message const * const file_default_instances[] = { |
99 | | reinterpret_cast<const ::google::protobuf::Message*>(&::test::_GrpcRequest_default_instance_), |
100 | | reinterpret_cast<const ::google::protobuf::Message*>(&::test::_GrpcResponse_default_instance_), |
101 | | }; |
102 | | |
103 | 0 | void protobuf_AssignDescriptors() { |
104 | 0 | AddDescriptors(); |
105 | 0 | AssignDescriptors( |
106 | 0 | "grpc.proto", schemas, file_default_instances, TableStruct::offsets, |
107 | 0 | file_level_metadata, NULL, file_level_service_descriptors); |
108 | 0 | } |
109 | | |
110 | 0 | void protobuf_AssignDescriptorsOnce() { |
111 | 0 | static ::google::protobuf::internal::once_flag once; |
112 | 0 | ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); |
113 | 0 | } |
114 | | |
115 | | void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; |
116 | 0 | void protobuf_RegisterTypes(const ::std::string&) { |
117 | 0 | protobuf_AssignDescriptorsOnce(); |
118 | 0 | ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2); |
119 | 0 | } |
120 | | |
121 | 2 | void AddDescriptorsImpl() { |
122 | 2 | InitDefaults(); |
123 | 2 | static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { |
124 | 2 | "\n\ngrpc.proto\022\004test\"V\n\013GrpcRequest\022\017\n\007mes" |
125 | 2 | "sage\030\001 \002(\t\022\014\n\004gzip\030\002 \002(\010\022\024\n\014return_error" |
126 | 2 | "\030\003 \002(\010\022\022\n\ntimeout_us\030\004 \001(\003\"\037\n\014GrpcRespon" |
127 | 2 | "se\022\017\n\007message\030\001 \002(\t2\257\001\n\013GrpcService\022/\n\006M" |
128 | 2 | "ethod\022\021.test.GrpcRequest\032\022.test.GrpcResp" |
129 | 2 | "onse\0226\n\rMethodTimeOut\022\021.test.GrpcRequest" |
130 | 2 | "\032\022.test.GrpcResponse\0227\n\016MethodNotExist\022\021" |
131 | 2 | ".test.GrpcRequest\032\022.test.GrpcResponseB\003\200" |
132 | 2 | "\001\001" |
133 | 2 | }; |
134 | 2 | ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( |
135 | 2 | descriptor, 322); |
136 | 2 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( |
137 | 2 | "grpc.proto", &protobuf_RegisterTypes); |
138 | 2 | } |
139 | | |
140 | 2 | void AddDescriptors() { |
141 | 2 | static ::google::protobuf::internal::once_flag once; |
142 | 2 | ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); |
143 | 2 | } |
144 | | // Force AddDescriptors() to be called at dynamic initialization time. |
145 | | struct StaticDescriptorInitializer { |
146 | 2 | StaticDescriptorInitializer() { |
147 | 2 | AddDescriptors(); |
148 | 2 | } |
149 | | } static_descriptor_initializer; |
150 | | } // namespace protobuf_grpc_2eproto |
151 | | namespace test { |
152 | | |
153 | | // =================================================================== |
154 | | |
155 | 2 | void GrpcRequest::InitAsDefaultInstance() { |
156 | 2 | } |
157 | | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
158 | | const int GrpcRequest::kMessageFieldNumber; |
159 | | const int GrpcRequest::kGzipFieldNumber; |
160 | | const int GrpcRequest::kReturnErrorFieldNumber; |
161 | | const int GrpcRequest::kTimeoutUsFieldNumber; |
162 | | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
163 | | |
164 | | GrpcRequest::GrpcRequest() |
165 | 2 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
166 | 2 | ::google::protobuf::internal::InitSCC( |
167 | 2 | &protobuf_grpc_2eproto::scc_info_GrpcRequest.base); |
168 | 2 | SharedCtor(); |
169 | | // @@protoc_insertion_point(constructor:test.GrpcRequest) |
170 | 2 | } |
171 | | GrpcRequest::GrpcRequest(const GrpcRequest& from) |
172 | 0 | : ::google::protobuf::Message(), |
173 | 0 | _internal_metadata_(NULL), |
174 | 0 | _has_bits_(from._has_bits_) { |
175 | 0 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
176 | 0 | message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
177 | 0 | if (from.has_message()) { |
178 | 0 | message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message_); |
179 | 0 | } |
180 | 0 | ::memcpy(&timeout_us_, &from.timeout_us_, |
181 | 0 | static_cast<size_t>(reinterpret_cast<char*>(&return_error_) - |
182 | 0 | reinterpret_cast<char*>(&timeout_us_)) + sizeof(return_error_)); |
183 | | // @@protoc_insertion_point(copy_constructor:test.GrpcRequest) |
184 | 0 | } |
185 | | |
186 | 2 | void GrpcRequest::SharedCtor() { |
187 | 2 | message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
188 | 2 | ::memset(&timeout_us_, 0, static_cast<size_t>( |
189 | 2 | reinterpret_cast<char*>(&return_error_) - |
190 | 2 | reinterpret_cast<char*>(&timeout_us_)) + sizeof(return_error_)); |
191 | 2 | } |
192 | | |
193 | 0 | GrpcRequest::~GrpcRequest() { |
194 | | // @@protoc_insertion_point(destructor:test.GrpcRequest) |
195 | 0 | SharedDtor(); |
196 | 0 | } |
197 | | |
198 | 0 | void GrpcRequest::SharedDtor() { |
199 | 0 | message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
200 | 0 | } |
201 | | |
202 | 0 | void GrpcRequest::SetCachedSize(int size) const { |
203 | 0 | _cached_size_.Set(size); |
204 | 0 | } |
205 | 0 | const ::google::protobuf::Descriptor* GrpcRequest::descriptor() { |
206 | 0 | ::protobuf_grpc_2eproto::protobuf_AssignDescriptorsOnce(); |
207 | 0 | return ::protobuf_grpc_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; |
208 | 0 | } |
209 | | |
210 | 0 | const GrpcRequest& GrpcRequest::default_instance() { |
211 | 0 | ::google::protobuf::internal::InitSCC(&protobuf_grpc_2eproto::scc_info_GrpcRequest.base); |
212 | 0 | return *internal_default_instance(); |
213 | 0 | } |
214 | | |
215 | | |
216 | 0 | void GrpcRequest::Clear() { |
217 | | // @@protoc_insertion_point(message_clear_start:test.GrpcRequest) |
218 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
219 | | // Prevent compiler warnings about cached_has_bits being unused |
220 | 0 | (void) cached_has_bits; |
221 | |
|
222 | 0 | cached_has_bits = _has_bits_[0]; |
223 | 0 | if (cached_has_bits & 0x00000001u) { |
224 | 0 | message_.ClearNonDefaultToEmptyNoArena(); |
225 | 0 | } |
226 | 0 | if (cached_has_bits & 14u) { |
227 | 0 | ::memset(&timeout_us_, 0, static_cast<size_t>( |
228 | 0 | reinterpret_cast<char*>(&return_error_) - |
229 | 0 | reinterpret_cast<char*>(&timeout_us_)) + sizeof(return_error_)); |
230 | 0 | } |
231 | 0 | _has_bits_.Clear(); |
232 | 0 | _internal_metadata_.Clear(); |
233 | 0 | } |
234 | | |
235 | | bool GrpcRequest::MergePartialFromCodedStream( |
236 | 0 | ::google::protobuf::io::CodedInputStream* input) { |
237 | 0 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure |
238 | 0 | ::google::protobuf::uint32 tag; |
239 | | // @@protoc_insertion_point(parse_start:test.GrpcRequest) |
240 | 0 | for (;;) { |
241 | 0 | ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); |
242 | 0 | tag = p.first; |
243 | 0 | if (!p.second) goto handle_unusual; |
244 | 0 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
245 | | // required string message = 1; |
246 | 0 | case 1: { |
247 | 0 | if (static_cast< ::google::protobuf::uint8>(tag) == |
248 | 0 | static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { |
249 | 0 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
250 | 0 | input, this->mutable_message())); |
251 | 0 | ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( |
252 | 0 | this->message().data(), static_cast<int>(this->message().length()), |
253 | 0 | ::google::protobuf::internal::WireFormat::PARSE, |
254 | 0 | "test.GrpcRequest.message"); |
255 | 0 | } else { |
256 | 0 | goto handle_unusual; |
257 | 0 | } |
258 | 0 | break; |
259 | 0 | } |
260 | | |
261 | | // required bool gzip = 2; |
262 | 0 | case 2: { |
263 | 0 | if (static_cast< ::google::protobuf::uint8>(tag) == |
264 | 0 | static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { |
265 | 0 | set_has_gzip(); |
266 | 0 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
267 | 0 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
268 | 0 | input, &gzip_))); |
269 | 0 | } else { |
270 | 0 | goto handle_unusual; |
271 | 0 | } |
272 | 0 | break; |
273 | 0 | } |
274 | | |
275 | | // required bool return_error = 3; |
276 | 0 | case 3: { |
277 | 0 | if (static_cast< ::google::protobuf::uint8>(tag) == |
278 | 0 | static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { |
279 | 0 | set_has_return_error(); |
280 | 0 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
281 | 0 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
282 | 0 | input, &return_error_))); |
283 | 0 | } else { |
284 | 0 | goto handle_unusual; |
285 | 0 | } |
286 | 0 | break; |
287 | 0 | } |
288 | | |
289 | | // optional int64 timeout_us = 4; |
290 | 0 | case 4: { |
291 | 0 | if (static_cast< ::google::protobuf::uint8>(tag) == |
292 | 0 | static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { |
293 | 0 | set_has_timeout_us(); |
294 | 0 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
295 | 0 | ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( |
296 | 0 | input, &timeout_us_))); |
297 | 0 | } else { |
298 | 0 | goto handle_unusual; |
299 | 0 | } |
300 | 0 | break; |
301 | 0 | } |
302 | | |
303 | 0 | default: { |
304 | 0 | handle_unusual: |
305 | 0 | if (tag == 0) { |
306 | 0 | goto success; |
307 | 0 | } |
308 | 0 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
309 | 0 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
310 | 0 | break; |
311 | 0 | } |
312 | 0 | } |
313 | 0 | } |
314 | 0 | success: |
315 | | // @@protoc_insertion_point(parse_success:test.GrpcRequest) |
316 | 0 | return true; |
317 | 0 | failure: |
318 | | // @@protoc_insertion_point(parse_failure:test.GrpcRequest) |
319 | 0 | return false; |
320 | 0 | #undef DO_ |
321 | 0 | } |
322 | | |
323 | | void GrpcRequest::SerializeWithCachedSizes( |
324 | 0 | ::google::protobuf::io::CodedOutputStream* output) const { |
325 | | // @@protoc_insertion_point(serialize_start:test.GrpcRequest) |
326 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
327 | 0 | (void) cached_has_bits; |
328 | |
|
329 | 0 | cached_has_bits = _has_bits_[0]; |
330 | | // required string message = 1; |
331 | 0 | if (cached_has_bits & 0x00000001u) { |
332 | 0 | ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( |
333 | 0 | this->message().data(), static_cast<int>(this->message().length()), |
334 | 0 | ::google::protobuf::internal::WireFormat::SERIALIZE, |
335 | 0 | "test.GrpcRequest.message"); |
336 | 0 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( |
337 | 0 | 1, this->message(), output); |
338 | 0 | } |
339 | | |
340 | | // required bool gzip = 2; |
341 | 0 | if (cached_has_bits & 0x00000004u) { |
342 | 0 | ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->gzip(), output); |
343 | 0 | } |
344 | | |
345 | | // required bool return_error = 3; |
346 | 0 | if (cached_has_bits & 0x00000008u) { |
347 | 0 | ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->return_error(), output); |
348 | 0 | } |
349 | | |
350 | | // optional int64 timeout_us = 4; |
351 | 0 | if (cached_has_bits & 0x00000002u) { |
352 | 0 | ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->timeout_us(), output); |
353 | 0 | } |
354 | |
|
355 | 0 | if (_internal_metadata_.have_unknown_fields()) { |
356 | 0 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
357 | 0 | _internal_metadata_.unknown_fields(), output); |
358 | 0 | } |
359 | | // @@protoc_insertion_point(serialize_end:test.GrpcRequest) |
360 | 0 | } |
361 | | |
362 | | ::google::protobuf::uint8* GrpcRequest::InternalSerializeWithCachedSizesToArray( |
363 | 0 | bool deterministic, ::google::protobuf::uint8* target) const { |
364 | 0 | (void)deterministic; // Unused |
365 | | // @@protoc_insertion_point(serialize_to_array_start:test.GrpcRequest) |
366 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
367 | 0 | (void) cached_has_bits; |
368 | |
|
369 | 0 | cached_has_bits = _has_bits_[0]; |
370 | | // required string message = 1; |
371 | 0 | if (cached_has_bits & 0x00000001u) { |
372 | 0 | ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( |
373 | 0 | this->message().data(), static_cast<int>(this->message().length()), |
374 | 0 | ::google::protobuf::internal::WireFormat::SERIALIZE, |
375 | 0 | "test.GrpcRequest.message"); |
376 | 0 | target = |
377 | 0 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
378 | 0 | 1, this->message(), target); |
379 | 0 | } |
380 | | |
381 | | // required bool gzip = 2; |
382 | 0 | if (cached_has_bits & 0x00000004u) { |
383 | 0 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->gzip(), target); |
384 | 0 | } |
385 | | |
386 | | // required bool return_error = 3; |
387 | 0 | if (cached_has_bits & 0x00000008u) { |
388 | 0 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->return_error(), target); |
389 | 0 | } |
390 | | |
391 | | // optional int64 timeout_us = 4; |
392 | 0 | if (cached_has_bits & 0x00000002u) { |
393 | 0 | target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->timeout_us(), target); |
394 | 0 | } |
395 | |
|
396 | 0 | if (_internal_metadata_.have_unknown_fields()) { |
397 | 0 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
398 | 0 | _internal_metadata_.unknown_fields(), target); |
399 | 0 | } |
400 | | // @@protoc_insertion_point(serialize_to_array_end:test.GrpcRequest) |
401 | 0 | return target; |
402 | 0 | } |
403 | | |
404 | 0 | size_t GrpcRequest::RequiredFieldsByteSizeFallback() const { |
405 | | // @@protoc_insertion_point(required_fields_byte_size_fallback_start:test.GrpcRequest) |
406 | 0 | size_t total_size = 0; |
407 | |
|
408 | 0 | if (has_message()) { |
409 | | // required string message = 1; |
410 | 0 | total_size += 1 + |
411 | 0 | ::google::protobuf::internal::WireFormatLite::StringSize( |
412 | 0 | this->message()); |
413 | 0 | } |
414 | |
|
415 | 0 | if (has_gzip()) { |
416 | | // required bool gzip = 2; |
417 | 0 | total_size += 1 + 1; |
418 | 0 | } |
419 | |
|
420 | 0 | if (has_return_error()) { |
421 | | // required bool return_error = 3; |
422 | 0 | total_size += 1 + 1; |
423 | 0 | } |
424 | |
|
425 | 0 | return total_size; |
426 | 0 | } |
427 | 0 | size_t GrpcRequest::ByteSizeLong() const { |
428 | | // @@protoc_insertion_point(message_byte_size_start:test.GrpcRequest) |
429 | 0 | size_t total_size = 0; |
430 | |
|
431 | 0 | if (_internal_metadata_.have_unknown_fields()) { |
432 | 0 | total_size += |
433 | 0 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
434 | 0 | _internal_metadata_.unknown_fields()); |
435 | 0 | } |
436 | 0 | if (((_has_bits_[0] & 0x0000000d) ^ 0x0000000d) == 0) { // All required fields are present. |
437 | | // required string message = 1; |
438 | 0 | total_size += 1 + |
439 | 0 | ::google::protobuf::internal::WireFormatLite::StringSize( |
440 | 0 | this->message()); |
441 | | |
442 | | // required bool gzip = 2; |
443 | 0 | total_size += 1 + 1; |
444 | | |
445 | | // required bool return_error = 3; |
446 | 0 | total_size += 1 + 1; |
447 | |
|
448 | 0 | } else { |
449 | 0 | total_size += RequiredFieldsByteSizeFallback(); |
450 | 0 | } |
451 | | // optional int64 timeout_us = 4; |
452 | 0 | if (has_timeout_us()) { |
453 | 0 | total_size += 1 + |
454 | 0 | ::google::protobuf::internal::WireFormatLite::Int64Size( |
455 | 0 | this->timeout_us()); |
456 | 0 | } |
457 | |
|
458 | 0 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); |
459 | 0 | SetCachedSize(cached_size); |
460 | 0 | return total_size; |
461 | 0 | } |
462 | | |
463 | 0 | void GrpcRequest::MergeFrom(const ::google::protobuf::Message& from) { |
464 | | // @@protoc_insertion_point(generalized_merge_from_start:test.GrpcRequest) |
465 | 0 | GOOGLE_DCHECK_NE(&from, this); |
466 | 0 | const GrpcRequest* source = |
467 | 0 | ::google::protobuf::internal::DynamicCastToGenerated<const GrpcRequest>( |
468 | 0 | &from); |
469 | 0 | if (source == NULL) { |
470 | | // @@protoc_insertion_point(generalized_merge_from_cast_fail:test.GrpcRequest) |
471 | 0 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
472 | 0 | } else { |
473 | | // @@protoc_insertion_point(generalized_merge_from_cast_success:test.GrpcRequest) |
474 | 0 | MergeFrom(*source); |
475 | 0 | } |
476 | 0 | } |
477 | | |
478 | 0 | void GrpcRequest::MergeFrom(const GrpcRequest& from) { |
479 | | // @@protoc_insertion_point(class_specific_merge_from_start:test.GrpcRequest) |
480 | 0 | GOOGLE_DCHECK_NE(&from, this); |
481 | 0 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
482 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
483 | 0 | (void) cached_has_bits; |
484 | |
|
485 | 0 | cached_has_bits = from._has_bits_[0]; |
486 | 0 | if (cached_has_bits & 15u) { |
487 | 0 | if (cached_has_bits & 0x00000001u) { |
488 | 0 | set_has_message(); |
489 | 0 | message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message_); |
490 | 0 | } |
491 | 0 | if (cached_has_bits & 0x00000002u) { |
492 | 0 | timeout_us_ = from.timeout_us_; |
493 | 0 | } |
494 | 0 | if (cached_has_bits & 0x00000004u) { |
495 | 0 | gzip_ = from.gzip_; |
496 | 0 | } |
497 | 0 | if (cached_has_bits & 0x00000008u) { |
498 | 0 | return_error_ = from.return_error_; |
499 | 0 | } |
500 | 0 | _has_bits_[0] |= cached_has_bits; |
501 | 0 | } |
502 | 0 | } |
503 | | |
504 | 0 | void GrpcRequest::CopyFrom(const ::google::protobuf::Message& from) { |
505 | | // @@protoc_insertion_point(generalized_copy_from_start:test.GrpcRequest) |
506 | 0 | if (&from == this) return; |
507 | 0 | Clear(); |
508 | 0 | MergeFrom(from); |
509 | 0 | } |
510 | | |
511 | 0 | void GrpcRequest::CopyFrom(const GrpcRequest& from) { |
512 | | // @@protoc_insertion_point(class_specific_copy_from_start:test.GrpcRequest) |
513 | 0 | if (&from == this) return; |
514 | 0 | Clear(); |
515 | 0 | MergeFrom(from); |
516 | 0 | } |
517 | | |
518 | 0 | bool GrpcRequest::IsInitialized() const { |
519 | 0 | if ((_has_bits_[0] & 0x0000000d) != 0x0000000d) return false; |
520 | 0 | return true; |
521 | 0 | } |
522 | | |
523 | 0 | void GrpcRequest::Swap(GrpcRequest* other) { |
524 | 0 | if (other == this) return; |
525 | 0 | InternalSwap(other); |
526 | 0 | } |
527 | 0 | void GrpcRequest::InternalSwap(GrpcRequest* other) { |
528 | 0 | using std::swap; |
529 | 0 | message_.Swap(&other->message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), |
530 | 0 | GetArenaNoVirtual()); |
531 | 0 | swap(timeout_us_, other->timeout_us_); |
532 | 0 | swap(gzip_, other->gzip_); |
533 | 0 | swap(return_error_, other->return_error_); |
534 | 0 | swap(_has_bits_[0], other->_has_bits_[0]); |
535 | 0 | _internal_metadata_.Swap(&other->_internal_metadata_); |
536 | 0 | } |
537 | | |
538 | 0 | ::google::protobuf::Metadata GrpcRequest::GetMetadata() const { |
539 | 0 | protobuf_grpc_2eproto::protobuf_AssignDescriptorsOnce(); |
540 | 0 | return ::protobuf_grpc_2eproto::file_level_metadata[kIndexInFileMessages]; |
541 | 0 | } |
542 | | |
543 | | |
544 | | // =================================================================== |
545 | | |
546 | 2 | void GrpcResponse::InitAsDefaultInstance() { |
547 | 2 | } |
548 | | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
549 | | const int GrpcResponse::kMessageFieldNumber; |
550 | | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
551 | | |
552 | | GrpcResponse::GrpcResponse() |
553 | 2 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
554 | 2 | ::google::protobuf::internal::InitSCC( |
555 | 2 | &protobuf_grpc_2eproto::scc_info_GrpcResponse.base); |
556 | 2 | SharedCtor(); |
557 | | // @@protoc_insertion_point(constructor:test.GrpcResponse) |
558 | 2 | } |
559 | | GrpcResponse::GrpcResponse(const GrpcResponse& from) |
560 | 0 | : ::google::protobuf::Message(), |
561 | 0 | _internal_metadata_(NULL), |
562 | 0 | _has_bits_(from._has_bits_) { |
563 | 0 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
564 | 0 | message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
565 | 0 | if (from.has_message()) { |
566 | 0 | message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message_); |
567 | 0 | } |
568 | | // @@protoc_insertion_point(copy_constructor:test.GrpcResponse) |
569 | 0 | } |
570 | | |
571 | 2 | void GrpcResponse::SharedCtor() { |
572 | 2 | message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
573 | 2 | } |
574 | | |
575 | 0 | GrpcResponse::~GrpcResponse() { |
576 | | // @@protoc_insertion_point(destructor:test.GrpcResponse) |
577 | 0 | SharedDtor(); |
578 | 0 | } |
579 | | |
580 | 0 | void GrpcResponse::SharedDtor() { |
581 | 0 | message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
582 | 0 | } |
583 | | |
584 | 0 | void GrpcResponse::SetCachedSize(int size) const { |
585 | 0 | _cached_size_.Set(size); |
586 | 0 | } |
587 | 0 | const ::google::protobuf::Descriptor* GrpcResponse::descriptor() { |
588 | 0 | ::protobuf_grpc_2eproto::protobuf_AssignDescriptorsOnce(); |
589 | 0 | return ::protobuf_grpc_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; |
590 | 0 | } |
591 | | |
592 | 0 | const GrpcResponse& GrpcResponse::default_instance() { |
593 | 0 | ::google::protobuf::internal::InitSCC(&protobuf_grpc_2eproto::scc_info_GrpcResponse.base); |
594 | 0 | return *internal_default_instance(); |
595 | 0 | } |
596 | | |
597 | | |
598 | 0 | void GrpcResponse::Clear() { |
599 | | // @@protoc_insertion_point(message_clear_start:test.GrpcResponse) |
600 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
601 | | // Prevent compiler warnings about cached_has_bits being unused |
602 | 0 | (void) cached_has_bits; |
603 | |
|
604 | 0 | cached_has_bits = _has_bits_[0]; |
605 | 0 | if (cached_has_bits & 0x00000001u) { |
606 | 0 | message_.ClearNonDefaultToEmptyNoArena(); |
607 | 0 | } |
608 | 0 | _has_bits_.Clear(); |
609 | 0 | _internal_metadata_.Clear(); |
610 | 0 | } |
611 | | |
612 | | bool GrpcResponse::MergePartialFromCodedStream( |
613 | 0 | ::google::protobuf::io::CodedInputStream* input) { |
614 | 0 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure |
615 | 0 | ::google::protobuf::uint32 tag; |
616 | | // @@protoc_insertion_point(parse_start:test.GrpcResponse) |
617 | 0 | for (;;) { |
618 | 0 | ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); |
619 | 0 | tag = p.first; |
620 | 0 | if (!p.second) goto handle_unusual; |
621 | 0 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
622 | | // required string message = 1; |
623 | 0 | case 1: { |
624 | 0 | if (static_cast< ::google::protobuf::uint8>(tag) == |
625 | 0 | static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { |
626 | 0 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
627 | 0 | input, this->mutable_message())); |
628 | 0 | ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( |
629 | 0 | this->message().data(), static_cast<int>(this->message().length()), |
630 | 0 | ::google::protobuf::internal::WireFormat::PARSE, |
631 | 0 | "test.GrpcResponse.message"); |
632 | 0 | } else { |
633 | 0 | goto handle_unusual; |
634 | 0 | } |
635 | 0 | break; |
636 | 0 | } |
637 | | |
638 | 0 | default: { |
639 | 0 | handle_unusual: |
640 | 0 | if (tag == 0) { |
641 | 0 | goto success; |
642 | 0 | } |
643 | 0 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
644 | 0 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
645 | 0 | break; |
646 | 0 | } |
647 | 0 | } |
648 | 0 | } |
649 | 0 | success: |
650 | | // @@protoc_insertion_point(parse_success:test.GrpcResponse) |
651 | 0 | return true; |
652 | 0 | failure: |
653 | | // @@protoc_insertion_point(parse_failure:test.GrpcResponse) |
654 | 0 | return false; |
655 | 0 | #undef DO_ |
656 | 0 | } |
657 | | |
658 | | void GrpcResponse::SerializeWithCachedSizes( |
659 | 0 | ::google::protobuf::io::CodedOutputStream* output) const { |
660 | | // @@protoc_insertion_point(serialize_start:test.GrpcResponse) |
661 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
662 | 0 | (void) cached_has_bits; |
663 | |
|
664 | 0 | cached_has_bits = _has_bits_[0]; |
665 | | // required string message = 1; |
666 | 0 | if (cached_has_bits & 0x00000001u) { |
667 | 0 | ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( |
668 | 0 | this->message().data(), static_cast<int>(this->message().length()), |
669 | 0 | ::google::protobuf::internal::WireFormat::SERIALIZE, |
670 | 0 | "test.GrpcResponse.message"); |
671 | 0 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( |
672 | 0 | 1, this->message(), output); |
673 | 0 | } |
674 | |
|
675 | 0 | if (_internal_metadata_.have_unknown_fields()) { |
676 | 0 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
677 | 0 | _internal_metadata_.unknown_fields(), output); |
678 | 0 | } |
679 | | // @@protoc_insertion_point(serialize_end:test.GrpcResponse) |
680 | 0 | } |
681 | | |
682 | | ::google::protobuf::uint8* GrpcResponse::InternalSerializeWithCachedSizesToArray( |
683 | 0 | bool deterministic, ::google::protobuf::uint8* target) const { |
684 | 0 | (void)deterministic; // Unused |
685 | | // @@protoc_insertion_point(serialize_to_array_start:test.GrpcResponse) |
686 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
687 | 0 | (void) cached_has_bits; |
688 | |
|
689 | 0 | cached_has_bits = _has_bits_[0]; |
690 | | // required string message = 1; |
691 | 0 | if (cached_has_bits & 0x00000001u) { |
692 | 0 | ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( |
693 | 0 | this->message().data(), static_cast<int>(this->message().length()), |
694 | 0 | ::google::protobuf::internal::WireFormat::SERIALIZE, |
695 | 0 | "test.GrpcResponse.message"); |
696 | 0 | target = |
697 | 0 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
698 | 0 | 1, this->message(), target); |
699 | 0 | } |
700 | |
|
701 | 0 | if (_internal_metadata_.have_unknown_fields()) { |
702 | 0 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
703 | 0 | _internal_metadata_.unknown_fields(), target); |
704 | 0 | } |
705 | | // @@protoc_insertion_point(serialize_to_array_end:test.GrpcResponse) |
706 | 0 | return target; |
707 | 0 | } |
708 | | |
709 | 0 | size_t GrpcResponse::ByteSizeLong() const { |
710 | | // @@protoc_insertion_point(message_byte_size_start:test.GrpcResponse) |
711 | 0 | size_t total_size = 0; |
712 | |
|
713 | 0 | if (_internal_metadata_.have_unknown_fields()) { |
714 | 0 | total_size += |
715 | 0 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
716 | 0 | _internal_metadata_.unknown_fields()); |
717 | 0 | } |
718 | | // required string message = 1; |
719 | 0 | if (has_message()) { |
720 | 0 | total_size += 1 + |
721 | 0 | ::google::protobuf::internal::WireFormatLite::StringSize( |
722 | 0 | this->message()); |
723 | 0 | } |
724 | 0 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); |
725 | 0 | SetCachedSize(cached_size); |
726 | 0 | return total_size; |
727 | 0 | } |
728 | | |
729 | 0 | void GrpcResponse::MergeFrom(const ::google::protobuf::Message& from) { |
730 | | // @@protoc_insertion_point(generalized_merge_from_start:test.GrpcResponse) |
731 | 0 | GOOGLE_DCHECK_NE(&from, this); |
732 | 0 | const GrpcResponse* source = |
733 | 0 | ::google::protobuf::internal::DynamicCastToGenerated<const GrpcResponse>( |
734 | 0 | &from); |
735 | 0 | if (source == NULL) { |
736 | | // @@protoc_insertion_point(generalized_merge_from_cast_fail:test.GrpcResponse) |
737 | 0 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
738 | 0 | } else { |
739 | | // @@protoc_insertion_point(generalized_merge_from_cast_success:test.GrpcResponse) |
740 | 0 | MergeFrom(*source); |
741 | 0 | } |
742 | 0 | } |
743 | | |
744 | 0 | void GrpcResponse::MergeFrom(const GrpcResponse& from) { |
745 | | // @@protoc_insertion_point(class_specific_merge_from_start:test.GrpcResponse) |
746 | 0 | GOOGLE_DCHECK_NE(&from, this); |
747 | 0 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
748 | 0 | ::google::protobuf::uint32 cached_has_bits = 0; |
749 | 0 | (void) cached_has_bits; |
750 | |
|
751 | 0 | if (from.has_message()) { |
752 | 0 | set_has_message(); |
753 | 0 | message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message_); |
754 | 0 | } |
755 | 0 | } |
756 | | |
757 | 0 | void GrpcResponse::CopyFrom(const ::google::protobuf::Message& from) { |
758 | | // @@protoc_insertion_point(generalized_copy_from_start:test.GrpcResponse) |
759 | 0 | if (&from == this) return; |
760 | 0 | Clear(); |
761 | 0 | MergeFrom(from); |
762 | 0 | } |
763 | | |
764 | 0 | void GrpcResponse::CopyFrom(const GrpcResponse& from) { |
765 | | // @@protoc_insertion_point(class_specific_copy_from_start:test.GrpcResponse) |
766 | 0 | if (&from == this) return; |
767 | 0 | Clear(); |
768 | 0 | MergeFrom(from); |
769 | 0 | } |
770 | | |
771 | 0 | bool GrpcResponse::IsInitialized() const { |
772 | 0 | if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; |
773 | 0 | return true; |
774 | 0 | } |
775 | | |
776 | 0 | void GrpcResponse::Swap(GrpcResponse* other) { |
777 | 0 | if (other == this) return; |
778 | 0 | InternalSwap(other); |
779 | 0 | } |
780 | 0 | void GrpcResponse::InternalSwap(GrpcResponse* other) { |
781 | 0 | using std::swap; |
782 | 0 | message_.Swap(&other->message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), |
783 | 0 | GetArenaNoVirtual()); |
784 | 0 | swap(_has_bits_[0], other->_has_bits_[0]); |
785 | 0 | _internal_metadata_.Swap(&other->_internal_metadata_); |
786 | 0 | } |
787 | | |
788 | 0 | ::google::protobuf::Metadata GrpcResponse::GetMetadata() const { |
789 | 0 | protobuf_grpc_2eproto::protobuf_AssignDescriptorsOnce(); |
790 | 0 | return ::protobuf_grpc_2eproto::file_level_metadata[kIndexInFileMessages]; |
791 | 0 | } |
792 | | |
793 | | |
794 | | // =================================================================== |
795 | | |
796 | 0 | GrpcService::~GrpcService() {} |
797 | | |
798 | 0 | const ::google::protobuf::ServiceDescriptor* GrpcService::descriptor() { |
799 | 0 | protobuf_grpc_2eproto::protobuf_AssignDescriptorsOnce(); |
800 | 0 | return protobuf_grpc_2eproto::file_level_service_descriptors[0]; |
801 | 0 | } |
802 | | |
803 | 0 | const ::google::protobuf::ServiceDescriptor* GrpcService::GetDescriptor() { |
804 | 0 | return descriptor(); |
805 | 0 | } |
806 | | |
807 | | void GrpcService::Method(::google::protobuf::RpcController* controller, |
808 | | const ::test::GrpcRequest*, |
809 | | ::test::GrpcResponse*, |
810 | 0 | ::google::protobuf::Closure* done) { |
811 | 0 | controller->SetFailed("Method Method() not implemented."); |
812 | 0 | done->Run(); |
813 | 0 | } |
814 | | |
815 | | void GrpcService::MethodTimeOut(::google::protobuf::RpcController* controller, |
816 | | const ::test::GrpcRequest*, |
817 | | ::test::GrpcResponse*, |
818 | 0 | ::google::protobuf::Closure* done) { |
819 | 0 | controller->SetFailed("Method MethodTimeOut() not implemented."); |
820 | 0 | done->Run(); |
821 | 0 | } |
822 | | |
823 | | void GrpcService::MethodNotExist(::google::protobuf::RpcController* controller, |
824 | | const ::test::GrpcRequest*, |
825 | | ::test::GrpcResponse*, |
826 | 0 | ::google::protobuf::Closure* done) { |
827 | 0 | controller->SetFailed("Method MethodNotExist() not implemented."); |
828 | 0 | done->Run(); |
829 | 0 | } |
830 | | |
831 | | void GrpcService::CallMethod(const ::google::protobuf::MethodDescriptor* method, |
832 | | ::google::protobuf::RpcController* controller, |
833 | | const ::google::protobuf::Message* request, |
834 | | ::google::protobuf::Message* response, |
835 | 0 | ::google::protobuf::Closure* done) { |
836 | 0 | GOOGLE_DCHECK_EQ(method->service(), protobuf_grpc_2eproto::file_level_service_descriptors[0]); |
837 | 0 | switch(method->index()) { |
838 | 0 | case 0: |
839 | 0 | Method(controller, |
840 | 0 | ::google::protobuf::down_cast<const ::test::GrpcRequest*>(request), |
841 | 0 | ::google::protobuf::down_cast< ::test::GrpcResponse*>(response), |
842 | 0 | done); |
843 | 0 | break; |
844 | 0 | case 1: |
845 | 0 | MethodTimeOut(controller, |
846 | 0 | ::google::protobuf::down_cast<const ::test::GrpcRequest*>(request), |
847 | 0 | ::google::protobuf::down_cast< ::test::GrpcResponse*>(response), |
848 | 0 | done); |
849 | 0 | break; |
850 | 0 | case 2: |
851 | 0 | MethodNotExist(controller, |
852 | 0 | ::google::protobuf::down_cast<const ::test::GrpcRequest*>(request), |
853 | 0 | ::google::protobuf::down_cast< ::test::GrpcResponse*>(response), |
854 | 0 | done); |
855 | 0 | break; |
856 | 0 | default: |
857 | 0 | GOOGLE_LOG(FATAL) << "Bad method index; this should never happen."; |
858 | 0 | break; |
859 | 0 | } |
860 | 0 | } |
861 | | |
862 | | const ::google::protobuf::Message& GrpcService::GetRequestPrototype( |
863 | 0 | const ::google::protobuf::MethodDescriptor* method) const { |
864 | 0 | GOOGLE_DCHECK_EQ(method->service(), descriptor()); |
865 | 0 | switch(method->index()) { |
866 | 0 | case 0: |
867 | 0 | return ::test::GrpcRequest::default_instance(); |
868 | 0 | case 1: |
869 | 0 | return ::test::GrpcRequest::default_instance(); |
870 | 0 | case 2: |
871 | 0 | return ::test::GrpcRequest::default_instance(); |
872 | 0 | default: |
873 | 0 | GOOGLE_LOG(FATAL) << "Bad method index; this should never happen."; |
874 | 0 | return *::google::protobuf::MessageFactory::generated_factory() |
875 | 0 | ->GetPrototype(method->input_type()); |
876 | 0 | } |
877 | 0 | } |
878 | | |
879 | | const ::google::protobuf::Message& GrpcService::GetResponsePrototype( |
880 | 0 | const ::google::protobuf::MethodDescriptor* method) const { |
881 | 0 | GOOGLE_DCHECK_EQ(method->service(), descriptor()); |
882 | 0 | switch(method->index()) { |
883 | 0 | case 0: |
884 | 0 | return ::test::GrpcResponse::default_instance(); |
885 | 0 | case 1: |
886 | 0 | return ::test::GrpcResponse::default_instance(); |
887 | 0 | case 2: |
888 | 0 | return ::test::GrpcResponse::default_instance(); |
889 | 0 | default: |
890 | 0 | GOOGLE_LOG(FATAL) << "Bad method index; this should never happen."; |
891 | 0 | return *::google::protobuf::MessageFactory::generated_factory() |
892 | 0 | ->GetPrototype(method->output_type()); |
893 | 0 | } |
894 | 0 | } |
895 | | |
896 | | GrpcService_Stub::GrpcService_Stub(::google::protobuf::RpcChannel* channel) |
897 | 0 | : channel_(channel), owns_channel_(false) {} |
898 | | GrpcService_Stub::GrpcService_Stub( |
899 | | ::google::protobuf::RpcChannel* channel, |
900 | | ::google::protobuf::Service::ChannelOwnership ownership) |
901 | 0 | : channel_(channel), |
902 | 0 | owns_channel_(ownership == ::google::protobuf::Service::STUB_OWNS_CHANNEL) {} |
903 | 0 | GrpcService_Stub::~GrpcService_Stub() { |
904 | 0 | if (owns_channel_) delete channel_; |
905 | 0 | } |
906 | | |
907 | | void GrpcService_Stub::Method(::google::protobuf::RpcController* controller, |
908 | | const ::test::GrpcRequest* request, |
909 | | ::test::GrpcResponse* response, |
910 | 0 | ::google::protobuf::Closure* done) { |
911 | 0 | channel_->CallMethod(descriptor()->method(0), |
912 | 0 | controller, request, response, done); |
913 | 0 | } |
914 | | void GrpcService_Stub::MethodTimeOut(::google::protobuf::RpcController* controller, |
915 | | const ::test::GrpcRequest* request, |
916 | | ::test::GrpcResponse* response, |
917 | 0 | ::google::protobuf::Closure* done) { |
918 | 0 | channel_->CallMethod(descriptor()->method(1), |
919 | 0 | controller, request, response, done); |
920 | 0 | } |
921 | | void GrpcService_Stub::MethodNotExist(::google::protobuf::RpcController* controller, |
922 | | const ::test::GrpcRequest* request, |
923 | | ::test::GrpcResponse* response, |
924 | 0 | ::google::protobuf::Closure* done) { |
925 | 0 | channel_->CallMethod(descriptor()->method(2), |
926 | 0 | controller, request, response, done); |
927 | 0 | } |
928 | | |
929 | | // @@protoc_insertion_point(namespace_scope) |
930 | | } // namespace test |
931 | | namespace google { |
932 | | namespace protobuf { |
933 | 0 | template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::test::GrpcRequest* Arena::CreateMaybeMessage< ::test::GrpcRequest >(Arena* arena) { |
934 | 0 | return Arena::CreateInternal< ::test::GrpcRequest >(arena); |
935 | 0 | } |
936 | 0 | template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::test::GrpcResponse* Arena::CreateMaybeMessage< ::test::GrpcResponse >(Arena* arena) { |
937 | 0 | return Arena::CreateInternal< ::test::GrpcResponse >(arena); |
938 | 0 | } |
939 | | } // namespace protobuf |
940 | | } // namespace google |
941 | | |
942 | | // @@protoc_insertion_point(global_scope) |