1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/common/interceptor_descriptor.proto
3
4 #include "protos/perfetto/common/interceptor_descriptor.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 {
InterceptorDescriptor(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR InterceptorDescriptor::InterceptorDescriptor(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {}
28 struct InterceptorDescriptorDefaultTypeInternal {
InterceptorDescriptorDefaultTypeInternalperfetto::protos::InterceptorDescriptorDefaultTypeInternal29 PROTOBUF_CONSTEXPR InterceptorDescriptorDefaultTypeInternal()
30 : _instance(::_pbi::ConstantInitialized{}) {}
~InterceptorDescriptorDefaultTypeInternalperfetto::protos::InterceptorDescriptorDefaultTypeInternal31 ~InterceptorDescriptorDefaultTypeInternal() {}
32 union { // NOLINT(misc-non-private-member-variables-in-classes)
33 InterceptorDescriptor _instance;
34 };
35 };
36 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InterceptorDescriptorDefaultTypeInternal _InterceptorDescriptor_default_instance_;
37 } // namespace protos
38 } // namespace perfetto
39 namespace perfetto {
40 namespace protos {
41
42 // ===================================================================
43
44 class InterceptorDescriptor::_Internal {
45 public:
46 using HasBits = decltype(std::declval<InterceptorDescriptor>()._impl_._has_bits_);
set_has_name(HasBits * has_bits)47 static void set_has_name(HasBits* has_bits) {
48 (*has_bits)[0] |= 1u;
49 }
50 };
51
InterceptorDescriptor(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)52 InterceptorDescriptor::InterceptorDescriptor(::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.InterceptorDescriptor)
57 }
InterceptorDescriptor(const InterceptorDescriptor & from)58 InterceptorDescriptor::InterceptorDescriptor(const InterceptorDescriptor& from)
59 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
60 InterceptorDescriptor* 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_.name_){}};
65
66 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
67 _impl_.name_.InitDefault();
68 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
69 _impl_.name_.Set("", GetArenaForAllocation());
70 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
71 if (from._internal_has_name()) {
72 _this->_impl_.name_.Set(from._internal_name(),
73 _this->GetArenaForAllocation());
74 }
75 // @@protoc_insertion_point(copy_constructor:perfetto.protos.InterceptorDescriptor)
76 }
77
SharedCtor(::_pb::Arena * arena,bool is_message_owned)78 inline void InterceptorDescriptor::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_.name_){}
86 };
87 _impl_.name_.InitDefault();
88 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
89 _impl_.name_.Set("", GetArenaForAllocation());
90 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
91 }
92
~InterceptorDescriptor()93 InterceptorDescriptor::~InterceptorDescriptor() {
94 // @@protoc_insertion_point(destructor:perfetto.protos.InterceptorDescriptor)
95 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
96 (void)arena;
97 return;
98 }
99 SharedDtor();
100 }
101
SharedDtor()102 inline void InterceptorDescriptor::SharedDtor() {
103 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
104 _impl_.name_.Destroy();
105 }
106
SetCachedSize(int size) const107 void InterceptorDescriptor::SetCachedSize(int size) const {
108 _impl_._cached_size_.Set(size);
109 }
110
Clear()111 void InterceptorDescriptor::Clear() {
112 // @@protoc_insertion_point(message_clear_start:perfetto.protos.InterceptorDescriptor)
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_.name_.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* InterceptorDescriptor::_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 name = 1;
133 case 1:
134 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
135 auto str = _internal_mutable_name();
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* InterceptorDescriptor::_InternalSerialize(
167 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
168 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.InterceptorDescriptor)
169 ::uint32_t cached_has_bits = 0;
170 (void) cached_has_bits;
171
172 cached_has_bits = _impl_._has_bits_[0];
173 // optional string name = 1;
174 if (cached_has_bits & 0x00000001u) {
175 target = stream->WriteStringMaybeAliased(
176 1, this->_internal_name(), 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.InterceptorDescriptor)
184 return target;
185 }
186
ByteSizeLong() const187 size_t InterceptorDescriptor::ByteSizeLong() const {
188 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.InterceptorDescriptor)
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 name = 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_name());
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 InterceptorDescriptor::CheckTypeAndMergeFrom(
212 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
213 MergeFrom(*::_pbi::DownCast<const InterceptorDescriptor*>(
214 &from));
215 }
216
MergeFrom(const InterceptorDescriptor & from)217 void InterceptorDescriptor::MergeFrom(const InterceptorDescriptor& from) {
218 InterceptorDescriptor* const _this = this;
219 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.InterceptorDescriptor)
220 GOOGLE_DCHECK_NE(&from, _this);
221 ::uint32_t cached_has_bits = 0;
222 (void) cached_has_bits;
223
224 if (from._internal_has_name()) {
225 _this->_internal_set_name(from._internal_name());
226 }
227 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
228 }
229
CopyFrom(const InterceptorDescriptor & from)230 void InterceptorDescriptor::CopyFrom(const InterceptorDescriptor& from) {
231 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.InterceptorDescriptor)
232 if (&from == this) return;
233 Clear();
234 MergeFrom(from);
235 }
236
IsInitialized() const237 bool InterceptorDescriptor::IsInitialized() const {
238 return true;
239 }
240
InternalSwap(InterceptorDescriptor * other)241 void InterceptorDescriptor::InternalSwap(InterceptorDescriptor* 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_.name_, lhs_arena,
249 &other->_impl_.name_, rhs_arena
250 );
251 }
252
GetTypeName() const253 std::string InterceptorDescriptor::GetTypeName() const {
254 return "perfetto.protos.InterceptorDescriptor";
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::InterceptorDescriptor*
CreateMaybeMessage(Arena * arena)263 Arena::CreateMaybeMessage< ::perfetto::protos::InterceptorDescriptor >(Arena* arena) {
264 return Arena::CreateMessageInternal< ::perfetto::protos::InterceptorDescriptor >(arena);
265 }
266 PROTOBUF_NAMESPACE_CLOSE
267
268 // @@protoc_insertion_point(global_scope)
269 #include <google/protobuf/port_undef.inc>
270