Coverage Report

Created: 2025-10-10 06:58

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/brpc/build/brpc/policy/mongo.pb.cc
Line
Count
Source
1
// Generated by the protocol buffer compiler.  DO NOT EDIT!
2
// source: brpc/policy/mongo.proto
3
4
#include "brpc/policy/mongo.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 protobuf_brpc_2fpolicy_2fmongo_2eproto {
23
extern PROTOBUF_INTERNAL_EXPORT_protobuf_brpc_2fpolicy_2fmongo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_MongoHeader;
24
}  // namespace protobuf_brpc_2fpolicy_2fmongo_2eproto
25
namespace brpc {
26
namespace policy {
27
class MongoHeaderDefaultTypeInternal {
28
 public:
29
  ::google::protobuf::internal::ExplicitlyConstructed<MongoHeader>
30
      _instance;
31
} _MongoHeader_default_instance_;
32
class MongoRequestDefaultTypeInternal {
33
 public:
34
  ::google::protobuf::internal::ExplicitlyConstructed<MongoRequest>
35
      _instance;
36
} _MongoRequest_default_instance_;
37
class MongoResponseDefaultTypeInternal {
38
 public:
39
  ::google::protobuf::internal::ExplicitlyConstructed<MongoResponse>
40
      _instance;
41
} _MongoResponse_default_instance_;
42
}  // namespace policy
43
}  // namespace brpc
44
namespace protobuf_brpc_2fpolicy_2fmongo_2eproto {
45
2
static void InitDefaultsMongoHeader() {
46
2
  GOOGLE_PROTOBUF_VERIFY_VERSION;
47
48
2
  {
49
2
    void* ptr = &::brpc::policy::_MongoHeader_default_instance_;
50
2
    new (ptr) ::brpc::policy::MongoHeader();
51
2
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
52
2
  }
53
2
  ::brpc::policy::MongoHeader::InitAsDefaultInstance();
54
2
}
55
56
::google::protobuf::internal::SCCInfo<0> scc_info_MongoHeader =
57
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMongoHeader}, {}};
58
59
2
static void InitDefaultsMongoRequest() {
60
2
  GOOGLE_PROTOBUF_VERIFY_VERSION;
61
62
2
  {
63
2
    void* ptr = &::brpc::policy::_MongoRequest_default_instance_;
64
2
    new (ptr) ::brpc::policy::MongoRequest();
65
2
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
66
2
  }
67
2
  ::brpc::policy::MongoRequest::InitAsDefaultInstance();
68
2
}
69
70
::google::protobuf::internal::SCCInfo<1> scc_info_MongoRequest =
71
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsMongoRequest}, {
72
      &protobuf_brpc_2fpolicy_2fmongo_2eproto::scc_info_MongoHeader.base,}};
73
74
2
static void InitDefaultsMongoResponse() {
75
2
  GOOGLE_PROTOBUF_VERIFY_VERSION;
76
77
2
  {
78
2
    void* ptr = &::brpc::policy::_MongoResponse_default_instance_;
79
2
    new (ptr) ::brpc::policy::MongoResponse();
80
2
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
81
2
  }
82
2
  ::brpc::policy::MongoResponse::InitAsDefaultInstance();
83
2
}
84
85
::google::protobuf::internal::SCCInfo<1> scc_info_MongoResponse =
86
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsMongoResponse}, {
87
      &protobuf_brpc_2fpolicy_2fmongo_2eproto::scc_info_MongoHeader.base,}};
88
89
2
void InitDefaults() {
90
2
  ::google::protobuf::internal::InitSCC(&scc_info_MongoHeader.base);
91
2
  ::google::protobuf::internal::InitSCC(&scc_info_MongoRequest.base);
92
2
  ::google::protobuf::internal::InitSCC(&scc_info_MongoResponse.base);
93
2
}
94
95
::google::protobuf::Metadata file_level_metadata[3];
96
const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1];
97
const ::google::protobuf::ServiceDescriptor* file_level_service_descriptors[1];
98
99
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
100
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoHeader, _has_bits_),
101
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoHeader, _internal_metadata_),
102
  ~0u,  // no _extensions_
103
  ~0u,  // no _oneof_case_
104
  ~0u,  // no _weak_field_map_
105
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoHeader, message_length_),
106
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoHeader, request_id_),
107
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoHeader, response_to_),
108
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoHeader, op_code_),
109
  0,
110
  1,
111
  2,
112
  3,
113
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoRequest, _has_bits_),
114
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoRequest, _internal_metadata_),
115
  ~0u,  // no _extensions_
116
  ~0u,  // no _oneof_case_
117
  ~0u,  // no _weak_field_map_
118
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoRequest, header_),
119
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoRequest, message_),
120
  1,
121
  0,
122
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoResponse, _has_bits_),
123
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoResponse, _internal_metadata_),
124
  ~0u,  // no _extensions_
125
  ~0u,  // no _oneof_case_
126
  ~0u,  // no _weak_field_map_
127
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoResponse, header_),
128
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoResponse, response_flags_),
129
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoResponse, cursor_id_),
130
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoResponse, starting_from_),
131
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoResponse, number_returned_),
132
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::brpc::policy::MongoResponse, message_),
133
  1,
134
  3,
135
  2,
136
  4,
137
  5,
138
  0,
139
};
140
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
141
  { 0, 9, sizeof(::brpc::policy::MongoHeader)},
142
  { 13, 20, sizeof(::brpc::policy::MongoRequest)},
143
  { 22, 33, sizeof(::brpc::policy::MongoResponse)},
144
};
145
146
static ::google::protobuf::Message const * const file_default_instances[] = {
147
  reinterpret_cast<const ::google::protobuf::Message*>(&::brpc::policy::_MongoHeader_default_instance_),
148
  reinterpret_cast<const ::google::protobuf::Message*>(&::brpc::policy::_MongoRequest_default_instance_),
149
  reinterpret_cast<const ::google::protobuf::Message*>(&::brpc::policy::_MongoResponse_default_instance_),
150
};
151
152
0
void protobuf_AssignDescriptors() {
153
0
  AddDescriptors();
154
0
  AssignDescriptors(
155
0
      "brpc/policy/mongo.proto", schemas, file_default_instances, TableStruct::offsets,
156
0
      file_level_metadata, file_level_enum_descriptors, file_level_service_descriptors);
157
0
}
158
159
0
void protobuf_AssignDescriptorsOnce() {
160
0
  static ::google::protobuf::internal::once_flag once;
161
0
  ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
162
0
}
163
164
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
165
0
void protobuf_RegisterTypes(const ::std::string&) {
166
0
  protobuf_AssignDescriptorsOnce();
167
0
  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 3);
168
0
}
169
170
2
void AddDescriptorsImpl() {
171
2
  InitDefaults();
172
2
  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
173
2
      "\n\027brpc/policy/mongo.proto\022\013brpc.policy\"u"
174
2
      "\n\013MongoHeader\022\026\n\016message_length\030\001 \002(\005\022\022\n"
175
2
      "\nrequest_id\030\002 \002(\005\022\023\n\013response_to\030\003 \002(\005\022%"
176
2
      "\n\007op_code\030\004 \002(\0162\024.brpc.policy.MongoOp\"I\n"
177
2
      "\014MongoRequest\022(\n\006header\030\001 \002(\0132\030.brpc.pol"
178
2
      "icy.MongoHeader\022\017\n\007message\030\002 \002(\t\"\245\001\n\rMon"
179
2
      "goResponse\022(\n\006header\030\001 \002(\0132\030.brpc.policy"
180
2
      ".MongoHeader\022\026\n\016response_flags\030\002 \002(\005\022\021\n\t"
181
2
      "cursor_id\030\003 \002(\003\022\025\n\rstarting_from\030\004 \002(\005\022\027"
182
2
      "\n\017number_returned\030\005 \002(\005\022\017\n\007message\030\006 \002(\t"
183
2
      "*\256\001\n\007MongoOp\022\013\n\007OPREPLY\020\001\022\n\n\005DBMSG\020\350\007\022\016\n"
184
2
      "\tDB_UPDATE\020\321\017\022\016\n\tDB_INSERT\020\322\017\022\r\n\010DB_QUER"
185
2
      "Y\020\324\017\022\017\n\nDB_GETMORE\020\325\017\022\016\n\tDB_DELETE\020\326\017\022\023\n"
186
2
      "\016DB_KILLCURSORS\020\327\017\022\017\n\nDB_COMMAND\020\330\017\022\024\n\017D"
187
2
      "B_COMMANDREPLY\020\331\0172W\n\014MongoService\022G\n\016def"
188
2
      "ault_method\022\031.brpc.policy.MongoRequest\032\032"
189
2
      ".brpc.policy.MongoResponseB#\n\017com.brpc.p"
190
2
      "olicyB\nMongoProto\200\001\001\210\001\001"
191
2
  };
