1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/config/chrome/system_metrics.proto
3 
4 #include "protos/perfetto/config/chrome/system_metrics.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 {
ChromiumSystemMetricsConfig(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR ChromiumSystemMetricsConfig::ChromiumSystemMetricsConfig(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.sampling_interval_ms_)*/0u} {}
28 struct ChromiumSystemMetricsConfigDefaultTypeInternal {
ChromiumSystemMetricsConfigDefaultTypeInternalperfetto::protos::ChromiumSystemMetricsConfigDefaultTypeInternal29   PROTOBUF_CONSTEXPR ChromiumSystemMetricsConfigDefaultTypeInternal()
30       : _instance(::_pbi::ConstantInitialized{}) {}
~ChromiumSystemMetricsConfigDefaultTypeInternalperfetto::protos::ChromiumSystemMetricsConfigDefaultTypeInternal31   ~ChromiumSystemMetricsConfigDefaultTypeInternal() {}
32   union {  // NOLINT(misc-non-private-member-variables-in-classes)
33     ChromiumSystemMetricsConfig _instance;
34   };
35 };
36 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ChromiumSystemMetricsConfigDefaultTypeInternal _ChromiumSystemMetricsConfig_default_instance_;
37 }  // namespace protos
38 }  // namespace perfetto
39 namespace perfetto {
40 namespace protos {
41 
42 // ===================================================================
43 
44 class ChromiumSystemMetricsConfig::_Internal {
45  public:
46   using HasBits = decltype(std::declval<ChromiumSystemMetricsConfig>()._impl_._has_bits_);
set_has_sampling_interval_ms(HasBits * has_bits)47   static void set_has_sampling_interval_ms(HasBits* has_bits) {
48     (*has_bits)[0] |= 1u;
49   }
50 };
51 
ChromiumSystemMetricsConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)52 ChromiumSystemMetricsConfig::ChromiumSystemMetricsConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
53                          bool is_message_owned)
54   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
55   SharedCtor(arena, is_message_owned);
56   // @@protoc_insertion_point(arena_constructor:perfetto.protos.ChromiumSystemMetricsConfig)
57 }
ChromiumSystemMetricsConfig(const ChromiumSystemMetricsConfig & from)58 ChromiumSystemMetricsConfig::ChromiumSystemMetricsConfig(const ChromiumSystemMetricsConfig& from)
59   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
60   ChromiumSystemMetricsConfig* const _this = this; (void)_this;
61   new (&_impl_) Impl_{
62       decltype(_impl_._has_bits_){from._impl_._has_bits_}
63     , /*decltype(_impl_._cached_size_)*/{}
64     , decltype(_impl_.sampling_interval_ms_){}};
65 
66   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
67   _this->_impl_.sampling_interval_ms_ = from._impl_.sampling_interval_ms_;
68   // @@protoc_insertion_point(copy_constructor:perfetto.protos.ChromiumSystemMetricsConfig)
69 }
70 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)71 inline void ChromiumSystemMetricsConfig::SharedCtor(
72     ::_pb::Arena* arena, bool is_message_owned) {
73   (void)arena;
74   (void)is_message_owned;
75   new (&_impl_) Impl_{
76       decltype(_impl_._has_bits_){}
77     , /*decltype(_impl_._cached_size_)*/{}
78     , decltype(_impl_.sampling_interval_ms_){0u}
79   };
80 }
81 
~ChromiumSystemMetricsConfig()82 ChromiumSystemMetricsConfig::~ChromiumSystemMetricsConfig() {
83   // @@protoc_insertion_point(destructor:perfetto.protos.ChromiumSystemMetricsConfig)
84   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
85   (void)arena;
86     return;
87   }
88   SharedDtor();
89 }
90 
SharedDtor()91 inline void ChromiumSystemMetricsConfig::SharedDtor() {
92   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
93 }
94 
SetCachedSize(int size) const95 void ChromiumSystemMetricsConfig::SetCachedSize(int size) const {
96   _impl_._cached_size_.Set(size);
97 }
98 
Clear()99 void ChromiumSystemMetricsConfig::Clear() {
100 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ChromiumSystemMetricsConfig)
101   ::uint32_t cached_has_bits = 0;
102   // Prevent compiler warnings about cached_has_bits being unused
103   (void) cached_has_bits;
104 
105   _impl_.sampling_interval_ms_ = 0u;
106   _impl_._has_bits_.Clear();
107   _internal_metadata_.Clear<std::string>();
108 }
109 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)110 const char* ChromiumSystemMetricsConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
111 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
112   _Internal::HasBits has_bits{};
113   while (!ctx->Done(&ptr)) {
114     ::uint32_t tag;
115     ptr = ::_pbi::ReadTag(ptr, &tag);
116     switch (tag >> 3) {
117       // optional uint32 sampling_interval_ms = 1;
118       case 1:
119         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
120           _Internal::set_has_sampling_interval_ms(&has_bits);
121           _impl_.sampling_interval_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
122           CHK_(ptr);
123         } else {
124           goto handle_unusual;
125         }
126         continue;
127       default:
128         goto handle_unusual;
129     }  // switch
130   handle_unusual:
131     if ((tag == 0) || ((tag & 7) == 4)) {
132       CHK_(ptr);
133       ctx->SetLastTag(tag);
134       goto message_done;
135     }
136     ptr = UnknownFieldParse(
137         tag,
138         _internal_metadata_.mutable_unknown_fields<std::string>(),
139         ptr, ctx);
140     CHK_(ptr != nullptr);
141   }  // while
142 message_done:
143   _impl_._has_bits_.Or(has_bits);
144   return ptr;
145 failure:
146   ptr = nullptr;
147   goto message_done;
148 #undef CHK_
149 }
150 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const151 ::uint8_t* ChromiumSystemMetricsConfig::_InternalSerialize(
152     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
153   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ChromiumSystemMetricsConfig)
154   ::uint32_t cached_has_bits = 0;
155   (void) cached_has_bits;
156 
157   cached_has_bits = _impl_._has_bits_[0];
158   // optional uint32 sampling_interval_ms = 1;
159   if (cached_has_bits & 0x00000001u) {
160     target = stream->EnsureSpace(target);
161     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_sampling_interval_ms(), target);
162   }
163 
164   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
165     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
166         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
167   }
168   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ChromiumSystemMetricsConfig)
169   return target;
170 }
171 
ByteSizeLong() const172 size_t ChromiumSystemMetricsConfig::ByteSizeLong() const {
173 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ChromiumSystemMetricsConfig)
174   size_t total_size = 0;
175 
176   ::uint32_t cached_has_bits = 0;
177   // Prevent compiler warnings about cached_has_bits being unused
178   (void) cached_has_bits;
179 
180   // optional uint32 sampling_interval_ms = 1;
181   cached_has_bits = _impl_._has_bits_[0];
182   if (cached_has_bits & 0x00000001u) {
183     total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_sampling_interval_ms());
184   }
185 
186   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
187     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
188   }
189   int cached_size = ::_pbi::ToCachedSize(total_size);
190   SetCachedSize(cached_size);
191   return total_size;
192 }
193 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)194 void ChromiumSystemMetricsConfig::CheckTypeAndMergeFrom(
195     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
196   MergeFrom(*::_pbi::DownCast<const ChromiumSystemMetricsConfig*>(
197       &from));
198 }
199 
MergeFrom(const ChromiumSystemMetricsConfig & from)200 void ChromiumSystemMetricsConfig::MergeFrom(const ChromiumSystemMetricsConfig& from) {
201   ChromiumSystemMetricsConfig* const _this = this;
202   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ChromiumSystemMetricsConfig)
203   GOOGLE_DCHECK_NE(&from, _this);
204   ::uint32_t cached_has_bits = 0;
205   (void) cached_has_bits;
206 
207   if (from._internal_has_sampling_interval_ms()) {
208     _this->_internal_set_sampling_interval_ms(from._internal_sampling_interval_ms());
209   }
210   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
211 }
212 
CopyFrom(const ChromiumSystemMetricsConfig & from)213 void ChromiumSystemMetricsConfig::CopyFrom(const ChromiumSystemMetricsConfig& from) {
214 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ChromiumSystemMetricsConfig)
215   if (&from == this) return;
216   Clear();
217   MergeFrom(from);
218 }
219 
IsInitialized() const220 bool ChromiumSystemMetricsConfig::IsInitialized() const {
221   return true;
222 }
223 
InternalSwap(ChromiumSystemMetricsConfig * other)224 void ChromiumSystemMetricsConfig::InternalSwap(ChromiumSystemMetricsConfig* other) {
225   using std::swap;
226   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
227   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
228   swap(_impl_.sampling_interval_ms_, other->_impl_.sampling_interval_ms_);
229 }
230 
GetTypeName() const231 std::string ChromiumSystemMetricsConfig::GetTypeName() const {
232   return "perfetto.protos.ChromiumSystemMetricsConfig";
233 }
234 
235 
236 // @@protoc_insertion_point(namespace_scope)
237 }  // namespace protos
238 }  // namespace perfetto
239 PROTOBUF_NAMESPACE_OPEN
240 template<> PROTOBUF_NOINLINE ::perfetto::protos::ChromiumSystemMetricsConfig*
CreateMaybeMessage(Arena * arena)241 Arena::CreateMaybeMessage< ::perfetto::protos::ChromiumSystemMetricsConfig >(Arena* arena) {
242   return Arena::CreateMessageInternal< ::perfetto::protos::ChromiumSystemMetricsConfig >(arena);
243 }
244 PROTOBUF_NAMESPACE_CLOSE
245 
246 // @@protoc_insertion_point(global_scope)
247 #include <google/protobuf/port_undef.inc>
248