1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/config/interceptors/console_config.proto
3
4 #include "protos/perfetto/config/interceptors/console_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 {
ConsoleConfig(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR ConsoleConfig::ConsoleConfig(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.output_)*/0
28 , /*decltype(_impl_.enable_colors_)*/false} {}
29 struct ConsoleConfigDefaultTypeInternal {
ConsoleConfigDefaultTypeInternalperfetto::protos::ConsoleConfigDefaultTypeInternal30 PROTOBUF_CONSTEXPR ConsoleConfigDefaultTypeInternal()
31 : _instance(::_pbi::ConstantInitialized{}) {}
~ConsoleConfigDefaultTypeInternalperfetto::protos::ConsoleConfigDefaultTypeInternal32 ~ConsoleConfigDefaultTypeInternal() {}
33 union { // NOLINT(misc-non-private-member-variables-in-classes)
34 ConsoleConfig _instance;
35 };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConsoleConfigDefaultTypeInternal _ConsoleConfig_default_instance_;
38 } // namespace protos
39 } // namespace perfetto
40 namespace perfetto {
41 namespace protos {
ConsoleConfig_Output_IsValid(int value)42 bool ConsoleConfig_Output_IsValid(int value) {
43 switch (value) {
44 case 0:
45 case 1:
46 case 2:
47 return true;
48 default:
49 return false;
50 }
51 }
52
53 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ConsoleConfig_Output_strings[3] = {};
54
55 static const char ConsoleConfig_Output_names[] =
56 "OUTPUT_STDERR"
57 "OUTPUT_STDOUT"
58 "OUTPUT_UNSPECIFIED";
59
60 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ConsoleConfig_Output_entries[] = {
61 { {ConsoleConfig_Output_names + 0, 13}, 2 },
62 { {ConsoleConfig_Output_names + 13, 13}, 1 },
63 { {ConsoleConfig_Output_names + 26, 18}, 0 },
64 };
65
66 static const int ConsoleConfig_Output_entries_by_number[] = {
67 2, // 0 -> OUTPUT_UNSPECIFIED
68 1, // 1 -> OUTPUT_STDOUT
69 0, // 2 -> OUTPUT_STDERR
70 };
71
ConsoleConfig_Output_Name(ConsoleConfig_Output value)72 const std::string& ConsoleConfig_Output_Name(
73 ConsoleConfig_Output value) {
74 static const bool dummy =
75 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
76 ConsoleConfig_Output_entries,
77 ConsoleConfig_Output_entries_by_number,
78 3, ConsoleConfig_Output_strings);
79 (void) dummy;
80 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
81 ConsoleConfig_Output_entries,
82 ConsoleConfig_Output_entries_by_number,
83 3, value);
84 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
85 ConsoleConfig_Output_strings[idx].get();
86 }
ConsoleConfig_Output_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,ConsoleConfig_Output * value)87 bool ConsoleConfig_Output_Parse(
88 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ConsoleConfig_Output* value) {
89 int int_value;
90 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
91 ConsoleConfig_Output_entries, 3, name, &int_value);
92 if (success) {
93 *value = static_cast<ConsoleConfig_Output>(int_value);
94 }
95 return success;
96 }
97 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
98 constexpr ConsoleConfig_Output ConsoleConfig::OUTPUT_UNSPECIFIED;
99 constexpr ConsoleConfig_Output ConsoleConfig::OUTPUT_STDOUT;
100 constexpr ConsoleConfig_Output ConsoleConfig::OUTPUT_STDERR;
101 constexpr ConsoleConfig_Output ConsoleConfig::Output_MIN;
102 constexpr ConsoleConfig_Output ConsoleConfig::Output_MAX;
103 constexpr int ConsoleConfig::Output_ARRAYSIZE;
104 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
105
106 // ===================================================================
107
108 class ConsoleConfig::_Internal {
109 public:
110 using HasBits = decltype(std::declval<ConsoleConfig>()._impl_._has_bits_);
set_has_output(HasBits * has_bits)111 static void set_has_output(HasBits* has_bits) {
112 (*has_bits)[0] |= 1u;
113 }
set_has_enable_colors(HasBits * has_bits)114 static void set_has_enable_colors(HasBits* has_bits) {
115 (*has_bits)[0] |= 2u;
116 }
117 };
118
ConsoleConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)119 ConsoleConfig::ConsoleConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
120 bool is_message_owned)
121 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
122 SharedCtor(arena, is_message_owned);
123 // @@protoc_insertion_point(arena_constructor:perfetto.protos.ConsoleConfig)
124 }
ConsoleConfig(const ConsoleConfig & from)125 ConsoleConfig::ConsoleConfig(const ConsoleConfig& from)
126 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
127 ConsoleConfig* const _this = this; (void)_this;
128 new (&_impl_) Impl_{
129 decltype(_impl_._has_bits_){from._impl_._has_bits_}
130 , /*decltype(_impl_._cached_size_)*/{}
131 , decltype(_impl_.output_){}
132 , decltype(_impl_.enable_colors_){}};
133
134 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
135 ::memcpy(&_impl_.output_, &from._impl_.output_,
136 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.enable_colors_) -
137 reinterpret_cast<char*>(&_impl_.output_)) + sizeof(_impl_.enable_colors_));
138 // @@protoc_insertion_point(copy_constructor:perfetto.protos.ConsoleConfig)
139 }
140
SharedCtor(::_pb::Arena * arena,bool is_message_owned)141 inline void ConsoleConfig::SharedCtor(
142 ::_pb::Arena* arena, bool is_message_owned) {
143 (void)arena;
144 (void)is_message_owned;
145 new (&_impl_) Impl_{
146 decltype(_impl_._has_bits_){}
147 , /*decltype(_impl_._cached_size_)*/{}
148 , decltype(_impl_.output_){0}
149 , decltype(_impl_.enable_colors_){false}
150 };
151 }
152
~ConsoleConfig()153 ConsoleConfig::~ConsoleConfig() {
154 // @@protoc_insertion_point(destructor:perfetto.protos.ConsoleConfig)
155 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
156 (void)arena;
157 return;
158 }
159 SharedDtor();
160 }
161
SharedDtor()162 inline void ConsoleConfig::SharedDtor() {
163 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
164 }
165
SetCachedSize(int size) const166 void ConsoleConfig::SetCachedSize(int size) const {
167 _impl_._cached_size_.Set(size);
168 }
169
Clear()170 void ConsoleConfig::Clear() {
171 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ConsoleConfig)
172 ::uint32_t cached_has_bits = 0;
173 // Prevent compiler warnings about cached_has_bits being unused
174 (void) cached_has_bits;
175
176 cached_has_bits = _impl_._has_bits_[0];
177 if (cached_has_bits & 0x00000003u) {
178 ::memset(&_impl_.output_, 0, static_cast<size_t>(
179 reinterpret_cast<char*>(&_impl_.enable_colors_) -
180 reinterpret_cast<char*>(&_impl_.output_)) + sizeof(_impl_.enable_colors_));
181 }
182 _impl_._has_bits_.Clear();
183 _internal_metadata_.Clear<std::string>();
184 }
185
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)186 const char* ConsoleConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
187 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
188 _Internal::HasBits has_bits{};
189 while (!ctx->Done(&ptr)) {
190 ::uint32_t tag;
191 ptr = ::_pbi::ReadTag(ptr, &tag);
192 switch (tag >> 3) {
193 // optional .perfetto.protos.ConsoleConfig.Output output = 1;
194 case 1:
195 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
196 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
197 CHK_(ptr);
198 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::ConsoleConfig_Output_IsValid(val))) {
199 _internal_set_output(static_cast<::perfetto::protos::ConsoleConfig_Output>(val));
200 } else {
201 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
202 }
203 } else {
204 goto handle_unusual;
205 }
206 continue;
207 // optional bool enable_colors = 2;
208 case 2:
209 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
210 _Internal::set_has_enable_colors(&has_bits);
211 _impl_.enable_colors_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
212 CHK_(ptr);
213 } else {
214 goto handle_unusual;
215 }
216 continue;
217 default:
218 goto handle_unusual;
219 } // switch
220 handle_unusual:
221 if ((tag == 0) || ((tag & 7) == 4)) {
222 CHK_(ptr);
223 ctx->SetLastTag(tag);
224 goto message_done;
225 }
226 ptr = UnknownFieldParse(
227 tag,
228 _internal_metadata_.mutable_unknown_fields<std::string>(),
229 ptr, ctx);
230 CHK_(ptr != nullptr);
231 } // while
232 message_done:
233 _impl_._has_bits_.Or(has_bits);
234 return ptr;
235 failure:
236 ptr = nullptr;
237 goto message_done;
238 #undef CHK_
239 }
240
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const241 ::uint8_t* ConsoleConfig::_InternalSerialize(
242 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
243 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ConsoleConfig)
244 ::uint32_t cached_has_bits = 0;
245 (void) cached_has_bits;
246
247 cached_has_bits = _impl_._has_bits_[0];
248 // optional .perfetto.protos.ConsoleConfig.Output output = 1;
249 if (cached_has_bits & 0x00000001u) {
250 target = stream->EnsureSpace(target);
251 target = ::_pbi::WireFormatLite::WriteEnumToArray(
252 1, this->_internal_output(), target);
253 }
254
255 // optional bool enable_colors = 2;
256 if (cached_has_bits & 0x00000002u) {
257 target = stream->EnsureSpace(target);
258 target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_enable_colors(), target);
259 }
260
261 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
262 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
263 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
264 }
265 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ConsoleConfig)
266 return target;
267 }
268
ByteSizeLong() const269 size_t ConsoleConfig::ByteSizeLong() const {
270 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ConsoleConfig)
271 size_t total_size = 0;
272
273 ::uint32_t cached_has_bits = 0;
274 // Prevent compiler warnings about cached_has_bits being unused
275 (void) cached_has_bits;
276
277 cached_has_bits = _impl_._has_bits_[0];
278 if (cached_has_bits & 0x00000003u) {
279 // optional .perfetto.protos.ConsoleConfig.Output output = 1;
280 if (cached_has_bits & 0x00000001u) {
281 total_size += 1 +
282 ::_pbi::WireFormatLite::EnumSize(this->_internal_output());
283 }
284
285 // optional bool enable_colors = 2;
286 if (cached_has_bits & 0x00000002u) {
287 total_size += 1 + 1;
288 }
289
290 }
291 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
292 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
293 }
294 int cached_size = ::_pbi::ToCachedSize(total_size);
295 SetCachedSize(cached_size);
296 return total_size;
297 }
298
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)299 void ConsoleConfig::CheckTypeAndMergeFrom(
300 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
301 MergeFrom(*::_pbi::DownCast<const ConsoleConfig*>(
302 &from));
303 }
304
MergeFrom(const ConsoleConfig & from)305 void ConsoleConfig::MergeFrom(const ConsoleConfig& from) {
306 ConsoleConfig* const _this = this;
307 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ConsoleConfig)
308 GOOGLE_DCHECK_NE(&from, _this);
309 ::uint32_t cached_has_bits = 0;
310 (void) cached_has_bits;
311
312 cached_has_bits = from._impl_._has_bits_[0];
313 if (cached_has_bits & 0x00000003u) {
314 if (cached_has_bits & 0x00000001u) {
315 _this->_impl_.output_ = from._impl_.output_;
316 }
317 if (cached_has_bits & 0x00000002u) {
318 _this->_impl_.enable_colors_ = from._impl_.enable_colors_;
319 }
320 _this->_impl_._has_bits_[0] |= cached_has_bits;
321 }
322 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
323 }
324
CopyFrom(const ConsoleConfig & from)325 void ConsoleConfig::CopyFrom(const ConsoleConfig& from) {
326 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ConsoleConfig)
327 if (&from == this) return;
328 Clear();
329 MergeFrom(from);
330 }
331
IsInitialized() const332 bool ConsoleConfig::IsInitialized() const {
333 return true;
334 }
335
InternalSwap(ConsoleConfig * other)336 void ConsoleConfig::InternalSwap(ConsoleConfig* other) {
337 using std::swap;
338 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
339 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
340 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
341 PROTOBUF_FIELD_OFFSET(ConsoleConfig, _impl_.enable_colors_)
342 + sizeof(ConsoleConfig::_impl_.enable_colors_) // NOLINT
343 - PROTOBUF_FIELD_OFFSET(ConsoleConfig, _impl_.output_)>(
344 reinterpret_cast<char*>(&_impl_.output_),
345 reinterpret_cast<char*>(&other->_impl_.output_));
346 }
347
GetTypeName() const348 std::string ConsoleConfig::GetTypeName() const {
349 return "perfetto.protos.ConsoleConfig";
350 }
351
352
353 // @@protoc_insertion_point(namespace_scope)
354 } // namespace protos
355 } // namespace perfetto
356 PROTOBUF_NAMESPACE_OPEN
357 template<> PROTOBUF_NOINLINE ::perfetto::protos::ConsoleConfig*
CreateMaybeMessage(Arena * arena)358 Arena::CreateMaybeMessage< ::perfetto::protos::ConsoleConfig >(Arena* arena) {
359 return Arena::CreateMessageInternal< ::perfetto::protos::ConsoleConfig >(arena);
360 }
361 PROTOBUF_NAMESPACE_CLOSE
362
363 // @@protoc_insertion_point(global_scope)
364 #include <google/protobuf/port_undef.inc>
365