192
2
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
193
2
      descriptor, 703);
194
2
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
195
2
    "brpc/policy/mongo.proto", &protobuf_RegisterTypes);
196
2
}
197
198
2
void AddDescriptors() {
199
2
  static ::google::protobuf::internal::once_flag once;
200
2
  ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
201
2
}
202
// Force AddDescriptors() to be called at dynamic initialization time.
203
struct StaticDescriptorInitializer {
204
2
  StaticDescriptorInitializer() {
205
2
    AddDescriptors();
206
2
  }
207
} static_descriptor_initializer;
208
}  // namespace protobuf_brpc_2fpolicy_2fmongo_2eproto
209
namespace brpc {
210
namespace policy {
211
0
const ::google::protobuf::EnumDescriptor* MongoOp_descriptor() {
212
0
  protobuf_brpc_2fpolicy_2fmongo_2eproto::protobuf_AssignDescriptorsOnce();
213
0
  return protobuf_brpc_2fpolicy_2fmongo_2eproto::file_level_enum_descriptors[0];
214
0
}
215
0
bool MongoOp_IsValid(int value) {
216
0
  switch (value) {
217
0
    case 1:
218
0
    case 1000:
219
0
    case 2001:
220
0
    case 2002:
221
0
    case 2004:
222
0
    case 2005:
223
0
    case 2006:
224
0
    case 2007:
225
0
    case 2008:
226
0
    case 2009:
227
0
      return true;
228
0
    default:
229
0
      return false;
230
0
  }
231
0
}
232
233
234
// ===================================================================
235
236
2
void MongoHeader::InitAsDefaultInstance() {
237
2
}
238
#if !defined(_MSC_VER) || _MSC_VER >= 1900
239
const int MongoHeader::kMessageLengthFieldNumber;
240
const int MongoHeader::kRequestIdFieldNumber;
241
const int MongoHeader::kResponseToFieldNumber;
242
const int MongoHeader::kOpCodeFieldNumber;
243
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
244
245
MongoHeader::MongoHeader()
246
2
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
247
2
  ::google::protobuf::internal::InitSCC(
248
2
      &protobuf_brpc_2fpolicy_2fmongo_2eproto::scc_info_MongoHeader.base);
249
2
  SharedCtor();
250
  // @@protoc_insertion_point(constructor:brpc.policy.MongoHeader)
251
2
}
252
MongoHeader::MongoHeader(const MongoHeader& from)
253
0
  : ::google::protobuf::Message(),
254
0
      _internal_metadata_(NULL),
255
0
      _has_bits_(from._has_bits_) {
256
0
  _internal_metadata_.MergeFrom(from._internal_metadata_);
257
0
  ::memcpy(&message_length_, &from.message_length_,
258
0
    static_cast<size_t>(reinterpret_cast<char*>(&op_code_) -
259
0
    reinterpret_cast<char*>(&message_length_)) + sizeof(op_code_));
260
  // @@protoc_insertion_point(copy_constructor:brpc.policy.MongoHeader)
261
0
}
262
263
2
void MongoHeader::SharedCtor() {
264
2
  ::memset(&message_length_, 0, static_cast<size_t>(
265
2
      reinterpret_cast<char*>(&response_to_) -
266
2
      reinterpret_cast<char*>(&message_length_)) + sizeof(response_to_));
267
2
  op_code_ = 1;
268
2
}
269
270
0
MongoHeader::~MongoHeader() {
271
  // @@protoc_insertion_point(destructor:brpc.policy.MongoHeader)
272
0
  SharedDtor();
273
0
}
274
275
0
void MongoHeader::SharedDtor() {
276
0
}
277
278
0
void MongoHeader::SetCachedSize(int size) const {
279
0
  _cached_size_.Set(size);
280
0
}
281
0
const ::google::protobuf::Descriptor* MongoHeader::descriptor() {
282
0
  ::protobuf_brpc_2fpolicy_2fmongo_2eproto::protobuf_AssignDescriptorsOnce();
283
0
  return ::protobuf_brpc_2fpolicy_2fmongo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
284
0
}
285
286
0
const MongoHeader& MongoHeader::default_instance() {
287
0
  ::google::protobuf::internal::InitSCC(&protobuf_brpc_2fpolicy_2fmongo_2eproto::scc_info_MongoHeader.base);
288
0
  return *internal_default_instance();
289
0
}
290
291
292
0
void MongoHeader::Clear() {
293
// @@protoc_insertion_point(message_clear_start:brpc.policy.MongoHeader)
294
0
  ::google::protobuf::uint32 cached_has_bits = 0;
295
  // Prevent compiler warnings about cached_has_bits being unused
296
0
  (void) cached_has_bits;
297
298
0
  cached_has_bits = _has_bits_[0];
299
0
  if (cached_has_bits & 15u) {
300
0
    ::memset(&message_length_, 0, static_cast<size_t>(
301
0
        reinterpret_cast<char*>(&response_to_) -
302
0
        reinterpret_cast<char*>(&message_length_)) + sizeof(response_to_));
303
0
    op_code_ = 1;
304
0
  }
305
0
  _has_bits_.Clear();
306
0
  _internal_metadata_.Clear();
307
0
}
308
309
bool MongoHeader::MergePartialFromCodedStream(
310
0
    ::google::protobuf::io::CodedInputStream* input) {
311
0
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
312
0
  ::google::protobuf::uint32 tag;
313
  // @@protoc_insertion_point(parse_start:brpc.policy.MongoHeader)
314
0
  for (;;) {
315
0
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
316
0
    tag = p.first;
317
0
    if (!p.second) goto handle_unusual;
318
0
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
319
      // required int32 message_length = 1;
320
0
      case 1: {
321
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
322
0
            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
323
0
          set_has_message_length();
324
0
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
325
0
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
326
0
                 input, &message_length_)));
327
0
        } else {
328
0
          goto handle_unusual;
329
0
        }
330
0
        break;
331
0
      }
332
333
      // required int32 request_id = 2;
334
0
      case 2: {
335
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
336
0
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
337
0
          set_has_request_id();
338
0
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
339
0
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
340
0
                 input, &request_id_)));
341
0
        } else {
342
0
          goto handle_unusual;
343
0
        }
344
0
        break;
345
0
      }
346
347
      // required int32 response_to = 3;
348
0
      case 3: {
349
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
350
0
            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
351
0
          set_has_response_to();
352
0
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
353
0
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
354
0
                 input, &response_to_)));
355
0
        } else {
356
0
          goto handle_unusual;
357
0
        }
358
0
        break;
359
0
      }
360
361
      // required .brpc.policy.MongoOp op_code = 4;
362
0
      case 4: {
363
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
364
0
            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
365
0
          int value;
366
0
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
367
0
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
368
0
                 input, &value)));
369
0
          if (::brpc::policy::MongoOp_IsValid(value)) {
370
0
            set_op_code(static_cast< ::brpc::policy::MongoOp >(value));
371
0
          } else {
372
0
            mutable_unknown_fields()->AddVarint(
373
0
                4, static_cast< ::google::protobuf::uint64>(value));
374
0
          }
375
0
        } else {
376
0
          goto handle_unusual;
377
0
        }
378
0
        break;
379
0
      }
380
381
0
      default: {
382
0
      handle_unusual:
383
0
        if (tag == 0) {
384
0
          goto success;
385
0
        }
386
0
        DO_(::google::protobuf::internal::WireFormat::SkipField(
387
0
              input, tag, _internal_metadata_.mutable_unknown_fields()));
388
0
        break;
389
0
      }
390
0
    }
391
0
  }
392
0
success:
393
  // @@protoc_insertion_point(parse_success:brpc.policy.MongoHeader)
