Coverage Report

Created: 2025-06-13 06:23

/src/brpc/build/test/snappy_message.pb.cc
Line
Count
Source (jump to first uncovered line)
1
// Generated by the protocol buffer compiler.  DO NOT EDIT!
2
// source: snappy_message.proto
3
4
#include "snappy_message.pb.h"
5
6
#include <algorithm>
7
8
#include <google/protobuf/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 snappy_message {
23
class SnappyMessageProtoDefaultTypeInternal {
24
 public:
25
  ::google::protobuf::internal::ExplicitlyConstructed<SnappyMessageProto>
26
      _instance;
27
} _SnappyMessageProto_default_instance_;
28
}  // namespace snappy_message
29
namespace protobuf_snappy_5fmessage_2eproto {
30
2
static void InitDefaultsSnappyMessageProto() {
31
2
  GOOGLE_PROTOBUF_VERIFY_VERSION;
32
33
2
  {
34
2
    void* ptr = &::snappy_message::_SnappyMessageProto_default_instance_;
35
2
    new (ptr) ::snappy_message::SnappyMessageProto();
36
2
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
37
2
  }
38
2
  ::snappy_message::SnappyMessageProto::InitAsDefaultInstance();
39
2
}
40
41
::google::protobuf::internal::SCCInfo<0> scc_info_SnappyMessageProto =
42
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSnappyMessageProto}, {}};
43
44
2
void InitDefaults() {
45
2
  ::google::protobuf::internal::InitSCC(&scc_info_SnappyMessageProto.base);
46
2
}
47
48
::google::protobuf::Metadata file_level_metadata[1];
49
50
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
51
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::snappy_message::SnappyMessageProto, _has_bits_),
52
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::snappy_message::SnappyMessageProto, _internal_metadata_),
53
  ~0u,  // no _extensions_
54
  ~0u,  // no _oneof_case_
55
  ~0u,  // no _weak_field_map_
56
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::snappy_message::SnappyMessageProto, text_),
57
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::snappy_message::SnappyMessageProto, numbers_),
58
  0,
59
  ~0u,
60
};
61
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
62
  { 0, 7, sizeof(::snappy_message::SnappyMessageProto)},
63
};
64
65
static ::google::protobuf::Message const * const file_default_instances[] = {
66
  reinterpret_cast<const ::google::protobuf::Message*>(&::snappy_message::_SnappyMessageProto_default_instance_),
67
};
68
69
0
void protobuf_AssignDescriptors() {
70
0
  AddDescriptors();
71
0
  AssignDescriptors(
72
0
      "snappy_message.proto", schemas, file_default_instances, TableStruct::offsets,
73
0
      file_level_metadata, NULL, NULL);
74
0
}
75
76
0
void protobuf_AssignDescriptorsOnce() {
77
0
  static ::google::protobuf::internal::once_flag once;
78
0
  ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
79
0
}
80
81
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
82
0
void protobuf_RegisterTypes(const ::std::string&) {
83
0
  protobuf_AssignDescriptorsOnce();
84
0
  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
85
0
}
86
87
2
void AddDescriptorsImpl() {
88
2
  InitDefaults();
89
2
  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
90
2
      "\n\024snappy_message.proto\022\016snappy_message\"3"
91
2
      "\n\022SnappyMessageProto\022\014\n\004text\030\001 \001(\t\022\017\n\007nu"
92
2
      "mbers\030\002 \003(\005"
93
2
  };
94
2
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
95
2
      descriptor, 91);
96
2
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
97
2
    "snappy_message.proto", &protobuf_RegisterTypes);
98
2
}
99
100
2
void AddDescriptors() {
101
2
  static ::google::protobuf::internal::once_flag once;
102
2
  ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
103
2
}
104
// Force AddDescriptors() to be called at dynamic initialization time.
105
struct StaticDescriptorInitializer {
106
2
  StaticDescriptorInitializer() {
107
2
    AddDescriptors();
108
2
  }
109
} static_descriptor_initializer;
110
}  // namespace protobuf_snappy_5fmessage_2eproto
111
namespace snappy_message {
112
113
// ===================================================================
114
115
2
void SnappyMessageProto::InitAsDefaultInstance() {
116
2
}
117
#if !defined(_MSC_VER) || _MSC_VER >= 1900
118
const int SnappyMessageProto::kTextFieldNumber;
119
const int SnappyMessageProto::kNumbersFieldNumber;
120
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
121
122
SnappyMessageProto::SnappyMessageProto()
123
2
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
124
2
  ::google::protobuf::internal::InitSCC(
125
2
      &protobuf_snappy_5fmessage_2eproto::scc_info_SnappyMessageProto.base);
126
2
  SharedCtor();
127
  // @@protoc_insertion_point(constructor:snappy_message.SnappyMessageProto)
128
2
}
129
SnappyMessageProto::SnappyMessageProto(const SnappyMessageProto& from)
130
0
  : ::google::protobuf::Message(),
