Coverage Report

Created: 2026-01-09 06:11

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/brpc/build/test/repeated.pb.cc
Line
Count
Source
1
// Generated by the protocol buffer compiler.  DO NOT EDIT!
2
// source: repeated.proto
3
4
#include "repeated.pb.h"
5
6
#include <algorithm>
7
8
#include <google/protobuf/io/coded_stream.h>
9
#include <google/protobuf/extension_set.h>
10
#include <google/protobuf/wire_format_lite.h>
11
#include <google/protobuf/descriptor.h>
12
#include <google/protobuf/generated_message_reflection.h>
13
#include <google/protobuf/reflection_ops.h>
14
#include <google/protobuf/wire_format.h>
15
// @@protoc_insertion_point(includes)
16
#include <google/protobuf/port_def.inc>
17
18
PROTOBUF_PRAGMA_INIT_SEG
19
20
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
21
namespace _pbi = _pb::internal;
22
23
PROTOBUF_CONSTEXPR Dummy::Dummy(
24
    ::_pbi::ConstantInitialized) {}
25
struct DummyDefaultTypeInternal {
26
  PROTOBUF_CONSTEXPR DummyDefaultTypeInternal()
27
0
      : _instance(::_pbi::ConstantInitialized{}) {}
28
0
  ~DummyDefaultTypeInternal() {}
29
  union {
30
    Dummy _instance;
31
  };
32
};
33
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DummyDefaultTypeInternal _Dummy_default_instance_;
34
PROTOBUF_CONSTEXPR RepeatedMessage::RepeatedMessage(
35
    ::_pbi::ConstantInitialized): _impl_{
36
    /*decltype(_impl_.ints_)*/{}
37
  , /*decltype(_impl_.strings_)*/{}
38
  , /*decltype(_impl_.msgs_)*/{}
39
  , /*decltype(_impl_._cached_size_)*/{}} {}
40
struct RepeatedMessageDefaultTypeInternal {
41
  PROTOBUF_CONSTEXPR RepeatedMessageDefaultTypeInternal()
42
0
      : _instance(::_pbi::ConstantInitialized{}) {}
43
0
  ~RepeatedMessageDefaultTypeInternal() {}
44
  union {
45
    RepeatedMessage _instance;
46
  };
47
};
48
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RepeatedMessageDefaultTypeInternal _RepeatedMessage_default_instance_;
49
static ::_pb::Metadata file_level_metadata_repeated_2eproto[2];
50
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_repeated_2eproto = nullptr;
51
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_repeated_2eproto = nullptr;
52
53
const uint32_t TableStruct_repeated_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
54
  ~0u,  // no _has_bits_
55
  PROTOBUF_FIELD_OFFSET(::Dummy, _internal_metadata_),
56
  ~0u,  // no _extensions_
57
  ~0u,  // no _oneof_case_
58
  ~0u,  // no _weak_field_map_
59
  ~0u,  // no _inlined_string_donated_
60
  ~0u,  // no _has_bits_
61
  PROTOBUF_FIELD_OFFSET(::RepeatedMessage, _internal_metadata_),
62
  ~0u,  // no _extensions_
63
  ~0u,  // no _oneof_case_
64
  ~0u,  // no _weak_field_map_
65
  ~0u,  // no _inlined_string_donated_
66
  PROTOBUF_FIELD_OFFSET(::RepeatedMessage, _impl_.ints_),
67
  PROTOBUF_FIELD_OFFSET(::RepeatedMessage, _impl_.strings_),
68
  PROTOBUF_FIELD_OFFSET(::RepeatedMessage, _impl_.msgs_),
69
};
70
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
71
  { 0, -1, -1, sizeof(::Dummy)},
72
  { 6, -1, -1, sizeof(::RepeatedMessage)},
73
};
74
75
static const ::_pb::Message* const file_default_instances[] = {
76
  &::_Dummy_default_instance_._instance,
77
  &::_RepeatedMessage_default_instance_._instance,
78
};
79
80
const char descriptor_table_protodef_repeated_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
81
  "\n\016repeated.proto\"\007\n\005Dummy\"F\n\017RepeatedMes"
82
  "sage\022\014\n\004ints\030\001 \003(\005\022\017\n\007strings\030\002 \003(\t\022\024\n\004m"
83
  "sgs\030\003 \003(\0132\006.Dummy"
84
  ;