394
0
  return true;
395
0
failure:
396
  // @@protoc_insertion_point(parse_failure:brpc.policy.MongoHeader)
397
0
  return false;
398
0
#undef DO_
399
0
}
400
401
void MongoHeader::SerializeWithCachedSizes(
402
0
    ::google::protobuf::io::CodedOutputStream* output) const {
403
  // @@protoc_insertion_point(serialize_start:brpc.policy.MongoHeader)
404
0
  ::google::protobuf::uint32 cached_has_bits = 0;
405
0
  (void) cached_has_bits;
406
407
0
  cached_has_bits = _has_bits_[0];
408
  // required int32 message_length = 1;
409
0
  if (cached_has_bits & 0x00000001u) {
410
0
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->message_length(), output);
411
0
  }
412
413
  // required int32 request_id = 2;
414
0
  if (cached_has_bits & 0x00000002u) {
415
0
    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->request_id(), output);
416
0
  }
417
418
  // required int32 response_to = 3;
419
0
  if (cached_has_bits & 0x00000004u) {
420
0
    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->response_to(), output);
421
0
  }
422
423
  // required .brpc.policy.MongoOp op_code = 4;
424
0
  if (cached_has_bits & 0x00000008u) {
425
0
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
426
0
      4, this->op_code(), output);
427
0
  }
428
429
0
  if (_internal_metadata_.have_unknown_fields()) {
430
0
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
431
0
        _internal_metadata_.unknown_fields(), output);
432
0
  }
433
  // @@protoc_insertion_point(serialize_end:brpc.policy.MongoHeader)
434
0
}
435
436
::google::protobuf::uint8* MongoHeader::InternalSerializeWithCachedSizesToArray(
437
0
    bool deterministic, ::google::protobuf::uint8* target) const {
438
0
  (void)deterministic; // Unused
439
  // @@protoc_insertion_point(serialize_to_array_start:brpc.policy.MongoHeader)
440
0
  ::google::protobuf::uint32 cached_has_bits = 0;
441
0
  (void) cached_has_bits;
442
443
0
  cached_has_bits = _has_bits_[0];
444
  // required int32 message_length = 1;
445
0
  if (cached_has_bits & 0x00000001u) {
446
0
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->message_length(), target);
447
0
  }
448
449
  // required int32 request_id = 2;
450
0
  if (cached_has_bits & 0x00000002u) {
451
0
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->request_id(), target);
452
0
  }
453
454
  // required int32 response_to = 3;
455
0
  if (cached_has_bits & 0x00000004u) {
456
0
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->response_to(), target);
457
0
  }
458
459
  // required .brpc.policy.MongoOp op_code = 4;
460
0
  if (cached_has_bits & 0x00000008u) {
461
0
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
462
0
      4, this->op_code(), target);
463
0
  }
464
465
0
  if (_internal_metadata_.have_unknown_fields()) {
466
0
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
467
0
        _internal_metadata_.unknown_fields(), target);
468
0
  }
469
  // @@protoc_insertion_point(serialize_to_array_end:brpc.policy.MongoHeader)
470
0
  return target;
471
0
}
472
473
0
size_t MongoHeader::RequiredFieldsByteSizeFallback() const {
474
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:brpc.policy.MongoHeader)
475
0
  size_t total_size = 0;
476
477
0
  if (has_message_length()) {
478
    // required int32 message_length = 1;
479
0
    total_size += 1 +
480
0
      ::google::protobuf::internal::WireFormatLite::Int32Size(
481
0
        this->message_length());
482
0
  }
483
484
0
  if (has_request_id()) {
485
    // required int32 request_id = 2;
486
0
    total_size += 1 +
487
0
      ::google::protobuf::internal::WireFormatLite::Int32Size(
488
0
        this->request_id());
489
0
  }
490
491
0
  if (has_response_to()) {
492
    // required int32 response_to = 3;
493
0
    total_size += 1 +
494
0
      ::google::protobuf::internal::WireFormatLite::Int32Size(
495
0
        this->response_to());
496
0
  }
497
498
0
  if (has_op_code()) {
499
    // required .brpc.policy.MongoOp op_code = 4;
500
0
    total_size += 1 +
501
0
      ::google::protobuf::internal::WireFormatLite::EnumSize(this->op_code());
502
0
  }
503
504
0
  return total_size;
505
0
}
506
0
size_t MongoHeader::ByteSizeLong() const {
507
// @@protoc_insertion_point(message_byte_size_start:brpc.policy.MongoHeader)
508
0
  size_t total_size = 0;
509
510
0
  if (_internal_metadata_.have_unknown_fields()) {
511
0
    total_size +=
512
0
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
513
0
        _internal_metadata_.unknown_fields());
514
0
  }
515
0
  if (((_has_bits_[0] & 0x0000000f) ^ 0x0000000f) == 0) {  // All required fields are present.
516
    // required int32 message_length = 1;
517
0
    total_size += 1 +
518
0
      ::google::protobuf::internal::WireFormatLite::Int32Size(
519
0
        this->message_length());
520
521
    // required int32 request_id = 2;
522
0
    total_size += 1 +
523
0
      ::google::protobuf::internal::WireFormatLite::Int32Size(
524
0
        this->request_id());
525
526
    // required int32 response_to = 3;
527
0
    total_size += 1 +
528
0
      ::google::protobuf::internal::WireFormatLite::Int32Size(
529
0
        this->response_to());
530
531
    // required .brpc.policy.MongoOp op_code = 4;
532
0
    total_size += 1 +
533
0
      ::google::protobuf::internal::WireFormatLite::EnumSize(this->op_code());
534
535
0
  } else {
536
0
    total_size += RequiredFieldsByteSizeFallback();
537
0
  }
538
0
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
539
0
  SetCachedSize(cached_size);
540
0
  return total_size;
541
0
}
542
543
0
void MongoHeader::MergeFrom(const ::google::protobuf::Message& from) {
544
// @@protoc_insertion_point(generalized_merge_from_start:brpc.policy.MongoHeader)
545
0
  GOOGLE_DCHECK_NE(&from, this);
546
0
  const MongoHeader* source =
547
0
      ::google::protobuf::internal::DynamicCastToGenerated<const MongoHeader>(
548
0
          &from);
549
0
  if (source == NULL) {
550
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:brpc.policy.MongoHeader)
551
0
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
552
0
  } else {
553
  // @@protoc_insertion_point(generalized_merge_from_cast_success:brpc.policy.MongoHeader)
554
0
    MergeFrom(*source);
555
0
  }