131
0
      _internal_metadata_(NULL),
132
0
      _has_bits_(from._has_bits_),
133
0
      numbers_(from.numbers_) {
134
0
  _internal_metadata_.MergeFrom(from._internal_metadata_);
135
0
  text_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
136
0
  if (from.has_text()) {
137
0
    text_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.text_);
138
0
  }
139
  // @@protoc_insertion_point(copy_constructor:snappy_message.SnappyMessageProto)
140
0
}
141
142
2
void SnappyMessageProto::SharedCtor() {
143
2
  text_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
144
2
}
145
146
0
SnappyMessageProto::~SnappyMessageProto() {
147
  // @@protoc_insertion_point(destructor:snappy_message.SnappyMessageProto)
148
0
  SharedDtor();
149
0
}
150
151
0
void SnappyMessageProto::SharedDtor() {
152
0
  text_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
153
0
}
154
155
0
void SnappyMessageProto::SetCachedSize(int size) const {
156
0
  _cached_size_.Set(size);
157
0
}
158
0
const ::google::protobuf::Descriptor* SnappyMessageProto::descriptor() {
159
0
  ::protobuf_snappy_5fmessage_2eproto::protobuf_AssignDescriptorsOnce();
160
0
  return ::protobuf_snappy_5fmessage_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
161
0
}
162
163
0
const SnappyMessageProto& SnappyMessageProto::default_instance() {
164
0
  ::google::protobuf::internal::InitSCC(&protobuf_snappy_5fmessage_2eproto::scc_info_SnappyMessageProto.base);
165
0
  return *internal_default_instance();
166
0
}
167
168
169
0
void SnappyMessageProto::Clear() {
170
// @@protoc_insertion_point(message_clear_start:snappy_message.SnappyMessageProto)
171
0
  ::google::protobuf::uint32 cached_has_bits = 0;
172
  // Prevent compiler warnings about cached_has_bits being unused
173
0
  (void) cached_has_bits;
174
175
0
  numbers_.Clear();
176
0
  cached_has_bits = _has_bits_[0];
177
0
  if (cached_has_bits & 0x00000001u) {
178
0
    text_.ClearNonDefaultToEmptyNoArena();
179
0
  }
180
0
  _has_bits_.Clear();
181
0
  _internal_metadata_.Clear();
182
0
}
183
184
bool SnappyMessageProto::MergePartialFromCodedStream(
185
0
    ::google::protobuf::io::CodedInputStream* input) {
186
0
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
187
0
  ::google::protobuf::uint32 tag;
188
  // @@protoc_insertion_point(parse_start:snappy_message.SnappyMessageProto)
189
0
  for (;;) {
190
0
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
191
0
    tag = p.first;
192
0
    if (!p.second) goto handle_unusual;
193
0
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
194
      // optional string text = 1;
195
0
      case 1: {
196
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
197
0
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
198
0
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
199
0
                input, this->mutable_text()));
200
0
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
201
0
            this->text().data(), static_cast<int>(this->text().length()),
202
0
            ::google::protobuf::internal::WireFormat::PARSE,
203
0
            "snappy_message.SnappyMessageProto.text");
204
0
        } else {
205
0
          goto handle_unusual;
206
0
        }
207
0
        break;
208
0
      }
209
210
      // repeated int32 numbers = 2;
211
0
      case 2: {
212
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
213
0
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
214
0
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
215
0
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
216
0
                 1, 16u, input, this->mutable_numbers())));
217
0
        } else if (
218
0
            static_cast< ::google::protobuf::uint8>(tag) ==
219
0
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
220
0
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
221
0
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
222
0
                 input, this->mutable_numbers())));
