1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/config/interceptor_config.proto
3
4 #include "protos/perfetto/config/interceptor_config.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 {
InterceptorConfig(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR InterceptorConfig::InterceptorConfig(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.console_config_)*/nullptr} {}
29 struct InterceptorConfigDefaultTypeInternal {
InterceptorConfigDefaultTypeInternalperfetto::protos::InterceptorConfigDefaultTypeInternal30 PROTOBUF_CONSTEXPR InterceptorConfigDefaultTypeInternal()
31 : _instance(::_pbi::ConstantInitialized{}) {}
~InterceptorConfigDefaultTypeInternalperfetto::protos::InterceptorConfigDefaultTypeInternal32 ~InterceptorConfigDefaultTypeInternal() {}
33 union { // NOLINT(misc-non-private-member-variables-in-classes)
34 InterceptorConfig _instance;
35 };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InterceptorConfigDefaultTypeInternal _InterceptorConfig_default_instance_;
38 } // namespace protos
39 } // namespace perfetto
40 namespace perfetto {
41 namespace protos {
42
43 // ===================================================================
44
45 class InterceptorConfig::_Internal {
46 public:
47 using HasBits = decltype(std::declval<InterceptorConfig>()._impl_._has_bits_);
set_has_name(HasBits * has_bits)48 static void set_has_name(HasBits* has_bits) {
49 (*has_bits)[0] |= 1u;
50 }
51 static const ::perfetto::protos::ConsoleConfig& console_config(const InterceptorConfig* msg);
set_has_console_config(HasBits * has_bits)52 static void set_has_console_config(HasBits* has_bits) {
53 (*has_bits)[0] |= 2u;
54 }
55 };
56
57 const ::perfetto::protos::ConsoleConfig&
console_config(const InterceptorConfig * msg)58 InterceptorConfig::_Internal::console_config(const InterceptorConfig* msg) {
59 return *msg->_impl_.console_config_;
60 }
clear_console_config()61 void InterceptorConfig::clear_console_config() {
62 if (_impl_.console_config_ != nullptr) _impl_.console_config_->Clear();
63 _impl_._has_bits_[0] &= ~0x00000002u;
64 }
InterceptorConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)65 InterceptorConfig::InterceptorConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
66 bool is_message_owned)
67 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
68 SharedCtor(arena, is_message_owned);
69 // @@protoc_insertion_point(arena_constructor:perfetto.protos.InterceptorConfig)
70 }
InterceptorConfig(const InterceptorConfig & from)71 InterceptorConfig::InterceptorConfig(const InterceptorConfig& from)
72 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
73 InterceptorConfig* const _this = this; (void)_this;
74 new (&_impl_) Impl_{
75 decltype(_impl_._has_bits_){from._impl_._has_bits_}
76 , /*decltype(_impl_._cached_size_)*/{}
77 , decltype(_impl_.name_){}
78 , decltype(_impl_.console_config_){nullptr}};
79
80 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
81 _impl_.name_.InitDefault();
82 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
83 _impl_.name_.Set("", GetArenaForAllocation());
84 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
85 if (from._internal_has_name()) {
86 _this->_impl_.name_.Set(from._internal_name(),
87 _this->GetArenaForAllocation());
88 }
89 if (from._internal_has_console_config()) {
90 _this->_impl_.console_config_ = new ::perfetto::protos::ConsoleConfig(*from._impl_.console_config_);
91 }
92 // @@protoc_insertion_point(copy_constructor:perfetto.protos.InterceptorConfig)
93 }
94
SharedCtor(::_pb::Arena * arena,bool is_message_owned)95 inline void InterceptorConfig::SharedCtor(
96 ::_pb::Arena* arena, bool is_message_owned) {
97 (void)arena;
98 (void)is_message_owned;
99 new (&_impl_) Impl_{
100 decltype(_impl_._has_bits_){}
101 , /*decltype(_impl_._cached_size_)*/{}
102 , decltype(_impl_.name_){}
103 , decltype(_impl_.console_config_){nullptr}
104 };
105 _impl_.name_.InitDefault();
106 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
107 _impl_.name_.Set("", GetArenaForAllocation());
108 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
109 }
110
~InterceptorConfig()111 InterceptorConfig::~InterceptorConfig() {
112 // @@protoc_insertion_point(destructor:perfetto.protos.InterceptorConfig)
113 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
114 (void)arena;
115 return;
116 }
117 SharedDtor();
118 }
119
SharedDtor()120 inline void InterceptorConfig::SharedDtor() {
121 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
122 _impl_.name_.Destroy();
123 if (this != internal_default_instance()) delete _impl_.console_config_;
124 }
125
SetCachedSize(int size) const126 void InterceptorConfig::SetCachedSize(int size) const {
127 _impl_._cached_size_.Set(size);
128 }
129
Clear()130 void InterceptorConfig::Clear() {
131 // @@protoc_insertion_point(message_clear_start:perfetto.protos.InterceptorConfig)
132 ::uint32_t cached_has_bits = 0;
133 // Prevent compiler warnings about cached_has_bits being unused
134 (void) cached_has_bits;
135
136 cached_has_bits = _impl_._has_bits_[0];
137 if (cached_has_bits & 0x00000003u) {
138 if (cached_has_bits & 0x00000001u) {
139 _impl_.name_.ClearNonDefaultToEmpty();
140 }
141 if (cached_has_bits & 0x00000002u) {
142 GOOGLE_DCHECK(_impl_.console_config_ != nullptr);
143 _impl_.console_config_->Clear();
144 }
145 }
146 _impl_._has_bits_.Clear();
147 _internal_metadata_.Clear<std::string>();
148 }
149
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)150 const char* InterceptorConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
151 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
152 _Internal::HasBits has_bits{};
153 while (!ctx->Done(&ptr)) {
154 ::uint32_t tag;
155 ptr = ::_pbi::ReadTag(ptr, &tag);
156 switch (tag >> 3) {
157 // optional string name = 1;
158 case 1:
159 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
160 auto str = _internal_mutable_name();
161 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
162 CHK_(ptr);
163 } else {
164 goto handle_unusual;
165 }
166 continue;
167 // optional .perfetto.protos.ConsoleConfig console_config = 100;
168 case 100:
169 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
170 ptr = ctx->ParseMessage(_internal_mutable_console_config(), ptr);
171 CHK_(ptr);
172 } else {
173 goto handle_unusual;
174 }
175 continue;
176 default:
177 goto handle_unusual;
178 } // switch
179 handle_unusual:
180 if ((tag == 0) || ((tag & 7) == 4)) {
181 CHK_(ptr);
182 ctx->SetLastTag(tag);
183 goto message_done;
184 }
185 ptr = UnknownFieldParse(
186 tag,
187 _internal_metadata_.mutable_unknown_fields<std::string>(),
188 ptr, ctx);
189 CHK_(ptr != nullptr);
190 } // while
191 message_done:
192 _impl_._has_bits_.Or(has_bits);
193 return ptr;
194 failure:
195 ptr = nullptr;
196 goto message_done;
197 #undef CHK_
198 }
199
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const200 ::uint8_t* InterceptorConfig::_InternalSerialize(
201 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
202 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.InterceptorConfig)
203 ::uint32_t cached_has_bits = 0;
204 (void) cached_has_bits;
205
206 cached_has_bits = _impl_._has_bits_[0];
207 // optional string name = 1;
208 if (cached_has_bits & 0x00000001u) {
209 target = stream->WriteStringMaybeAliased(
210 1, this->_internal_name(), target);
211 }
212
213 // optional .perfetto.protos.ConsoleConfig console_config = 100;
214 if (cached_has_bits & 0x00000002u) {
215 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
216 InternalWriteMessage(100, _Internal::console_config(this),
217 _Internal::console_config(this).GetCachedSize(), target, stream);
218 }
219
220 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
221 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
222 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
223 }
224 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.InterceptorConfig)
225 return target;
226 }
227
ByteSizeLong() const228 size_t InterceptorConfig::ByteSizeLong() const {
229 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.InterceptorConfig)
230 size_t total_size = 0;
231
232 ::uint32_t cached_has_bits = 0;
233 // Prevent compiler warnings about cached_has_bits being unused
234 (void) cached_has_bits;
235
236 cached_has_bits = _impl_._has_bits_[0];
237 if (cached_has_bits & 0x00000003u) {
238 // optional string name = 1;
239 if (cached_has_bits & 0x00000001u) {
240 total_size += 1 +
241 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
242 this->_internal_name());
243 }
244
245 // optional .perfetto.protos.ConsoleConfig console_config = 100;
246 if (cached_has_bits & 0x00000002u) {
247 total_size += 2 +
248 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
249 *_impl_.console_config_);
250 }
251
252 }
253 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
254 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
255 }
256 int cached_size = ::_pbi::ToCachedSize(total_size);
257 SetCachedSize(cached_size);
258 return total_size;
259 }
260
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)261 void InterceptorConfig::CheckTypeAndMergeFrom(
262 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
263 MergeFrom(*::_pbi::DownCast<const InterceptorConfig*>(
264 &from));
265 }
266
MergeFrom(const InterceptorConfig & from)267 void InterceptorConfig::MergeFrom(const InterceptorConfig& from) {
268 InterceptorConfig* const _this = this;
269 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.InterceptorConfig)
270 GOOGLE_DCHECK_NE(&from, _this);
271 ::uint32_t cached_has_bits = 0;
272 (void) cached_has_bits;
273
274 cached_has_bits = from._impl_._has_bits_[0];
275 if (cached_has_bits & 0x00000003u) {
276 if (cached_has_bits & 0x00000001u) {
277 _this->_internal_set_name(from._internal_name());
278 }
279 if (cached_has_bits & 0x00000002u) {
280 _this->_internal_mutable_console_config()->::perfetto::protos::ConsoleConfig::MergeFrom(
281 from._internal_console_config());
282 }
283 }
284 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
285 }
286
CopyFrom(const InterceptorConfig & from)287 void InterceptorConfig::CopyFrom(const InterceptorConfig& from) {
288 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.InterceptorConfig)
289 if (&from == this) return;
290 Clear();
291 MergeFrom(from);
292 }
293
IsInitialized() const294 bool InterceptorConfig::IsInitialized() const {
295 return true;
296 }
297
InternalSwap(InterceptorConfig * other)298 void InterceptorConfig::InternalSwap(InterceptorConfig* other) {
299 using std::swap;
300 auto* lhs_arena = GetArenaForAllocation();
301 auto* rhs_arena = other->GetArenaForAllocation();
302 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
303 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
304 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
305 &_impl_.name_, lhs_arena,
306 &other->_impl_.name_, rhs_arena
307 );
308 swap(_impl_.console_config_, other->_impl_.console_config_);
309 }
310
GetTypeName() const311 std::string InterceptorConfig::GetTypeName() const {
312 return "perfetto.protos.InterceptorConfig";
313 }
314
315
316 // @@protoc_insertion_point(namespace_scope)
317 } // namespace protos
318 } // namespace perfetto
319 PROTOBUF_NAMESPACE_OPEN
320 template<> PROTOBUF_NOINLINE ::perfetto::protos::InterceptorConfig*
CreateMaybeMessage(Arena * arena)321 Arena::CreateMaybeMessage< ::perfetto::protos::InterceptorConfig >(Arena* arena) {
322 return Arena::CreateMessageInternal< ::perfetto::protos::InterceptorConfig >(arena);
323 }
324 PROTOBUF_NAMESPACE_CLOSE
325
326 // @@protoc_insertion_point(global_scope)
327 #include <google/protobuf/port_undef.inc>
328