556
0
}
557
558
0
void MongoHeader::MergeFrom(const MongoHeader& from) {
559
// @@protoc_insertion_point(class_specific_merge_from_start:brpc.policy.MongoHeader)
560
0
  GOOGLE_DCHECK_NE(&from, this);
561
0
  _internal_metadata_.MergeFrom(from._internal_metadata_);
562
0
  ::google::protobuf::uint32 cached_has_bits = 0;
563
0
  (void) cached_has_bits;
564
565
0
  cached_has_bits = from._has_bits_[0];
566
0
  if (cached_has_bits & 15u) {
567
0
    if (cached_has_bits & 0x00000001u) {
568
0
      message_length_ = from.message_length_;
569
0
    }
570
0
    if (cached_has_bits & 0x00000002u) {
571
0
      request_id_ = from.request_id_;
572
0
    }
573
0
    if (cached_has_bits & 0x00000004u) {
574
0
      response_to_ = from.response_to_;
575
0
    }
576
0
    if (cached_has_bits & 0x00000008u) {
577
0
      op_code_ = from.op_code_;
578
0
    }
579
0
    _has_bits_[0] |= cached_has_bits;
580
0
  }
581
0
}
582
583
0
void MongoHeader::CopyFrom(const ::google::protobuf::Message& from) {
584
// @@protoc_insertion_point(generalized_copy_from_start:brpc.policy.MongoHeader)
585
0
  if (&from == this) return;
586
0
  Clear();
587
0
  MergeFrom(from);
588
0
}
589
590
0
void MongoHeader::CopyFrom(const MongoHeader& from) {
591
// @@protoc_insertion_point(class_specific_copy_from_start:brpc.policy.MongoHeader)
592
0
  if (&from == this) return;
593
0
  Clear();
594
0
  MergeFrom(from);
595
0
}
596
597
0
bool MongoHeader::IsInitialized() const {
598
0
  if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false;
599
0
  return true;
600
0
}
601
602
0
void MongoHeader::Swap(MongoHeader* other) {
603
0
  if (other == this) return;
604
0
  InternalSwap(other);
605
0
}
606
0
void MongoHeader::InternalSwap(MongoHeader* other) {
607
0
  using std::swap;
608
0
  swap(message_length_, other->message_length_);
609
0
  swap(request_id_, other->request_id_);
610
0
  swap(response_to_, other->response_to_);
611
0
  swap(op_code_, other->op_code_);
612
0
  swap(_has_bits_[0], other->_has_bits_[0]);
613
0
  _internal_metadata_.Swap(&other->_internal_metadata_);
614
0
}
615
616
0
::google::protobuf::Metadata MongoHeader::GetMetadata() const {
617
0
  protobuf_brpc_2fpolicy_2fmongo_2eproto::protobuf_AssignDescriptorsOnce();
618
0
  return ::protobuf_brpc_2fpolicy_2fmongo_2eproto::file_level_metadata[kIndexInFileMessages];
619
0
}
620
621
622
// ===================================================================
623
624
2
void MongoRequest::InitAsDefaultInstance() {
625
2
  ::brpc::policy::_MongoRequest_default_instance_._instance.get_mutable()->header_ = const_cast< ::brpc::policy::MongoHeader*>(
626
2
      ::brpc::policy::MongoHeader::internal_default_instance());
627
2
}
628
#if !defined(_MSC_VER) || _MSC_VER >= 1900
629
const int MongoRequest::kHeaderFieldNumber;
630
const int MongoRequest::kMessageFieldNumber;
631
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
632
633
MongoRequest::MongoRequest()
634
2
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
635
2
  ::google::protobuf::internal::InitSCC(
636
2
      &protobuf_brpc_2fpolicy_2fmongo_2eproto::scc_info_MongoRequest.base);
637
2
  SharedCtor();
638
  // @@protoc_insertion_point(constructor:brpc.policy.MongoRequest)
639
2
}
640
MongoRequest::MongoRequest(const MongoRequest& from)
641
0
  : ::google::protobuf::Message(),
642
0
      _internal_metadata_(NULL),
643
0
      _has_bits_(from._has_bits_) {
644
0
  _internal_metadata_.MergeFrom(from._internal_metadata_);
645
0
  message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
646
0
  if (from.has_message()) {
647
0
    message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message_);
648
0
  }
649
0
  if (from.has_header()) {
650
0
    header_ = new ::brpc::policy::MongoHeader(*from.header_);
651
0
  } else {
652
0
    header_ = NULL;
653
0
  }
654
  // @@protoc_insertion_point(copy_constructor:brpc.policy.MongoRequest)
655
0
}
656
657
2
void MongoRequest::SharedCtor() {
658
2
  message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
659
2
  header_ = NULL;
660
2
}
661
662
0
MongoRequest::~MongoRequest() {
663
  // @@protoc_insertion_point(destructor:brpc.policy.MongoRequest)
664
0
  SharedDtor();
665
0
}
666
667
0
void MongoRequest::SharedDtor() {
668
0
  message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
669
0
  if (this != internal_default_instance()) delete header_;
670
0
}
671
672
0
void MongoRequest::SetCachedSize(int size) const {
673
0
  _cached_size_.Set(size);
674
0
}
675
0
const ::google::protobuf::Descriptor* MongoRequest::descriptor() {
676
0
  ::protobuf_brpc_2fpolicy_2fmongo_2eproto::protobuf_AssignDescriptorsOnce();
677
0
  return ::protobuf_brpc_2fpolicy_2fmongo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
678
0
}
679
680
0
const MongoRequest& MongoRequest::default_instance() {
681
0
  ::google::protobuf::internal::InitSCC(&protobuf_brpc_2fpolicy_2fmongo_2eproto::scc_info_MongoRequest.base);
682
0
  return *internal_default_instance();
683
0
}
684
685
686
0
void MongoRequest::Clear() {
687
// @@protoc_insertion_point(message_clear_start:brpc.policy.MongoRequest)
688
0
  ::google::protobuf::uint32 cached_has_bits = 0;
689
  // Prevent compiler warnings about cached_has_bits being unused
690
0
  (void) cached_has_bits;
691
692
0
  cached_has_bits = _has_bits_[0];
693
0
  if (cached_has_bits & 3u) {
694
0
    if (cached_has_bits & 0x00000001u) {
695
0
      message_.ClearNonDefaultToEmptyNoArena();
696
0
    }
697
0
    if (cached_has_bits & 0x00000002u) {
698
0
      GOOGLE_DCHECK(header_ != NULL);
699
0
      header_->Clear();
700
0
    }
701
0
  }
702
0
  _has_bits_.Clear();
703
0
  _internal_metadata_.Clear();
704
0
}
705
706
bool MongoRequest::MergePartialFromCodedStream(
707
0
    ::google::protobuf::io::CodedInputStream* input) {
708
0
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
709
0
  ::google::protobuf::uint32 tag;
710
  // @@protoc_insertion_point(parse_start:brpc.policy.MongoRequest)
711
0
  for (;;) {
712
0
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
713
0
    tag = p.first;
714
0
    if (!p.second) goto handle_unusual;
715
0
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
716
      // required .brpc.policy.MongoHeader header = 1;
717
0
      case 1: {
718
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
719
0
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
720
0
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
721
0
               input, mutable_header()));
722
0
        } else {
723
0
          goto handle_unusual;
724
0
        }
725
0
        break;
726
0
      }
727
728
      // required string message = 2;
729
0
      case 2: {
730
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
731
0
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
732
0
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
733
0
                input, this->mutable_message()));
734
0
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
735
0
            this->message().data(), static_cast<int>(this->message().length()),
736
0
            ::google::protobuf::internal::WireFormat::PARSE,
737
0
            "brpc.policy.MongoRequest.message");
738
0
        } else {
739
0
          goto handle_unusual;
740
0
        }
741
0
        break;
742
0
      }
743
744
0
      default: {
745
0
      handle_unusual:
746
0
        if (tag == 0) {
747
0
          goto success;
748
0
        }
749
0
        DO_(::google::protobuf::internal::WireFormat::SkipField(
750
0
              input, tag, _internal_metadata_.mutable_unknown_fields()));
751
0
        break;
752
0
      }
753
0
    }
754
0
  }
755
0
success:
756
  // @@protoc_insertion_point(parse_success:brpc.policy.MongoRequest)
757
0
  return true;
758
0
failure:
759
  // @@protoc_insertion_point(parse_failure:brpc.policy.MongoRequest)
760
0
  return false;
761
0
#undef DO_
762
0
}
763
764
void MongoRequest::SerializeWithCachedSizes(
765
0
    ::google::protobuf::io::CodedOutputStream* output) const {
766
  // @@protoc_insertion_point(serialize_start:brpc.policy.MongoRequest)
767
0
  ::google::protobuf::uint32 cached_has_bits = 0;
768
0
  (void) cached_has_bits;
769
770
0
  cached_has_bits = _has_bits_[0];
771
  // required .brpc.policy.MongoHeader header = 1;
772
0
  if (cached_has_bits & 0x00000002u) {
773
0
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
774
0
      1, this->_internal_header(), output);
775
0
  }
776
777
  // required string message = 2;
778
0
  if (cached_has_bits & 0x00000001u) {
779
0
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
780
0
      this->message().data(), static_cast<int>(this->message().length()),
781
0
      ::google::protobuf::internal::WireFormat::SERIALIZE,
782
0
      "brpc.policy.MongoRequest.message");
783
0
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
784
0
      2, this->message(), output);
785
0
  }
786
787
0
  if (_internal_metadata_.have_unknown_fields()) {
788
0
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
789
0
        _internal_metadata_.unknown_fields(), output);
790
0
  }
791
  // @@protoc_insertion_point(serialize_end:brpc.policy.MongoRequest)