223
0
        } else {
224
0
          goto handle_unusual;
225
0
        }
226
0
        break;
227
0
      }
228
229
0
      default: {
230
0
      handle_unusual:
231
0
        if (tag == 0) {
232
0
          goto success;
233
0
        }
234
0
        DO_(::google::protobuf::internal::WireFormat::SkipField(
235
0
              input, tag, _internal_metadata_.mutable_unknown_fields()));
236
0
        break;
237
0
      }
238
0
    }
239
0
  }
240
0
success:
241
  // @@protoc_insertion_point(parse_success:snappy_message.SnappyMessageProto)
242
0
  return true;
243
0
failure:
244
  // @@protoc_insertion_point(parse_failure:snappy_message.SnappyMessageProto)
245
0
  return false;
246
0
#undef DO_
247
0
}
248
249
void SnappyMessageProto::SerializeWithCachedSizes(
250
0
    ::google::protobuf::io::CodedOutputStream* output) const {
251
  // @@protoc_insertion_point(serialize_start:snappy_message.SnappyMessageProto)
252
0
  ::google::protobuf::uint32 cached_has_bits = 0;
253
0
  (void) cached_has_bits;
254
255
0
  cached_has_bits = _has_bits_[0];
256
  // optional string text = 1;
257
0
  if (cached_has_bits & 0x00000001u) {
258
0
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
259
0
      this->text().data(), static_cast<int>(this->text().length()),
260
0
      ::google::protobuf::internal::WireFormat::SERIALIZE,
261
0
      "snappy_message.SnappyMessageProto.text");
262
0
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
263
0
      1, this->text(), output);
264
0
  }
265
266
  // repeated int32 numbers = 2;
267
0
  for (int i = 0, n = this->numbers_size(); i < n; i++) {
268
0
    ::google::protobuf::internal::WireFormatLite::WriteInt32(
269
0
      2, this->numbers(i), output);
270
0
  }
271
272
0
  if (_internal_metadata_.have_unknown_fields()) {
273
0
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
274
0
        _internal_metadata_.unknown_fields(), output);
275
0
  }
276
  // @@protoc_insertion_point(serialize_end:snappy_message.SnappyMessageProto)
277
0
}
278
279
::google::protobuf::uint8* SnappyMessageProto::InternalSerializeWithCachedSizesToArray(
280
0
    bool deterministic, ::google::protobuf::uint8* target) const {
281
0
  (void)deterministic; // Unused
282
  // @@protoc_insertion_point(serialize_to_array_start:snappy_message.SnappyMessageProto)
283
0
  ::google::protobuf::uint32 cached_has_bits = 0;
284
0
  (void) cached_has_bits;
285
286
0
  cached_has_bits = _has_bits_[0];
287
  // optional string text = 1;
288
0
  if (cached_has_bits & 0x00000001u) {
289
0
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
290
0
      this->text().data(), static_cast<int>(this->text().length()),
291
0
      ::google::protobuf::internal::WireFormat::SERIALIZE,
292
0
      "snappy_message.SnappyMessageProto.text");
293
0
    target =
294
0
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
295
0
        1, this->text(), target);
296
0
  }
297
298
  // repeated int32 numbers = 2;
299
0
  target = ::google::protobuf::internal::WireFormatLite::
300
0
    WriteInt32ToArray(2, this->numbers_, target);
301
302
0
  if (_internal_metadata_.have_unknown_fields()) {
303
0
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
304
0
        _internal_metadata_.unknown_fields(), target);
305
0
  }
306
  // @@protoc_insertion_point(serialize_to_array_end:snappy_message.SnappyMessageProto)
307
0
  return target;
308
0
}
309
310
0
size_t SnappyMessageProto::ByteSizeLong() const {
311
// @@protoc_insertion_point(message_byte_size_start:snappy_message.SnappyMessageProto)
312
0
  size_t total_size = 0;
313
314
0
  if (_internal_metadata_.have_unknown_fields()) {
315
0
    total_size +=
316
0
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
317
0
        _internal_metadata_.unknown_fields());
318
0
  }
319
  // repeated int32 numbers = 2;