85
static ::_pbi::once_flag descriptor_table_repeated_2eproto_once;
86
const ::_pbi::DescriptorTable descriptor_table_repeated_2eproto = {
87
    false, false, 97, descriptor_table_protodef_repeated_2eproto,
88
    "repeated.proto",
89
    &descriptor_table_repeated_2eproto_once, nullptr, 0, 2,
90
    schemas, file_default_instances, TableStruct_repeated_2eproto::offsets,
91
    file_level_metadata_repeated_2eproto, file_level_enum_descriptors_repeated_2eproto,
92
    file_level_service_descriptors_repeated_2eproto,
93
};
94
0
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_repeated_2eproto_getter() {
95
0
  return &descriptor_table_repeated_2eproto;
96
0
}
97
98
// Force running AddDescriptors() at dynamic initialization time.
99
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_repeated_2eproto(&descriptor_table_repeated_2eproto);
100
101
// ===================================================================
102
103
class Dummy::_Internal {
104
 public:
105
};
106
107
Dummy::Dummy(::PROTOBUF_NAMESPACE_ID::Arena* arena,
108
                         bool is_message_owned)
109
0
  : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) {
110
  // @@protoc_insertion_point(arena_constructor:Dummy)
111
0
}
112
Dummy::Dummy(const Dummy& from)
113
0
  : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() {
114
0
  Dummy* const _this = this; (void)_this;
115
0
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
116
  // @@protoc_insertion_point(copy_constructor:Dummy)
117
0
}
118
119
120
121
122
123
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Dummy::_class_data_ = {
124
    ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl,
125
    ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl,
126
};
127
0
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Dummy::GetClassData() const { return &_class_data_; }
128
129
130
131
132
133
134
135
0
::PROTOBUF_NAMESPACE_ID::Metadata Dummy::GetMetadata() const {
136
0
  return ::_pbi::AssignDescriptors(
137
0
      &descriptor_table_repeated_2eproto_getter, &descriptor_table_repeated_2eproto_once,
138
0
      file_level_metadata_repeated_2eproto[0]);
139
0
}
140
141
// ===================================================================
142
143
class RepeatedMessage::_Internal {
144
 public:
145
};
146
147
RepeatedMessage::RepeatedMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena,
148
                         bool is_message_owned)
149
0
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
150
0
  SharedCtor(arena, is_message_owned);
151
  // @@protoc_insertion_point(arena_constructor:RepeatedMessage)
152
0
}
153
RepeatedMessage::RepeatedMessage(const RepeatedMessage& from)
154
0
  : ::PROTOBUF_NAMESPACE_ID::Message() {
155
0
  RepeatedMessage* const _this = this; (void)_this;
156
0
  new (&_impl_) Impl_{
157
0
      decltype(_impl_.ints_){from._impl_.ints_}
158
0
    , decltype(_impl_.strings_){from._impl_.strings_}
159
0
    , decltype(_impl_.msgs_){from._impl_.msgs_}
160
0
    , /*decltype(_impl_._cached_size_)*/{}};
161
162
0
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
163
  // @@protoc_insertion_point(copy_constructor:RepeatedMessage)
164
0
}
165
166
inline void RepeatedMessage::SharedCtor(
167
0
    ::_pb::Arena* arena, bool is_message_owned) {
168
0
  (void)arena;
169
0
  (void)is_message_owned;
170
0
  new (&_impl_) Impl_{
171
0
      decltype(_impl_.ints_){arena}
172
0
    , decltype(_impl_.strings_){arena}
173
0
    , decltype(_impl_.msgs_){arena}
174
0
    , /*decltype(_impl_._cached_size_)*/{}
175
0
  };
176
0
}
177
178
0
RepeatedMessage::~RepeatedMessage() {
179
  // @@protoc_insertion_point(destructor:RepeatedMessage)
180
0
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
181
0
  (void)arena;
182
0
    return;
183
0
  }
184
0
  SharedDtor();