792
0
}
793
794
::google::protobuf::uint8* MongoRequest::InternalSerializeWithCachedSizesToArray(
795
0
    bool deterministic, ::google::protobuf::uint8* target) const {
796
0
  (void)deterministic; // Unused
797
  // @@protoc_insertion_point(serialize_to_array_start:brpc.policy.MongoRequest)
798
0
  ::google::protobuf::uint32 cached_has_bits = 0;
799
0
  (void) cached_has_bits;
800
801
0
  cached_has_bits = _has_bits_[0];
802
  // required .brpc.policy.MongoHeader header = 1;
803
0
  if (cached_has_bits & 0x00000002u) {
804
0
    target = ::google::protobuf::internal::WireFormatLite::
805
0
      InternalWriteMessageToArray(
806
0
        1, this->_internal_header(), deterministic, target);
807
0
  }
808
809
  // required string message = 2;
810
0
  if (cached_has_bits & 0x00000001u) {
811
0
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
812
0
      this->message().data(), static_cast<int>(this->message().length()),
813
0
      ::google::protobuf::internal::WireFormat::SERIALIZE,
814
0
      "brpc.policy.MongoRequest.message");
815
0
    target =
816
0
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
817
0
        2, this->message(), target);
818
0
  }
819
820
0
  if (_internal_metadata_.have_unknown_fields()) {
821
0
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
822
0
        _internal_metadata_.unknown_fields(), target);
823
0
  }
824
  // @@protoc_insertion_point(serialize_to_array_end:brpc.policy.MongoRequest)
825
0
  return target;
826
0
}
827
828
0
size_t MongoRequest::RequiredFieldsByteSizeFallback() const {
829
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:brpc.policy.MongoRequest)
830
0
  size_t total_size = 0;
831
832
0
  if (has_message()) {
833
    // required string message = 2;
834
0
    total_size += 1 +
835
0
      ::google::protobuf::internal::WireFormatLite::StringSize(
836
0
        this->message());
837
0
  }
838
839
0
  if (has_header()) {
840
    // required .brpc.policy.MongoHeader header = 1;
841
0
    total_size += 1 +
842
0
      ::google::protobuf::internal::WireFormatLite::MessageSize(
843
0
        *header_);
844
0
  }
845
846
0
  return total_size;
847
0
}
848
0
size_t MongoRequest::ByteSizeLong() const {
849
// @@protoc_insertion_point(message_byte_size_start:brpc.policy.MongoRequest)
850
0
  size_t total_size = 0;
851
852
0
  if (_internal_metadata_.have_unknown_fields()) {
853
0
    total_size +=
854
0
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
855
0
        _internal_metadata_.unknown_fields());
856
0
  }
857
0
  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
858
    // required string message = 2;
859
0
    total_size += 1 +
860
0
      ::google::protobuf::internal::WireFormatLite::StringSize(
861
0
        this->message());
862
863
    // required .brpc.policy.MongoHeader header = 1;
864
0
    total_size += 1 +
865
0
      ::google::protobuf::internal::WireFormatLite::MessageSize(
866
0
        *header_);
867
868
0
  } else {
869
0
    total_size += RequiredFieldsByteSizeFallback();
870
0
  }
871
0
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
872
0
  SetCachedSize(cached_size);
873
0
  return total_size;
874
0
}
875
876
0
void MongoRequest::MergeFrom(const ::google::protobuf::Message& from) {
877
// @@protoc_insertion_point(generalized_merge_from_start:brpc.policy.MongoRequest)
878
0
  GOOGLE_DCHECK_NE(&from, this);
879
0
  const MongoRequest* source =
880
0
      ::google::protobuf::internal::DynamicCastToGenerated<const MongoRequest>(
881
0
          &from);
882
0
  if (source == NULL) {
883
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:brpc.policy.MongoRequest)
884
0
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
885
0
  } else {
886
  // @@protoc_insertion_point(generalized_merge_from_cast_success:brpc.policy.MongoRequest)
887
0
    MergeFrom(*source);
888
0
  }
889
0
}
890
891
0
void MongoRequest::MergeFrom(const MongoRequest& from) {
892
// @@protoc_insertion_point(class_specific_merge_from_start:brpc.policy.MongoRequest)
893
0
  GOOGLE_DCHECK_NE(&from, this);
894
0
  _internal_metadata_.MergeFrom(from._internal_metadata_);
895
0
  ::google::protobuf::uint32 cached_has_bits = 0;
896
0
  (void) cached_has_bits;
897
898
0
  cached_has_bits = from._has_bits_[0];
899
0
  if (cached_has_bits & 3u) {
900
0
    if (cached_has_bits & 0x00000001u) {
901
0
      set_has_message();
902
0
      message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message_);
903
0
    }
904
0
    if (cached_has_bits & 0x00000002u) {
905
0
      mutable_header()->::brpc::policy::MongoHeader::MergeFrom(from.header());
906
0
    }
907
0
  }
908
0
}
909
910
0
void MongoRequest::CopyFrom(const ::google::protobuf::Message& from) {
911
// @@protoc_insertion_point(generalized_copy_from_start:brpc.policy.MongoRequest)
912
0
  if (&from == this) return;
913
0
  Clear();
914
0
  MergeFrom(from);
915
0
}
916
917
0
void MongoRequest::CopyFrom(const MongoRequest& from) {
918
// @@protoc_insertion_point(class_specific_copy_from_start:brpc.policy.MongoRequest)
919
0
  if (&from == this) return;
920
0
  Clear();
921
0
  MergeFrom(from);
922
0
}
923
924
0
bool MongoRequest::IsInitialized() const {
925
0
  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
926
0
  if (has_header()) {
927
0
    if (!this->header_->IsInitialized()) return false;
928
0
  }
929
0
  return true;
930
0
}
931
932
0
void MongoRequest::Swap(MongoRequest* other) {
933
0
  if (other == this) return;
934
0
  InternalSwap(other);
935
0
}
936
0
void MongoRequest::InternalSwap(MongoRequest* other) {
937
0
  using std::swap;
938
0
  message_.Swap(&other->message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
939
0
    GetArenaNoVirtual());
940
0
  swap(header_, other->header_);
941
0
  swap(_has_bits_[0], other->_has_bits_[0]);
942
0
  _internal_metadata_.Swap(&other->_internal_metadata_);
943
0
}
944
945
0
::google::protobuf::Metadata MongoRequest::GetMetadata() const {
946
0
  protobuf_brpc_2fpolicy_2fmongo_2eproto::protobuf_AssignDescriptorsOnce();
947
0
  return ::protobuf_brpc_2fpolicy_2fmongo_2eproto::file_level_metadata[kIndexInFileMessages];
948
0
}
949
950
951
// ===================================================================
952
953
2
void MongoResponse::InitAsDefaultInstance() {
954
2
  ::brpc::policy::_MongoResponse_default_instance_._instance.get_mutable()->header_ = const_cast< ::brpc::policy::MongoHeader*>(
955
2
      ::brpc::policy::MongoHeader::internal_default_instance());
956
2
}
957
#if !defined(_MSC_VER) || _MSC_VER >= 1900
958
const int MongoResponse::kHeaderFieldNumber;
959
const int MongoResponse::kResponseFlagsFieldNumber;
960
const int MongoResponse::kCursorIdFieldNumber;
961
const int MongoResponse::kStartingFromFieldNumber;
962
const int MongoResponse::kNumberReturnedFieldNumber;
963
const int MongoResponse::kMessageFieldNumber;
964
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
965
966
MongoResponse::MongoResponse()
967
2
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
968
2
  ::google::protobuf::internal::InitSCC(
969
2
      &protobuf_brpc_2fpolicy_2fmongo_2eproto::scc_info_MongoResponse.base);
970
2
  SharedCtor();
971
  // @@protoc_insertion_point(constructor:brpc.policy.MongoResponse)
972
2
}
973
MongoResponse::MongoResponse(const MongoResponse& from)
974
0
  : ::google::protobuf::Message(),
975
0
      _internal_metadata_(NULL),
976
0
      _has_bits_(from._has_bits_) {
977
0
  _internal_metadata_.MergeFrom(from._internal_metadata_);
978
0
  message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
979
0
  if (from.has_message()) {
980
0
    message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message_);
981
0
  }
982
0
  if (from.has_header()) {
983
0
    header_ = new ::brpc::policy::MongoHeader(*from.header_);
984
0
  } else {
985
0
    header_ = NULL;
986
0
  }
