1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/ftrace/test_bundle_wrapper.proto
3
4 #include "protos/perfetto/trace/ftrace/test_bundle_wrapper.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace perfetto {
22 namespace protos {
TestBundleWrapper(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR TestBundleWrapper::TestBundleWrapper(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.bundle_)*/{}
28 , /*decltype(_impl_.before_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
29 , /*decltype(_impl_.after_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {}
30 struct TestBundleWrapperDefaultTypeInternal {
TestBundleWrapperDefaultTypeInternalperfetto::protos::TestBundleWrapperDefaultTypeInternal31 PROTOBUF_CONSTEXPR TestBundleWrapperDefaultTypeInternal()
32 : _instance(::_pbi::ConstantInitialized{}) {}
~TestBundleWrapperDefaultTypeInternalperfetto::protos::TestBundleWrapperDefaultTypeInternal33 ~TestBundleWrapperDefaultTypeInternal() {}
34 union { // NOLINT(misc-non-private-member-variables-in-classes)
35 TestBundleWrapper _instance;
36 };
37 };
38 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TestBundleWrapperDefaultTypeInternal _TestBundleWrapper_default_instance_;
39 } // namespace protos
40 } // namespace perfetto
41 namespace perfetto {
42 namespace protos {
43
44 // ===================================================================
45
46 class TestBundleWrapper::_Internal {
47 public:
48 using HasBits = decltype(std::declval<TestBundleWrapper>()._impl_._has_bits_);
set_has_before(HasBits * has_bits)49 static void set_has_before(HasBits* has_bits) {
50 (*has_bits)[0] |= 1u;
51 }
set_has_after(HasBits * has_bits)52 static void set_has_after(HasBits* has_bits) {
53 (*has_bits)[0] |= 2u;
54 }
55 };
56
clear_bundle()57 void TestBundleWrapper::clear_bundle() {
58 _impl_.bundle_.Clear();
59 }
TestBundleWrapper(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)60 TestBundleWrapper::TestBundleWrapper(::PROTOBUF_NAMESPACE_ID::Arena* arena,
61 bool is_message_owned)
62 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
63 SharedCtor(arena, is_message_owned);
64 // @@protoc_insertion_point(arena_constructor:perfetto.protos.TestBundleWrapper)
65 }
TestBundleWrapper(const TestBundleWrapper & from)66 TestBundleWrapper::TestBundleWrapper(const TestBundleWrapper& from)
67 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
68 TestBundleWrapper* const _this = this; (void)_this;
69 new (&_impl_) Impl_{
70 decltype(_impl_._has_bits_){from._impl_._has_bits_}
71 , /*decltype(_impl_._cached_size_)*/{}
72 , decltype(_impl_.bundle_){from._impl_.bundle_}
73 , decltype(_impl_.before_){}
74 , decltype(_impl_.after_){}};
75
76 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
77 _impl_.before_.InitDefault();
78 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
79 _impl_.before_.Set("", GetArenaForAllocation());
80 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
81 if (from._internal_has_before()) {
82 _this->_impl_.before_.Set(from._internal_before(),
83 _this->GetArenaForAllocation());
84 }
85 _impl_.after_.InitDefault();
86 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
87 _impl_.after_.Set("", GetArenaForAllocation());
88 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
89 if (from._internal_has_after()) {
90 _this->_impl_.after_.Set(from._internal_after(),
91 _this->GetArenaForAllocation());
92 }
93 // @@protoc_insertion_point(copy_constructor:perfetto.protos.TestBundleWrapper)
94 }
95
SharedCtor(::_pb::Arena * arena,bool is_message_owned)96 inline void TestBundleWrapper::SharedCtor(
97 ::_pb::Arena* arena, bool is_message_owned) {
98 (void)arena;
99 (void)is_message_owned;
100 new (&_impl_) Impl_{
101 decltype(_impl_._has_bits_){}
102 , /*decltype(_impl_._cached_size_)*/{}
103 , decltype(_impl_.bundle_){arena}
104 , decltype(_impl_.before_){}
105 , decltype(_impl_.after_){}
106 };
107 _impl_.before_.InitDefault();
108 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
109 _impl_.before_.Set("", GetArenaForAllocation());
110 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
111 _impl_.after_.InitDefault();
112 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
113 _impl_.after_.Set("", GetArenaForAllocation());
114 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
115 }
116
~TestBundleWrapper()117 TestBundleWrapper::~TestBundleWrapper() {
118 // @@protoc_insertion_point(destructor:perfetto.protos.TestBundleWrapper)
119 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
120 (void)arena;
121 return;
122 }
123 SharedDtor();
124 }
125
SharedDtor()126 inline void TestBundleWrapper::SharedDtor() {
127 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
128 _impl_.bundle_.~RepeatedPtrField();
129 _impl_.before_.Destroy();
130 _impl_.after_.Destroy();
131 }
132
SetCachedSize(int size) const133 void TestBundleWrapper::SetCachedSize(int size) const {
134 _impl_._cached_size_.Set(size);
135 }
136
Clear()137 void TestBundleWrapper::Clear() {
138 // @@protoc_insertion_point(message_clear_start:perfetto.protos.TestBundleWrapper)
139 ::uint32_t cached_has_bits = 0;
140 // Prevent compiler warnings about cached_has_bits being unused
141 (void) cached_has_bits;
142
143 _impl_.bundle_.Clear();
144 cached_has_bits = _impl_._has_bits_[0];
145 if (cached_has_bits & 0x00000003u) {
146 if (cached_has_bits & 0x00000001u) {
147 _impl_.before_.ClearNonDefaultToEmpty();
148 }
149 if (cached_has_bits & 0x00000002u) {
150 _impl_.after_.ClearNonDefaultToEmpty();
151 }
152 }
153 _impl_._has_bits_.Clear();
154 _internal_metadata_.Clear<std::string>();
155 }
156
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)157 const char* TestBundleWrapper::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
158 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
159 _Internal::HasBits has_bits{};
160 while (!ctx->Done(&ptr)) {
161 ::uint32_t tag;
162 ptr = ::_pbi::ReadTag(ptr, &tag);
163 switch (tag >> 3) {
164 // optional string before = 1;
165 case 1:
166 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
167 auto str = _internal_mutable_before();
168 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
169 CHK_(ptr);
170 } else {
171 goto handle_unusual;
172 }
173 continue;
174 // repeated .perfetto.protos.FtraceEventBundle bundle = 2;
175 case 2:
176 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
177 ptr -= 1;
178 do {
179 ptr += 1;
180 ptr = ctx->ParseMessage(_internal_add_bundle(), ptr);
181 CHK_(ptr);
182 if (!ctx->DataAvailable(ptr)) break;
183 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
184 } else {
185 goto handle_unusual;
186 }
187 continue;
188 // optional string after = 3;
189 case 3:
190 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
191 auto str = _internal_mutable_after();
192 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
193 CHK_(ptr);
194 } else {
195 goto handle_unusual;
196 }
197 continue;
198 default:
199 goto handle_unusual;
200 } // switch
201 handle_unusual:
202 if ((tag == 0) || ((tag & 7) == 4)) {
203 CHK_(ptr);
204 ctx->SetLastTag(tag);
205 goto message_done;
206 }
207 ptr = UnknownFieldParse(
208 tag,
209 _internal_metadata_.mutable_unknown_fields<std::string>(),
210 ptr, ctx);
211 CHK_(ptr != nullptr);
212 } // while
213 message_done:
214 _impl_._has_bits_.Or(has_bits);
215 return ptr;
216 failure:
217 ptr = nullptr;
218 goto message_done;
219 #undef CHK_
220 }
221
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const222 ::uint8_t* TestBundleWrapper::_InternalSerialize(
223 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
224 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.TestBundleWrapper)
225 ::uint32_t cached_has_bits = 0;
226 (void) cached_has_bits;
227
228 cached_has_bits = _impl_._has_bits_[0];
229 // optional string before = 1;
230 if (cached_has_bits & 0x00000001u) {
231 target = stream->WriteStringMaybeAliased(
232 1, this->_internal_before(), target);
233 }
234
235 // repeated .perfetto.protos.FtraceEventBundle bundle = 2;
236 for (unsigned i = 0,
237 n = static_cast<unsigned>(this->_internal_bundle_size()); i < n; i++) {
238 const auto& repfield = this->_internal_bundle(i);
239 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
240 InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
241 }
242
243 // optional string after = 3;
244 if (cached_has_bits & 0x00000002u) {
245 target = stream->WriteStringMaybeAliased(
246 3, this->_internal_after(), target);
247 }
248
249 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
250 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
251 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
252 }
253 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.TestBundleWrapper)
254 return target;
255 }
256
ByteSizeLong() const257 size_t TestBundleWrapper::ByteSizeLong() const {
258 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.TestBundleWrapper)
259 size_t total_size = 0;
260
261 ::uint32_t cached_has_bits = 0;
262 // Prevent compiler warnings about cached_has_bits being unused
263 (void) cached_has_bits;
264
265 // repeated .perfetto.protos.FtraceEventBundle bundle = 2;
266 total_size += 1UL * this->_internal_bundle_size();
267 for (const auto& msg : this->_impl_.bundle_) {
268 total_size +=
269 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
270 }
271
272 cached_has_bits = _impl_._has_bits_[0];
273 if (cached_has_bits & 0x00000003u) {
274 // optional string before = 1;
275 if (cached_has_bits & 0x00000001u) {
276 total_size += 1 +
277 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
278 this->_internal_before());
279 }
280
281 // optional string after = 3;
282 if (cached_has_bits & 0x00000002u) {
283 total_size += 1 +
284 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
285 this->_internal_after());
286 }
287
288 }
289 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
290 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
291 }
292 int cached_size = ::_pbi::ToCachedSize(total_size);
293 SetCachedSize(cached_size);
294 return total_size;
295 }
296
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)297 void TestBundleWrapper::CheckTypeAndMergeFrom(
298 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
299 MergeFrom(*::_pbi::DownCast<const TestBundleWrapper*>(
300 &from));
301 }
302
MergeFrom(const TestBundleWrapper & from)303 void TestBundleWrapper::MergeFrom(const TestBundleWrapper& from) {
304 TestBundleWrapper* const _this = this;
305 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.TestBundleWrapper)
306 GOOGLE_DCHECK_NE(&from, _this);
307 ::uint32_t cached_has_bits = 0;
308 (void) cached_has_bits;
309
310 _this->_impl_.bundle_.MergeFrom(from._impl_.bundle_);
311 cached_has_bits = from._impl_._has_bits_[0];
312 if (cached_has_bits & 0x00000003u) {
313 if (cached_has_bits & 0x00000001u) {
314 _this->_internal_set_before(from._internal_before());
315 }
316 if (cached_has_bits & 0x00000002u) {
317 _this->_internal_set_after(from._internal_after());
318 }
319 }
320 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
321 }
322
CopyFrom(const TestBundleWrapper & from)323 void TestBundleWrapper::CopyFrom(const TestBundleWrapper& from) {
324 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.TestBundleWrapper)
325 if (&from == this) return;
326 Clear();
327 MergeFrom(from);
328 }
329
IsInitialized() const330 bool TestBundleWrapper::IsInitialized() const {
331 return true;
332 }
333
InternalSwap(TestBundleWrapper * other)334 void TestBundleWrapper::InternalSwap(TestBundleWrapper* other) {
335 using std::swap;
336 auto* lhs_arena = GetArenaForAllocation();
337 auto* rhs_arena = other->GetArenaForAllocation();
338 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
339 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
340 _impl_.bundle_.InternalSwap(&other->_impl_.bundle_);
341 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
342 &_impl_.before_, lhs_arena,
343 &other->_impl_.before_, rhs_arena
344 );
345 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
346 &_impl_.after_, lhs_arena,
347 &other->_impl_.after_, rhs_arena
348 );
349 }
350
GetTypeName() const351 std::string TestBundleWrapper::GetTypeName() const {
352 return "perfetto.protos.TestBundleWrapper";
353 }
354
355
356 // @@protoc_insertion_point(namespace_scope)
357 } // namespace protos
358 } // namespace perfetto
359 PROTOBUF_NAMESPACE_OPEN
360 template<> PROTOBUF_NOINLINE ::perfetto::protos::TestBundleWrapper*
CreateMaybeMessage(Arena * arena)361 Arena::CreateMaybeMessage< ::perfetto::protos::TestBundleWrapper >(Arena* arena) {
362 return Arena::CreateMessageInternal< ::perfetto::protos::TestBundleWrapper >(arena);
363 }
364 PROTOBUF_NAMESPACE_CLOSE
365
366 // @@protoc_insertion_point(global_scope)
367 #include <google/protobuf/port_undef.inc>
368