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