987
0
  ::memcpy(&cursor_id_, &from.cursor_id_,
988
0
    static_cast<size_t>(reinterpret_cast<char*>(&number_returned_) -
989
0
    reinterpret_cast<char*>(&cursor_id_)) + sizeof(number_returned_));
990
  // @@protoc_insertion_point(copy_constructor:brpc.policy.MongoResponse)
991
0
}
992
993
2
void MongoResponse::SharedCtor() {
994
2
  message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
995
2
  ::memset(&header_, 0, static_cast<size_t>(
996
2
      reinterpret_cast<char*>(&number_returned_) -
997
2
      reinterpret_cast<char*>(&header_)) + sizeof(number_returned_));
998
2
}
999
1000
0
MongoResponse::~MongoResponse() {
1001
  // @@protoc_insertion_point(destructor:brpc.policy.MongoResponse)
1002
0
  SharedDtor();
1003
0
}
1004
1005
0
void MongoResponse::SharedDtor() {
1006
0
  message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1007
0
  if (this != internal_default_instance()) delete header_;
1008
0
}
1009
1010
0
void MongoResponse::SetCachedSize(int size) const {
1011
0
  _cached_size_.Set(size);
1012
0
}
1013
0
const ::google::protobuf::Descriptor* MongoResponse::descriptor() {
1014
0
  ::protobuf_brpc_2fpolicy_2fmongo_2eproto::protobuf_AssignDescriptorsOnce();
1015
0
  return ::protobuf_brpc_2fpolicy_2fmongo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
1016
0
}
1017
1018
0
const MongoResponse& MongoResponse::default_instance() {
1019
0
  ::google::protobuf::internal::InitSCC(&protobuf_brpc_2fpolicy_2fmongo_2eproto::scc_info_MongoResponse.base);
1020
0
  return *internal_default_instance();
1021
0
}
1022
1023
1024
0
void MongoResponse::Clear() {
1025
// @@protoc_insertion_point(message_clear_start:brpc.policy.MongoResponse)
1026
0
  ::google::protobuf::uint32 cached_has_bits = 0;
1027
  // Prevent compiler warnings about cached_has_bits being unused
1028
0
  (void) cached_has_bits;
1029
1030
0
  cached_has_bits = _has_bits_[0];
1031
0
  if (cached_has_bits & 3u) {
1032
0
    if (cached_has_bits & 0x00000001u) {
1033
0
      message_.ClearNonDefaultToEmptyNoArena();
1034
0
    }
1035
0
    if (cached_has_bits & 0x00000002u) {
1036
0
      GOOGLE_DCHECK(header_ != NULL);
1037
0
      header_->Clear();
1038
0
    }
1039
0
  }
1040
0
  if (cached_has_bits & 60u) {
1041
0
    ::memset(&cursor_id_, 0, static_cast<size_t>(
1042
0
        reinterpret_cast<char*>(&number_returned_) -
1043
0
        reinterpret_cast<char*>(&cursor_id_)) + sizeof(number_returned_));
1044
0
  }
1045
0
  _has_bits_.Clear();
1046
0
  _internal_metadata_.Clear();
1047
0
}
1048
1049
bool MongoResponse::MergePartialFromCodedStream(
1050
0
    ::google::protobuf::io::CodedInputStream* input) {
1051
0
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
1052
0
  ::google::protobuf::uint32 tag;
1053
  // @@protoc_insertion_point(parse_start:brpc.policy.MongoResponse)
1054
0
  for (;;) {
1055
0
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
1056
0
    tag = p.first;
1057
0
    if (!p.second) goto handle_unusual;
1058
0
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1059
      // required .brpc.policy.MongoHeader header = 1;
1060
0
      case 1: {
1061
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1062
0
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
1063
0
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
1064
0
               input, mutable_header()));
1065
0
        } else {
1066
0
          goto handle_unusual;
1067
0
        }
1068
0
        break;
1069
0
      }
1070
1071
      // required int32 response_flags = 2;
1072
0
      case 2: {
1073
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1074
0
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
1075
0
          set_has_response_flags();
1076
0
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1077
0
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
1078
0
                 input, &response_flags_)));
1079
0
        } else {
1080
0
          goto handle_unusual;
1081
0
        }
1082
0
        break;
1083
0
      }
1084
1085
      // required int64 cursor_id = 3;
1086
0
      case 3: {
1087
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1088
0
            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
1089
0
          set_has_cursor_id();
1090
0
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1091
0
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
1092
0
                 input, &cursor_id_)));
1093
0
        } else {
1094
0
          goto handle_unusual;
1095
0
        }
1096
0
        break;
1097
0
      }
1098
1099
      // required int32 starting_from = 4;
1100
0
      case 4: {
1101
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1102
0
            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
1103
0
          set_has_starting_from();
1104
0
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1105
0
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
1106
0
                 input, &starting_from_)));
1107
0
        } else {
1108
0
          goto handle_unusual;
1109
0
        }
1110
0
        break;
1111
0
      }
1112
1113
      // required int32 number_returned = 5;
1114
0
      case 5: {
1115
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1116
0
            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
1117
0
          set_has_number_returned();
1118
0
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1119
0
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
1120
0
                 input, &number_returned_)));
1121
0
        } else {
1122
0
          goto handle_unusual;
1123
0
        }
1124
0
        break;
1125
0
      }
1126
1127
      // required string message = 6;
1128
0
      case 6: {
1129
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1130
0
            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
1131
0
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
1132
0
                input, this->mutable_message()));
1133
0
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1134
0
            this->message().data(), static_cast<int>(this->message().length()),
1135
0
            ::google::protobuf::internal::WireFormat::PARSE,
1136
0
            "brpc.policy.MongoResponse.message");
1137
0
        } else {
1138
0
          goto handle_unusual;
1139
0
        }
1140
0
        break;
1141
0
      }
1142
1143
0
      default: {
1144
0
      handle_unusual:
1145
0
        if (tag == 0) {
1146
0
          goto success;
1147
0
        }
1148
0
        DO_(::google::protobuf::internal::WireFormat::SkipField(
1149
0
              input, tag, _internal_metadata_.mutable_unknown_fields()));
1150
0
        break;
1151
0
      }
1152
0
    }
1153
0
  }
1154
0
success:
1155
  // @@protoc_insertion_point(parse_success:brpc.policy.MongoResponse)
1156
0
  return true;
1157
0
failure:
1158
  // @@protoc_insertion_point(parse_failure:brpc.policy.MongoResponse)
1159
0
  return false;
1160
0
#undef DO_
1161
0
}
1162
1163
void MongoResponse::SerializeWithCachedSizes(
1164
0
    ::google::protobuf::io::CodedOutputStream* output) const {
1165
  // @@protoc_insertion_point(serialize_start:brpc.policy.MongoResponse)
1166
0
  ::google::protobuf::uint32 cached_has_bits = 0;
1167
0
  (void) cached_has_bits;
1168
1169
0
  cached_has_bits = _has_bits_[0];
1170
  // required .brpc.policy.MongoHeader header = 1;
1171
0
  if (cached_has_bits & 0x00000002u) {
1172
0
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1173
0
      1, this->_internal_header(), output);
1174
0
  }
1175
1176
  // required int32 response_flags = 2;
1177
0
  if (cached_has_bits & 0x00000008u) {
1178
0
    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->response_flags(), output);
1179
0
  }
1180
1181
  // required int64 cursor_id = 3;
1182
0
  if (cached_has_bits & 0x00000004u) {
1183
0
    ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->cursor_id(), output);
1184
0
  }
1185
1186
  // required int32 starting_from = 4;
1187
0
  if (cached_has_bits & 0x00000010u) {
1188
0
    ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->starting_from(), output);
1189
0
  }
1190
1191
  // required int32 number_returned = 5;
1192
0
  if (cached_has_bits & 0x00000020u) {
1193
0
    ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->number_returned(), output);
1194
0
  }
1195
1196
  // required string message = 6;
1197
0
  if (cached_has_bits & 0x00000001u) {
1198
0
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1199
0
      this->message().data(), static_cast<int>(this->message().length()),
1200
0
      ::google::protobuf::internal::WireFormat::SERIALIZE,
1201
0
      "brpc.policy.MongoResponse.message");
1202
0
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
1203
0
      6, this->message(), output);
1204
0
  }