185
0
}
186
187
0
inline void RepeatedMessage::SharedDtor() {
188
0
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
189
0
  _impl_.ints_.~RepeatedField();
190
0
  _impl_.strings_.~RepeatedPtrField();
191
0
  _impl_.msgs_.~RepeatedPtrField();
192
0
}
193
194
0
void RepeatedMessage::SetCachedSize(int size) const {
195
0
  _impl_._cached_size_.Set(size);
196
0
}
197
198
0
void RepeatedMessage::Clear() {
199
// @@protoc_insertion_point(message_clear_start:RepeatedMessage)
200
0
  uint32_t cached_has_bits = 0;
201
  // Prevent compiler warnings about cached_has_bits being unused
202
0
  (void) cached_has_bits;
203
204
0
  _impl_.ints_.Clear();
205
0
  _impl_.strings_.Clear();
206
0
  _impl_.msgs_.Clear();
207
0
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
208
0
}
209
210
0
const char* RepeatedMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
211
0
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
212
0
  while (!ctx->Done(&ptr)) {
213
0
    uint32_t tag;
214
0
    ptr = ::_pbi::ReadTag(ptr, &tag);
215
0
    switch (tag >> 3) {
216
      // repeated int32 ints = 1;
217
0
      case 1:
218
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
219
0
          ptr -= 1;
220
0
          do {
221
0
            ptr += 1;
222
0
            _internal_add_ints(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
223
0
            CHK_(ptr);
224
0
            if (!ctx->DataAvailable(ptr)) break;
225
0
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<8>(ptr));
226
0
        } else if (static_cast<uint8_t>(tag) == 10) {
227
0
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_ints(), ptr, ctx);
228
0
          CHK_(ptr);
229
0
        } else
230
0
          goto handle_unusual;
231
0
        continue;
232
      // repeated string strings = 2;
233
0
      case 2:
234
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
235
0
          ptr -= 1;
236
0
          do {
237
0
            ptr += 1;
238
0
            auto str = _internal_add_strings();
239
0
            ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
240
0
            CHK_(ptr);
241
0
            #ifndef NDEBUG
242
0
            ::_pbi::VerifyUTF8(str, "RepeatedMessage.strings");
243
0
            #endif  // !NDEBUG
244
0
            if (!ctx->DataAvailable(ptr)) break;
245
0
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
246
0
        } else
247
0
          goto handle_unusual;
248
0
        continue;
249
      // repeated .Dummy msgs = 3;
250
0
      case 3:
251
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
252
0
          ptr -= 1;
253
0
          do {
254
0
            ptr += 1;
255
0
            ptr = ctx->ParseMessage(_internal_add_msgs(), ptr);
256
0
            CHK_(ptr);
257
0
            if (!ctx->DataAvailable(ptr)) break;
258
0
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
259
0
        } else
260
0
          goto handle_unusual;
261
0
        continue;
262
0
      default:
263
0
        goto handle_unusual;
264
0
    }  // switch
265
0
  handle_unusual:
266
0
    if ((tag == 0) || ((tag & 7) == 4)) {
267
0
      CHK_(ptr);
268
0
      ctx->SetLastTag(tag);
269
0
      goto message_done;
270
0
    }
271
0
    ptr = UnknownFieldParse(
272
0
        tag,
273
0
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
274
0
        ptr, ctx);
275
0
    CHK_(ptr != nullptr);
276
0
  }  // while
277
0
message_done:
278
0
  return ptr;
279
0
failure:
280
0
  ptr = nullptr;
281
0
  goto message_done;
282
0
#undef CHK_
283
0
}
284
285
uint8_t* RepeatedMessage::_InternalSerialize(
286
0
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
287
  // @@protoc_insertion_point(serialize_to_array_start:RepeatedMessage)
288
0
  uint32_t cached_has_bits = 0;
289
0
  (void) cached_has_bits;
290
291
  // repeated int32 ints = 1;
292
0
  for (int i = 0, n = this->_internal_ints_size(); i < n; i++) {
293
0
    target = stream->EnsureSpace(target);
294
0
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_ints(i), target);
295
0
  }
296
297
  // repeated string strings = 2;
298
0
  for (int i = 0, n = this->_internal_strings_size(); i < n; i++) {
299
0
    const auto& s = this->_internal_strings(i);
300
0
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
301
0
      s.data(), static_cast<int>(s.length()),
302
0
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
303
0
      "RepeatedMessage.strings");
304
0
    target = stream->WriteString(2, s, target);
305
0
  }
306
307
  // repeated .Dummy msgs = 3;
308
0
  for (unsigned i = 0,
309
0
      n = static_cast<unsigned>(this->_internal_msgs_size()); i < n; i++) {
310
0
    const auto& repfield = this->_internal_msgs(i);
311
0
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
312
0
        InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream);
313
0
  }
314
315
0
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
316
0
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
317
0
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
318
0
  }
319
  // @@protoc_insertion_point(serialize_to_array_end:RepeatedMessage)