320
0
  {
321
0
    size_t data_size = ::google::protobuf::internal::WireFormatLite::
322
0
      Int32Size(this->numbers_);
323
0
    total_size += 1 *
324
0
                  ::google::protobuf::internal::FromIntSize(this->numbers_size());
325
0
    total_size += data_size;
326
0
  }
327
328
  // optional string text = 1;
329
0
  if (has_text()) {
330
0
    total_size += 1 +
331
0
      ::google::protobuf::internal::WireFormatLite::StringSize(
332
0
        this->text());
333
0
  }
334
335
0
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
336
0
  SetCachedSize(cached_size);
337
0
  return total_size;
338
0
}
339
340
0
void SnappyMessageProto::MergeFrom(const ::google::protobuf::Message& from) {
341
// @@protoc_insertion_point(generalized_merge_from_start:snappy_message.SnappyMessageProto)
342
0
  GOOGLE_DCHECK_NE(&from, this);
343
0
  const SnappyMessageProto* source =
344
0
      ::google::protobuf::internal::DynamicCastToGenerated<const SnappyMessageProto>(
345
0
          &from);
346
0
  if (source == NULL) {
347
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:snappy_message.SnappyMessageProto)
348
0
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
349
0
  } else {
350
  // @@protoc_insertion_point(generalized_merge_from_cast_success:snappy_message.SnappyMessageProto)
351
0
    MergeFrom(*source);
352
0
  }
353
0
}
354
355
0
void SnappyMessageProto::MergeFrom(const SnappyMessageProto& from) {
356
// @@protoc_insertion_point(class_specific_merge_from_start:snappy_message.SnappyMessageProto)
357
0
  GOOGLE_DCHECK_NE(&from, this);
358
0
  _internal_metadata_.MergeFrom(from._internal_metadata_);
359
0
  ::google::protobuf::uint32 cached_has_bits = 0;
360
0
  (void) cached_has_bits;
361
362
0
  numbers_.MergeFrom(from.numbers_);
363
0
  if (from.has_text()) {
364
0
    set_has_text();
365
0
    text_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.text_);
366
0
  }
367
0
}
368
369
0
void SnappyMessageProto::CopyFrom(const ::google::protobuf::Message& from) {
370
// @@protoc_insertion_point(generalized_copy_from_start:snappy_message.SnappyMessageProto)
371
0
  if (&from == this) return;
372
0
  Clear();
373
0
  MergeFrom(from);
374
0
}
375
376
0
void SnappyMessageProto::CopyFrom(const SnappyMessageProto& from) {
377
// @@protoc_insertion_point(class_specific_copy_from_start:snappy_message.SnappyMessageProto)
378
0
  if (&from == this) return;
379
0
  Clear();
380
0
  MergeFrom(from);
381
0
}
382
383
0
bool SnappyMessageProto::IsInitialized() const {
384
0
  return true;
385
0
}
386
387
0
void SnappyMessageProto::Swap(SnappyMessageProto* other) {
388
0
  if (other == this) return;
389
0
  InternalSwap(other);
390
0
}
391
0
void SnappyMessageProto::InternalSwap(SnappyMessageProto* other) {
392
0
  using std::swap;
393
0
  numbers_.InternalSwap(&other->numbers_);
394
0
  text_.Swap(&other->text_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
395
0
    GetArenaNoVirtual());
396
0
  swap(_has_bits_[0], other->_has_bits_[0]);
397
0
  _internal_metadata_.Swap(&other->_internal_metadata_);
398
0
}
399
400
0
::google::protobuf::Metadata SnappyMessageProto::GetMetadata() const {
401
0
  protobuf_snappy_5fmessage_2eproto::protobuf_AssignDescriptorsOnce();
402
0
  return ::protobuf_snappy_5fmessage_2eproto::file_level_metadata[kIndexInFileMessages];
403
0
}
404
405
406
// @@protoc_insertion_point(namespace_scope)
407
}  // namespace snappy_message
408
namespace google {
409
namespace protobuf {
410
0
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::snappy_message::SnappyMessageProto* Arena::CreateMaybeMessage< ::snappy_message::SnappyMessageProto >(Arena* arena) {
411
0
  return Arena::CreateInternal< ::snappy_message::SnappyMessageProto >(arena);
412
0
}
413
}  // namespace protobuf
414
}  // namespace google
415
416
// @@protoc_insertion_point(global_scope)