1205
1206
0
  if (_internal_metadata_.have_unknown_fields()) {
1207
0
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
1208
0
        _internal_metadata_.unknown_fields(), output);
1209
0
  }
1210
  // @@protoc_insertion_point(serialize_end:brpc.policy.MongoResponse)
1211
0
}
1212
1213
::google::protobuf::uint8* MongoResponse::InternalSerializeWithCachedSizesToArray(
1214
0
    bool deterministic, ::google::protobuf::uint8* target) const {
1215
0
  (void)deterministic; // Unused
1216
  // @@protoc_insertion_point(serialize_to_array_start:brpc.policy.MongoResponse)
1217
0
  ::google::protobuf::uint32 cached_has_bits = 0;
1218
0
  (void) cached_has_bits;
1219
1220
0
  cached_has_bits = _has_bits_[0];
1221
  // required .brpc.policy.MongoHeader header = 1;
1222
0
  if (cached_has_bits & 0x00000002u) {
1223
0
    target = ::google::protobuf::internal::WireFormatLite::
1224
0
      InternalWriteMessageToArray(
1225
0
        1, this->_internal_header(), deterministic, target);
1226
0
  }
1227
1228
  // required int32 response_flags = 2;
1229
0
  if (cached_has_bits & 0x00000008u) {
1230
0
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->response_flags(), target);
1231
0
  }
1232
1233
  // required int64 cursor_id = 3;
1234
0
  if (cached_has_bits & 0x00000004u) {
1235
0
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->cursor_id(), target);
1236
0
  }
1237
1238
  // required int32 starting_from = 4;
1239
0
  if (cached_has_bits & 0x00000010u) {
1240
0
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->starting_from(), target);
1241
0
  }
1242
1243
  // required int32 number_returned = 5;
1244
0
  if (cached_has_bits & 0x00000020u) {
1245
0
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->number_returned(), target);
1246
0
  }
1247
1248
  // required string message = 6;
1249
0
  if (cached_has_bits & 0x00000001u) {
1250
0
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1251
0
      this->message().data(), static_cast<int>(this->message().length()),
1252
0
      ::google::protobuf::internal::WireFormat::SERIALIZE,
1253
0
      "brpc.policy.MongoResponse.message");
1254
0
    target =
1255
0
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1256
0
        6, this->message(), target);
1257
0
  }
1258
1259
0
  if (_internal_metadata_.have_unknown_fields()) {
1260
0
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
1261
0
        _internal_metadata_.unknown_fields(), target);
1262
0
  }
1263
  // @@protoc_insertion_point(serialize_to_array_end:brpc.policy.MongoResponse)
1264
0
  return target;
1265
0
}
1266
1267
0
size_t MongoResponse::RequiredFieldsByteSizeFallback() const {
1268
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:brpc.policy.MongoResponse)
1269
0
  size_t total_size = 0;
1270
1271
0
  if (has_message()) {
1272
    // required string message = 6;
1273
0
    total_size += 1 +
1274
0
      ::google::protobuf::internal::WireFormatLite::StringSize(
1275
0
        this->message());
1276
0
  }
1277
1278
0
  if (has_header()) {
1279
    // required .brpc.policy.MongoHeader header = 1;
1280
0
    total_size += 1 +
1281
0
      ::google::protobuf::internal::WireFormatLite::MessageSize(
1282
0
        *header_);
1283
0
  }
1284
1285
0
  if (has_cursor_id()) {
1286
    // required int64 cursor_id = 3;
1287
0
    total_size += 1 +
1288
0
      ::google::protobuf::internal::WireFormatLite::Int64Size(
1289
0
        this->cursor_id());
1290
0
  }
1291
1292
0
  if (has_response_flags()) {
1293
    // required int32 response_flags = 2;
1294
0
    total_size += 1 +
1295
0
      ::google::protobuf::internal::WireFormatLite::Int32Size(
1296
0
        this->response_flags());
1297
0
  }
1298
1299
0
  if (has_starting_from()) {
1300
    // required int32 starting_from = 4;
1301
0
    total_size += 1 +
1302
0
      ::google::protobuf::internal::WireFormatLite::Int32Size(
1303
0
        this->starting_from());
1304
0
  }
1305
1306
0
  if (has_number_returned()) {
1307
    // required int32 number_returned = 5;
1308
0
    total_size += 1 +
1309
0
      ::google::protobuf::internal::WireFormatLite::Int32Size(
1310
0
        this->number_returned());
1311
0
  }
1312
1313
0
  return total_size;
1314
0
}
1315
0
size_t MongoResponse::ByteSizeLong() const {
1316
// @@protoc_insertion_point(message_byte_size_start:brpc.policy.MongoResponse)
1317
0
  size_t total_size = 0;
1318
1319
0
  if (_internal_metadata_.have_unknown_fields()) {
1320
0
    total_size +=
1321
0
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
1322
0
        _internal_metadata_.unknown_fields());
1323
0
  }
1324
0
  if (((_has_bits_[0] & 0x0000003f) ^ 0x0000003f) == 0) {  // All required fields are present.
1325
    // required string message = 6;
1326
0
    total_size += 1 +
1327
0
      ::google::protobuf::internal::WireFormatLite::StringSize(
1328
0
        this->message());
1329
1330
    // required .brpc.policy.MongoHeader header = 1;
1331
0
    total_size += 1 +
1332
0
      ::google::protobuf::internal::WireFormatLite::MessageSize(
1333
0
        *header_);
1334
1335
    // required int64 cursor_id = 3;
1336
0
    total_size += 1 +
1337
0
      ::google::protobuf::internal::WireFormatLite::Int64Size(
1338
0
        this->cursor_id());
1339
1340
    // required int32 response_flags = 2;
1341
0
    total_size += 1 +
1342
0
      ::google::protobuf::internal::WireFormatLite::Int32Size(
1343
0
        this->response_flags());
1344
1345
    // required int32 starting_from = 4;
1346
0
    total_size += 1 +
1347
0
      ::google::protobuf::internal::WireFormatLite::Int32Size(
1348
0
        this->starting_from());
1349
1350
    // required int32 number_returned = 5;
1351
0
    total_size += 1 +
1352
0
      ::google::protobuf::internal::WireFormatLite::Int32Size(
1353
0
        this->number_returned());
1354
1355
0
  } else {
1356
0
    total_size += RequiredFieldsByteSizeFallback();
1357
0
  }
1358
0
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
1359
0
  SetCachedSize(cached_size);
1360
0
  return total_size;
1361
0
}
1362
1363
0
void MongoResponse::MergeFrom(const ::google::protobuf::Message& from) {
1364
// @@protoc_insertion_point(generalized_merge_from_start:brpc.policy.MongoResponse)
1365
0
  GOOGLE_DCHECK_NE(&from, this);
1366
0
  const MongoResponse* source =
1367
0
      ::google::protobuf::internal::DynamicCastToGenerated<const MongoResponse>(
1368
0
          &from);
1369
0
  if (source == NULL) {
1370
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:brpc.policy.MongoResponse)
1371
0
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
1372
0
  } else {
1373
  // @@protoc_insertion_point(generalized_merge_from_cast_success:brpc.policy.MongoResponse)
1374
0
    MergeFrom(*source);
1375
0
  }
1376
0
}
1377
1378
0
void MongoResponse::MergeFrom(const MongoResponse& from) {
1379
// @@protoc_insertion_point(class_specific_merge_from_start:brpc.policy.MongoResponse)
1380
0
  GOOGLE_DCHECK_NE(&from, this);
1381
0
  _internal_metadata_.MergeFrom(from._internal_metadata_);
1382
0
  ::google::protobuf::uint32 cached_has_bits = 0;
1383
0
  (void) cached_has_bits;
1384
1385
0
  cached_has_bits = from._has_bits_[0];
1386
0
  if (cached_has_bits & 63u) {
1387
0
    if (cached_has_bits & 0x00000001u) {
1388
0
      set_has_message();
1389
0
      message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message_);
1390
0
    }
1391
0
    if (cached_has_bits & 0x00000002u) {
1392
0
      mutable_header()->::brpc::policy::MongoHeader::MergeFrom(from.header());
1393
0
    }
1394
0
    if (cached_has_bits & 0x00000004u) {
1395
0
      cursor_id_ = from.cursor_id_;
1396
0
    }
1397
0
    if (cached_has_bits & 0x00000008u) {
1398
0
      response_flags_ = from.response_flags_;
1399
0
    }
1400
0
    if (cached_has_bits & 0x00000010u) {
1401
0
      starting_from_ = from.starting_from_;
1402
0
    }
1403
0
    if (cached_has_bits & 0x00000020u) {
1404
0
      number_returned_ = from.number_returned_;
1405
0
    }
1406
0
    _has_bits_[0] |= cached_has_bits;
1407
0
  }
