1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/trace/ftrace/printk.proto
3 
4 #include "protos/perfetto/trace/ftrace/printk.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 {
ConsoleFtraceEvent(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR ConsoleFtraceEvent::ConsoleFtraceEvent(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.msg_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {}
28 struct ConsoleFtraceEventDefaultTypeInternal {
ConsoleFtraceEventDefaultTypeInternalperfetto::protos::ConsoleFtraceEventDefaultTypeInternal29   PROTOBUF_CONSTEXPR ConsoleFtraceEventDefaultTypeInternal()
30       : _instance(::_pbi::ConstantInitialized{}) {}
~ConsoleFtraceEventDefaultTypeInternalperfetto::protos::ConsoleFtraceEventDefaultTypeInternal31   ~ConsoleFtraceEventDefaultTypeInternal() {}
32   union {  // NOLINT(misc-non-private-member-variables-in-classes)
33     ConsoleFtraceEvent _instance;
34   };
35 };
36 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConsoleFtraceEventDefaultTypeInternal _ConsoleFtraceEvent_default_instance_;
37 }  // namespace protos
38 }  // namespace perfetto
39 namespace perfetto {
40 namespace protos {
41 
42 // ===================================================================
43 
44 class ConsoleFtraceEvent::_Internal {
45  public:
46   using HasBits = decltype(std::declval<ConsoleFtraceEvent>()._impl_._has_bits_);
set_has_msg(HasBits * has_bits)47   static void set_has_msg(HasBits* has_bits) {
48     (*has_bits)[0] |= 1u;
49   }
50 };
51 
ConsoleFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)52 ConsoleFtraceEvent::ConsoleFtraceEvent(::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.ConsoleFtraceEvent)
57 }
ConsoleFtraceEvent(const ConsoleFtraceEvent & from)58 ConsoleFtraceEvent::ConsoleFtraceEvent(const ConsoleFtraceEvent& from)
59   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
60   ConsoleFtraceEvent* 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_.msg_){}};
65 
66   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
67   _impl_.msg_.InitDefault();
68   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
69     _impl_.msg_.Set("", GetArenaForAllocation());
70   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
71   if (from._internal_has_msg()) {
72     _this->_impl_.msg_.Set(from._internal_msg(),
73       _this->GetArenaForAllocation());
74   }
75   // @@protoc_insertion_point(copy_constructor:perfetto.protos.ConsoleFtraceEvent)
76 }
77 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)78 inline void ConsoleFtraceEvent::SharedCtor(
79     ::_pb::Arena* arena, bool is_message_owned) {
80   (void)arena;
81   (void)is_message_owned;
82   new (&_impl_) Impl_{
83       decltype(_impl_._has_bits_){}
84     , /*decltype(_impl_._cached_size_)*/{}
85     , decltype(_impl_.msg_){}
86   };
87   _impl_.msg_.InitDefault();
88   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
89     _impl_.msg_.Set("", GetArenaForAllocation());
90   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
91 }
92 
~ConsoleFtraceEvent()93 ConsoleFtraceEvent::~ConsoleFtraceEvent() {
94   // @@protoc_insertion_point(destructor:perfetto.protos.ConsoleFtraceEvent)
95   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
96   (void)arena;
97     return;
98   }
99   SharedDtor();
100 }
101 
SharedDtor()102 inline void ConsoleFtraceEvent::SharedDtor() {
103   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
104   _impl_.msg_.Destroy();
105 }
106 
SetCachedSize(int size) const107 void ConsoleFtraceEvent::SetCachedSize(int size) const {
108   _impl_._cached_size_.Set(size);
109 }
110 
Clear()111 void ConsoleFtraceEvent::Clear() {
112 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ConsoleFtraceEvent)
113   ::uint32_t cached_has_bits = 0;
114   // Prevent compiler warnings about cached_has_bits being unused
115   (void) cached_has_bits;
116 
117   cached_has_bits = _impl_._has_bits_[0];
118   if (cached_has_bits & 0x00000001u) {
119     _impl_.msg_.ClearNonDefaultToEmpty();
120   }
121   _impl_._has_bits_.Clear();
122   _internal_metadata_.Clear<std::string>();
123 }
124 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)125 const char* ConsoleFtraceEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
126 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
127   _Internal::HasBits has_bits{};
128   while (!ctx->Done(&ptr)) {
129     ::uint32_t tag;
130     ptr = ::_pbi::ReadTag(ptr, &tag);
131     switch (tag >> 3) {
132       // optional string msg = 1;
133       case 1:
134         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
135           auto str = _internal_mutable_msg();
136           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
137           CHK_(ptr);
138         } else {
139           goto handle_unusual;
140         }
141         continue;
142       default:
143         goto handle_unusual;
144     }  // switch
145   handle_unusual:
146     if ((tag == 0) || ((tag & 7) == 4)) {
147       CHK_(ptr);
148       ctx->SetLastTag(tag);
149       goto message_done;
150     }
151     ptr = UnknownFieldParse(
152         tag,
153         _internal_metadata_.mutable_unknown_fields<std::string>(),
154         ptr, ctx);
155     CHK_(ptr != nullptr);
156   }  // while
157 message_done:
158   _impl_._has_bits_.Or(has_bits);
159   return ptr;
160 failure:
161   ptr = nullptr;
162   goto message_done;
163 #undef CHK_
164 }
165 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const166 ::uint8_t* ConsoleFtraceEvent::_InternalSerialize(
167     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
168   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ConsoleFtraceEvent)
169   ::uint32_t cached_has_bits = 0;
170   (void) cached_has_bits;
171 
172   cached_has_bits = _impl_._has_bits_[0];
173   // optional string msg = 1;
174   if (cached_has_bits & 0x00000001u) {
175     target = stream->WriteStringMaybeAliased(
176         1, this->_internal_msg(), target);
177   }
178 
179   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
180     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
181         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
182   }
183   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ConsoleFtraceEvent)
184   return target;
185 }
186 
ByteSizeLong() const187 size_t ConsoleFtraceEvent::ByteSizeLong() const {
188 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ConsoleFtraceEvent)
189   size_t total_size = 0;
190 
191   ::uint32_t cached_has_bits = 0;
192   // Prevent compiler warnings about cached_has_bits being unused
193   (void) cached_has_bits;
194 
195   // optional string msg = 1;
196   cached_has_bits = _impl_._has_bits_[0];
197   if (cached_has_bits & 0x00000001u) {
198     total_size += 1 +
199       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
200         this->_internal_msg());
201   }
202 
203   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
204     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
205   }
206   int cached_size = ::_pbi::ToCachedSize(total_size);
207   SetCachedSize(cached_size);
208   return total_size;
209 }
210 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)211 void ConsoleFtraceEvent::CheckTypeAndMergeFrom(
212     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
213   MergeFrom(*::_pbi::DownCast<const ConsoleFtraceEvent*>(
214       &from));
215 }
216 
MergeFrom(const ConsoleFtraceEvent & from)217 void ConsoleFtraceEvent::MergeFrom(const ConsoleFtraceEvent& from) {
218   ConsoleFtraceEvent* const _this = this;
219   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ConsoleFtraceEvent)
220   GOOGLE_DCHECK_NE(&from, _this);
221   ::uint32_t cached_has_bits = 0;
222   (void) cached_has_bits;
223 
224   if (from._internal_has_msg()) {
225     _this->_internal_set_msg(from._internal_msg());
226   }
227   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
228 }
229 
CopyFrom(const ConsoleFtraceEvent & from)230 void ConsoleFtraceEvent::CopyFrom(const ConsoleFtraceEvent& from) {
231 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ConsoleFtraceEvent)
232   if (&from == this) return;
233   Clear();
234   MergeFrom(from);
235 }
236 
IsInitialized() const237 bool ConsoleFtraceEvent::IsInitialized() const {
238   return true;
239 }
240 
InternalSwap(ConsoleFtraceEvent * other)241 void ConsoleFtraceEvent::InternalSwap(ConsoleFtraceEvent* other) {
242   using std::swap;
243   auto* lhs_arena = GetArenaForAllocation();
244   auto* rhs_arena = other->GetArenaForAllocation();
245   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
246   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
247   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
248       &_impl_.msg_, lhs_arena,
249       &other->_impl_.msg_, rhs_arena
250   );
251 }
252 
GetTypeName() const253 std::string ConsoleFtraceEvent::GetTypeName() const {
254   return "perfetto.protos.ConsoleFtraceEvent";
255 }
256 
257 
258 // @@protoc_insertion_point(namespace_scope)
259 }  // namespace protos
260 }  // namespace perfetto
261 PROTOBUF_NAMESPACE_OPEN
262 template<> PROTOBUF_NOINLINE ::perfetto::protos::ConsoleFtraceEvent*
CreateMaybeMessage(Arena * arena)263 Arena::CreateMaybeMessage< ::perfetto::protos::ConsoleFtraceEvent >(Arena* arena) {
264   return Arena::CreateMessageInternal< ::perfetto::protos::ConsoleFtraceEvent >(arena);
265 }
266 PROTOBUF_NAMESPACE_CLOSE
267 
268 // @@protoc_insertion_point(global_scope)
269 #include <google/protobuf/port_undef.inc>
270