1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/config/android/android_system_property_config.proto
3
4 #include "protos/perfetto/config/android/android_system_property_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 {
AndroidSystemPropertyConfig(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR AndroidSystemPropertyConfig::AndroidSystemPropertyConfig(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.property_name_)*/{}
28 , /*decltype(_impl_.poll_ms_)*/0u} {}
29 struct AndroidSystemPropertyConfigDefaultTypeInternal {
AndroidSystemPropertyConfigDefaultTypeInternalperfetto::protos::AndroidSystemPropertyConfigDefaultTypeInternal30 PROTOBUF_CONSTEXPR AndroidSystemPropertyConfigDefaultTypeInternal()
31 : _instance(::_pbi::ConstantInitialized{}) {}
~AndroidSystemPropertyConfigDefaultTypeInternalperfetto::protos::AndroidSystemPropertyConfigDefaultTypeInternal32 ~AndroidSystemPropertyConfigDefaultTypeInternal() {}
33 union { // NOLINT(misc-non-private-member-variables-in-classes)
34 AndroidSystemPropertyConfig _instance;
35 };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AndroidSystemPropertyConfigDefaultTypeInternal _AndroidSystemPropertyConfig_default_instance_;
38 } // namespace protos
39 } // namespace perfetto
40 namespace perfetto {
41 namespace protos {
42
43 // ===================================================================
44
45 class AndroidSystemPropertyConfig::_Internal {
46 public:
47 using HasBits = decltype(std::declval<AndroidSystemPropertyConfig>()._impl_._has_bits_);
set_has_poll_ms(HasBits * has_bits)48 static void set_has_poll_ms(HasBits* has_bits) {
49 (*has_bits)[0] |= 1u;
50 }
51 };
52
AndroidSystemPropertyConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)53 AndroidSystemPropertyConfig::AndroidSystemPropertyConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
54 bool is_message_owned)
55 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
56 SharedCtor(arena, is_message_owned);
57 // @@protoc_insertion_point(arena_constructor:perfetto.protos.AndroidSystemPropertyConfig)
58 }
AndroidSystemPropertyConfig(const AndroidSystemPropertyConfig & from)59 AndroidSystemPropertyConfig::AndroidSystemPropertyConfig(const AndroidSystemPropertyConfig& from)
60 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
61 AndroidSystemPropertyConfig* const _this = this; (void)_this;
62 new (&_impl_) Impl_{
63 decltype(_impl_._has_bits_){from._impl_._has_bits_}
64 , /*decltype(_impl_._cached_size_)*/{}
65 , decltype(_impl_.property_name_){from._impl_.property_name_}
66 , decltype(_impl_.poll_ms_){}};
67
68 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
69 _this->_impl_.poll_ms_ = from._impl_.poll_ms_;
70 // @@protoc_insertion_point(copy_constructor:perfetto.protos.AndroidSystemPropertyConfig)
71 }
72
SharedCtor(::_pb::Arena * arena,bool is_message_owned)73 inline void AndroidSystemPropertyConfig::SharedCtor(
74 ::_pb::Arena* arena, bool is_message_owned) {
75 (void)arena;
76 (void)is_message_owned;
77 new (&_impl_) Impl_{
78 decltype(_impl_._has_bits_){}
79 , /*decltype(_impl_._cached_size_)*/{}
80 , decltype(_impl_.property_name_){arena}
81 , decltype(_impl_.poll_ms_){0u}
82 };
83 }
84
~AndroidSystemPropertyConfig()85 AndroidSystemPropertyConfig::~AndroidSystemPropertyConfig() {
86 // @@protoc_insertion_point(destructor:perfetto.protos.AndroidSystemPropertyConfig)
87 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
88 (void)arena;
89 return;
90 }
91 SharedDtor();
92 }
93
SharedDtor()94 inline void AndroidSystemPropertyConfig::SharedDtor() {
95 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
96 _impl_.property_name_.~RepeatedPtrField();
97 }
98
SetCachedSize(int size) const99 void AndroidSystemPropertyConfig::SetCachedSize(int size) const {
100 _impl_._cached_size_.Set(size);
101 }
102
Clear()103 void AndroidSystemPropertyConfig::Clear() {
104 // @@protoc_insertion_point(message_clear_start:perfetto.protos.AndroidSystemPropertyConfig)
105 ::uint32_t cached_has_bits = 0;
106 // Prevent compiler warnings about cached_has_bits being unused
107 (void) cached_has_bits;
108
109 _impl_.property_name_.Clear();
110 _impl_.poll_ms_ = 0u;
111 _impl_._has_bits_.Clear();
112 _internal_metadata_.Clear<std::string>();
113 }
114
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)115 const char* AndroidSystemPropertyConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
116 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
117 _Internal::HasBits has_bits{};
118 while (!ctx->Done(&ptr)) {
119 ::uint32_t tag;
120 ptr = ::_pbi::ReadTag(ptr, &tag);
121 switch (tag >> 3) {
122 // optional uint32 poll_ms = 1;
123 case 1:
124 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
125 _Internal::set_has_poll_ms(&has_bits);
126 _impl_.poll_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
127 CHK_(ptr);
128 } else {
129 goto handle_unusual;
130 }
131 continue;
132 // repeated string property_name = 2;
133 case 2:
134 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
135 ptr -= 1;
136 do {
137 ptr += 1;
138 auto str = _internal_add_property_name();
139 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
140 CHK_(ptr);
141 if (!ctx->DataAvailable(ptr)) break;
142 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
143 } else {
144 goto handle_unusual;
145 }
146 continue;
147 default:
148 goto handle_unusual;
149 } // switch
150 handle_unusual:
151 if ((tag == 0) || ((tag & 7) == 4)) {
152 CHK_(ptr);
153 ctx->SetLastTag(tag);
154 goto message_done;
155 }
156 ptr = UnknownFieldParse(
157 tag,
158 _internal_metadata_.mutable_unknown_fields<std::string>(),
159 ptr, ctx);
160 CHK_(ptr != nullptr);
161 } // while
162 message_done:
163 _impl_._has_bits_.Or(has_bits);
164 return ptr;
165 failure:
166 ptr = nullptr;
167 goto message_done;
168 #undef CHK_
169 }
170
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const171 ::uint8_t* AndroidSystemPropertyConfig::_InternalSerialize(
172 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
173 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.AndroidSystemPropertyConfig)
174 ::uint32_t cached_has_bits = 0;
175 (void) cached_has_bits;
176
177 cached_has_bits = _impl_._has_bits_[0];
178 // optional uint32 poll_ms = 1;
179 if (cached_has_bits & 0x00000001u) {
180 target = stream->EnsureSpace(target);
181 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_poll_ms(), target);
182 }
183
184 // repeated string property_name = 2;
185 for (int i = 0, n = this->_internal_property_name_size(); i < n; i++) {
186 const auto& s = this->_internal_property_name(i);
187 target = stream->WriteString(2, s, target);
188 }
189
190 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
191 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
192 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
193 }
194 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.AndroidSystemPropertyConfig)
195 return target;
196 }
197
ByteSizeLong() const198 size_t AndroidSystemPropertyConfig::ByteSizeLong() const {
199 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.AndroidSystemPropertyConfig)
200 size_t total_size = 0;
201
202 ::uint32_t cached_has_bits = 0;
203 // Prevent compiler warnings about cached_has_bits being unused
204 (void) cached_has_bits;
205
206 // repeated string property_name = 2;
207 total_size += 1 *
208 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.property_name_.size());
209 for (int i = 0, n = _impl_.property_name_.size(); i < n; i++) {
210 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
211 _impl_.property_name_.Get(i));
212 }
213
214 // optional uint32 poll_ms = 1;
215 cached_has_bits = _impl_._has_bits_[0];
216 if (cached_has_bits & 0x00000001u) {
217 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_poll_ms());
218 }
219
220 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
221 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
222 }
223 int cached_size = ::_pbi::ToCachedSize(total_size);
224 SetCachedSize(cached_size);
225 return total_size;
226 }
227
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)228 void AndroidSystemPropertyConfig::CheckTypeAndMergeFrom(
229 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
230 MergeFrom(*::_pbi::DownCast<const AndroidSystemPropertyConfig*>(
231 &from));
232 }
233
MergeFrom(const AndroidSystemPropertyConfig & from)234 void AndroidSystemPropertyConfig::MergeFrom(const AndroidSystemPropertyConfig& from) {
235 AndroidSystemPropertyConfig* const _this = this;
236 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.AndroidSystemPropertyConfig)
237 GOOGLE_DCHECK_NE(&from, _this);
238 ::uint32_t cached_has_bits = 0;
239 (void) cached_has_bits;
240
241 _this->_impl_.property_name_.MergeFrom(from._impl_.property_name_);
242 if (from._internal_has_poll_ms()) {
243 _this->_internal_set_poll_ms(from._internal_poll_ms());
244 }
245 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
246 }
247
CopyFrom(const AndroidSystemPropertyConfig & from)248 void AndroidSystemPropertyConfig::CopyFrom(const AndroidSystemPropertyConfig& from) {
249 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.AndroidSystemPropertyConfig)
250 if (&from == this) return;
251 Clear();
252 MergeFrom(from);
253 }
254
IsInitialized() const255 bool AndroidSystemPropertyConfig::IsInitialized() const {
256 return true;
257 }
258
InternalSwap(AndroidSystemPropertyConfig * other)259 void AndroidSystemPropertyConfig::InternalSwap(AndroidSystemPropertyConfig* other) {
260 using std::swap;
261 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
262 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
263 _impl_.property_name_.InternalSwap(&other->_impl_.property_name_);
264 swap(_impl_.poll_ms_, other->_impl_.poll_ms_);
265 }
266
GetTypeName() const267 std::string AndroidSystemPropertyConfig::GetTypeName() const {
268 return "perfetto.protos.AndroidSystemPropertyConfig";
269 }
270
271
272 // @@protoc_insertion_point(namespace_scope)
273 } // namespace protos
274 } // namespace perfetto
275 PROTOBUF_NAMESPACE_OPEN
276 template<> PROTOBUF_NOINLINE ::perfetto::protos::AndroidSystemPropertyConfig*
CreateMaybeMessage(Arena * arena)277 Arena::CreateMaybeMessage< ::perfetto::protos::AndroidSystemPropertyConfig >(Arena* arena) {
278 return Arena::CreateMessageInternal< ::perfetto::protos::AndroidSystemPropertyConfig >(arena);
279 }
280 PROTOBUF_NAMESPACE_CLOSE
281
282 // @@protoc_insertion_point(global_scope)
283 #include <google/protobuf/port_undef.inc>
284