1408
0
}
1409
1410
0
void MongoResponse::CopyFrom(const ::google::protobuf::Message& from) {
1411
// @@protoc_insertion_point(generalized_copy_from_start:brpc.policy.MongoResponse)
1412
0
  if (&from == this) return;
1413
0
  Clear();
1414
0
  MergeFrom(from);
1415
0
}
1416
1417
0
void MongoResponse::CopyFrom(const MongoResponse& from) {
1418
// @@protoc_insertion_point(class_specific_copy_from_start:brpc.policy.MongoResponse)
1419
0
  if (&from == this) return;
1420
0
  Clear();
1421
0
  MergeFrom(from);
1422
0
}
1423
1424
0
bool MongoResponse::IsInitialized() const {
1425
0
  if ((_has_bits_[0] & 0x0000003f) != 0x0000003f) return false;
1426
0
  if (has_header()) {
1427
0
    if (!this->header_->IsInitialized()) return false;
1428
0
  }
1429
0
  return true;
1430
0
}
1431
1432
0
void MongoResponse::Swap(MongoResponse* other) {
1433
0
  if (other == this) return;
1434
0
  InternalSwap(other);
1435
0
}
1436
0
void MongoResponse::InternalSwap(MongoResponse* other) {
1437
0
  using std::swap;
1438
0
  message_.Swap(&other->message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
1439
0
    GetArenaNoVirtual());
1440
0
  swap(header_, other->header_);
1441
0
  swap(cursor_id_, other->cursor_id_);
1442
0
  swap(response_flags_, other->response_flags_);
1443
0
  swap(starting_from_, other->starting_from_);
1444
0
  swap(number_returned_, other->number_returned_);
1445
0
  swap(_has_bits_[0], other->_has_bits_[0]);
1446
0
  _internal_metadata_.Swap(&other->_internal_metadata_);
1447
0
}
1448
1449
0
::google::protobuf::Metadata MongoResponse::GetMetadata() const {
1450
0
  protobuf_brpc_2fpolicy_2fmongo_2eproto::protobuf_AssignDescriptorsOnce();
1451
0
  return ::protobuf_brpc_2fpolicy_2fmongo_2eproto::file_level_metadata[kIndexInFileMessages];
1452
0
}
1453
1454
1455
// ===================================================================
1456
1457
0
MongoService::~MongoService() {}
1458
1459
0
const ::google::protobuf::ServiceDescriptor* MongoService::descriptor() {
1460
0
  protobuf_brpc_2fpolicy_2fmongo_2eproto::protobuf_AssignDescriptorsOnce();
1461
0
  return protobuf_brpc_2fpolicy_2fmongo_2eproto::file_level_service_descriptors[0];
1462
0
}
1463
1464
0
const ::google::protobuf::ServiceDescriptor* MongoService::GetDescriptor() {
1465
0
  return descriptor();
1466
0
}
1467
1468
void MongoService::default_method(::google::protobuf::RpcController* controller,
1469
                         const ::brpc::policy::MongoRequest*,
1470
                         ::brpc::policy::MongoResponse*,
1471
0
                         ::google::protobuf::Closure* done) {
1472
0
  controller->SetFailed("Method default_method() not implemented.");
1473
0
  done->Run();
1474
0
}
1475
1476
void MongoService::CallMethod(const ::google::protobuf::MethodDescriptor* method,
1477
                             ::google::protobuf::RpcController* controller,
1478
                             const ::google::protobuf::Message* request,
1479
                             ::google::protobuf::Message* response,
1480
0
                             ::google::protobuf::Closure* done) {
1481
0
  GOOGLE_DCHECK_EQ(method->service(), protobuf_brpc_2fpolicy_2fmongo_2eproto::file_level_service_descriptors[0]);
1482
0
  switch(method->index()) {
1483
0
    case 0:
1484
0
      default_method(controller,
1485
0
             ::google::protobuf::down_cast<const ::brpc::policy::MongoRequest*>(request),
1486
0
             ::google::protobuf::down_cast< ::brpc::policy::MongoResponse*>(response),
1487
0
             done);
1488
0
      break;
1489
0
    default:
1490
0
      GOOGLE_LOG(FATAL) << "Bad method index; this should never happen.";
1491
0
      break;
1492
0
  }
1493
0
}
1494
1495
const ::google::protobuf::Message& MongoService::GetRequestPrototype(
1496
0
    const ::google::protobuf::MethodDescriptor* method) const {
1497
0
  GOOGLE_DCHECK_EQ(method->service(), descriptor());
1498
0
  switch(method->index()) {
1499
0
    case 0:
1500
0
      return ::brpc::policy::MongoRequest::default_instance();
1501
0
    default:
1502
0
      GOOGLE_LOG(FATAL) << "Bad method index; this should never happen.";
1503
0
      return *::google::protobuf::MessageFactory::generated_factory()
1504
0
          ->GetPrototype(method->input_type());
1505
0
  }
1506
0
}
1507
1508
const ::google::protobuf::Message& MongoService::GetResponsePrototype(
1509
0
    const ::google::protobuf::MethodDescriptor* method) const {
1510
0
  GOOGLE_DCHECK_EQ(method->service(), descriptor());
1511
0
  switch(method->index()) {
1512
0
    case 0:
1513
0
      return ::brpc::policy::MongoResponse::default_instance();
1514
0
    default:
1515
0
      GOOGLE_LOG(FATAL) << "Bad method index; this should never happen.";
1516
0
      return *::google::protobuf::MessageFactory::generated_factory()
1517
0
          ->GetPrototype(method->output_type());
1518
0
  }
1519
0
}
1520
1521
MongoService_Stub::MongoService_Stub(::google::protobuf::RpcChannel* channel)
1522
0
  : channel_(channel), owns_channel_(false) {}
1523
MongoService_Stub::MongoService_Stub(
1524
    ::google::protobuf::RpcChannel* channel,
1525
    ::google::protobuf::Service::ChannelOwnership ownership)
1526
0
  : channel_(channel),
1527
0
    owns_channel_(ownership == ::google::protobuf::Service::STUB_OWNS_CHANNEL) {}
1528
0
MongoService_Stub::~MongoService_Stub() {
1529
0
  if (owns_channel_) delete channel_;
1530
0
}
1531
1532
void MongoService_Stub::default_method(::google::protobuf::RpcController* controller,
1533
                              const ::brpc::policy::MongoRequest* request,
1534
                              ::brpc::policy::MongoResponse* response,
1535
0
                              ::google::protobuf::Closure* done) {
1536
0
  channel_->CallMethod(descriptor()->method(0),
1537
0
                       controller, request, response, done);
1538
0
}
1539
1540
// @@protoc_insertion_point(namespace_scope)
1541
}  // namespace policy
1542
}  // namespace brpc
1543
namespace google {
1544
namespace protobuf {
1545
0
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::brpc::policy::MongoHeader* Arena::CreateMaybeMessage< ::brpc::policy::MongoHeader >(Arena* arena) {
1546
0
  return Arena::CreateInternal< ::brpc::policy::MongoHeader >(arena);
1547
0
}
1548
0
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::brpc::policy::MongoRequest* Arena::CreateMaybeMessage< ::brpc::policy::MongoRequest >(Arena* arena) {
1549
0
  return Arena::CreateInternal< ::brpc::policy::MongoRequest >(arena);
1550
0
}
1551
0
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::brpc::policy::MongoResponse* Arena::CreateMaybeMessage< ::brpc::policy::MongoResponse >(Arena* arena) {
1552
0
  return Arena::CreateInternal< ::brpc::policy::MongoResponse >(arena);
1553
0
}
1554
}  // namespace protobuf
1555
}  // namespace google
1556
1557
// @@protoc_insertion_point(global_scope)