320
0
  return target;
321
0
}
322
323
0
size_t RepeatedMessage::ByteSizeLong() const {
324
// @@protoc_insertion_point(message_byte_size_start:RepeatedMessage)
325
0
  size_t total_size = 0;
326
327
0
  uint32_t cached_has_bits = 0;
328
  // Prevent compiler warnings about cached_has_bits being unused
329
0
  (void) cached_has_bits;
330
331
  // repeated int32 ints = 1;
332
0
  {
333
0
    size_t data_size = ::_pbi::WireFormatLite::
334
0
      Int32Size(this->_impl_.ints_);
335
0
    total_size += 1 *
336
0
                  ::_pbi::FromIntSize(this->_internal_ints_size());
337
0
    total_size += data_size;
338
0
  }
339
340
  // repeated string strings = 2;
341
0
  total_size += 1 *
342
0
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.strings_.size());
343
0
  for (int i = 0, n = _impl_.strings_.size(); i < n; i++) {
344
0
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
345
0
      _impl_.strings_.Get(i));
346
0
  }
347
348
  // repeated .Dummy msgs = 3;
349
0
  total_size += 1UL * this->_internal_msgs_size();
350
0
  for (const auto& msg : this->_impl_.msgs_) {
351
0
    total_size +=
352
0
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
353
0
  }
354
355
0
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
356
0
}
357
358
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData RepeatedMessage::_class_data_ = {
359
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
360
    RepeatedMessage::MergeImpl
361
};
362
0
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*RepeatedMessage::GetClassData() const { return &_class_data_; }
363
364
365
0
void RepeatedMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
366
0
  auto* const _this = static_cast<RepeatedMessage*>(&to_msg);
367
0
  auto& from = static_cast<const RepeatedMessage&>(from_msg);
368
  // @@protoc_insertion_point(class_specific_merge_from_start:RepeatedMessage)
369
0
  GOOGLE_DCHECK_NE(&from, _this);
370
0
  uint32_t cached_has_bits = 0;
371
0
  (void) cached_has_bits;
372
373
0
  _this->_impl_.ints_.MergeFrom(from._impl_.ints_);
374
0
  _this->_impl_.strings_.MergeFrom(from._impl_.strings_);
375
0
  _this->_impl_.msgs_.MergeFrom(from._impl_.msgs_);
376
0
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
377
0
}
378
379
0
void RepeatedMessage::CopyFrom(const RepeatedMessage& from) {
380
// @@protoc_insertion_point(class_specific_copy_from_start:RepeatedMessage)
381
0
  if (&from == this) return;
382
0
  Clear();
383
0
  MergeFrom(from);
384
0
}
385
386
0
bool RepeatedMessage::IsInitialized() const {
387
0
  return true;
388
0
}
389
390
0
void RepeatedMessage::InternalSwap(RepeatedMessage* other) {
391
0
  using std::swap;
392
0
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
393
0
  _impl_.ints_.InternalSwap(&other->_impl_.ints_);
394
0
  _impl_.strings_.InternalSwap(&other->_impl_.strings_);
395
0
  _impl_.msgs_.InternalSwap(&other->_impl_.msgs_);
396
0
}
397
398
0
::PROTOBUF_NAMESPACE_ID::Metadata RepeatedMessage::GetMetadata() const {
399
0
  return ::_pbi::AssignDescriptors(
400
0
      &descriptor_table_repeated_2eproto_getter, &descriptor_table_repeated_2eproto_once,
401
0
      file_level_metadata_repeated_2eproto[1]);
402
0
}
403
404
// @@protoc_insertion_point(namespace_scope)
405
PROTOBUF_NAMESPACE_OPEN
406
template<> PROTOBUF_NOINLINE ::Dummy*
407
0
Arena::CreateMaybeMessage< ::Dummy >(Arena* arena) {
408
0
  return Arena::CreateMessageInternal< ::Dummy >(arena);
409
0
}
410
template<> PROTOBUF_NOINLINE ::RepeatedMessage*
411
0
Arena::CreateMaybeMessage< ::RepeatedMessage >(Arena* arena) {
412
0
  return Arena::CreateMessageInternal< ::RepeatedMessage >(arena);
413
0
}
414
PROTOBUF_NAMESPACE_CLOSE
415
416
// @@protoc_insertion_point(global_scope)
417
#include <google/protobuf/port_undef.inc>