1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: frameworks/proto_logging/stats/attribution_node.proto
3 
4 #include "frameworks/proto_logging/stats/attribution_node.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/descriptor.h>
13 #include <google/protobuf/generated_message_reflection.h>
14 #include <google/protobuf/reflection_ops.h>
15 #include <google/protobuf/wire_format.h>
16 // @@protoc_insertion_point(includes)
17 #include <google/protobuf/port_def.inc>
18 
19 PROTOBUF_PRAGMA_INIT_SEG
20 
21 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
22 namespace _pbi = _pb::internal;
23 
24 namespace android {
25 namespace os {
26 namespace statsd {
AttributionNode(::_pbi::ConstantInitialized)27 PROTOBUF_CONSTEXPR AttributionNode::AttributionNode(
28     ::_pbi::ConstantInitialized): _impl_{
29     /*decltype(_impl_._has_bits_)*/{}
30   , /*decltype(_impl_._cached_size_)*/{}
31   , /*decltype(_impl_.tag_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
32   , /*decltype(_impl_.uid_)*/0} {}
33 struct AttributionNodeDefaultTypeInternal {
AttributionNodeDefaultTypeInternalandroid::os::statsd::AttributionNodeDefaultTypeInternal34   PROTOBUF_CONSTEXPR AttributionNodeDefaultTypeInternal()
35       : _instance(::_pbi::ConstantInitialized{}) {}
~AttributionNodeDefaultTypeInternalandroid::os::statsd::AttributionNodeDefaultTypeInternal36   ~AttributionNodeDefaultTypeInternal() {}
37   union {  // NOLINT(misc-non-private-member-variables-in-classes)
38     AttributionNode _instance;
39   };
40 };
41 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AttributionNodeDefaultTypeInternal _AttributionNode_default_instance_;
42 }  // namespace statsd
43 }  // namespace os
44 }  // namespace android
45 static ::_pb::Metadata file_level_metadata_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto[1];
46 static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto = nullptr;
47 static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto = nullptr;
48 
49 const ::uint32_t TableStruct_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
50   PROTOBUF_FIELD_OFFSET(::android::os::statsd::AttributionNode, _impl_._has_bits_),
51   PROTOBUF_FIELD_OFFSET(::android::os::statsd::AttributionNode, _internal_metadata_),
52   ~0u,  // no _extensions_
53   ~0u,  // no _oneof_case_
54   ~0u,  // no _weak_field_map_
55   ~0u,  // no _inlined_string_donated_
56   PROTOBUF_FIELD_OFFSET(::android::os::statsd::AttributionNode, _impl_.uid_),
57   PROTOBUF_FIELD_OFFSET(::android::os::statsd::AttributionNode, _impl_.tag_),
58   1,
59   0,
60 };
61 static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
62   { 0, 8, -1, sizeof(::android::os::statsd::AttributionNode)},
63 };
64 
65 static const ::_pb::Message* const file_default_instances[] = {
66   &::android::os::statsd::_AttributionNode_default_instance_._instance,
67 };
68 
69 const char descriptor_table_protodef_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
70   "\n5frameworks/proto_logging/stats/attribu"
71   "tion_node.proto\022\021android.os.statsd\"+\n\017At"
72   "tributionNode\022\013\n\003uid\030\001 \001(\005\022\013\n\003tag\030\002 \001(\tB"
73   "\022\n\016com.android.osP\001"
74   ;
75 static ::_pbi::once_flag descriptor_table_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto_once;
76 const ::_pbi::DescriptorTable descriptor_table_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto = {
77     false, false, 139, descriptor_table_protodef_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto,
78     "frameworks/proto_logging/stats/attribution_node.proto",
79     &descriptor_table_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto_once, nullptr, 0, 1,
80     schemas, file_default_instances, TableStruct_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto::offsets,
81     file_level_metadata_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto, file_level_enum_descriptors_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto,
82     file_level_service_descriptors_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto,
83 };
descriptor_table_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto_getter()84 PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto_getter() {
85   return &descriptor_table_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto;
86 }
87 
88 // Force running AddDescriptors() at dynamic initialization time.
89 PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto(&descriptor_table_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto);
90 namespace android {
91 namespace os {
92 namespace statsd {
93 
94 // ===================================================================
95 
96 class AttributionNode::_Internal {
97  public:
98   using HasBits = decltype(std::declval<AttributionNode>()._impl_._has_bits_);
set_has_uid(HasBits * has_bits)99   static void set_has_uid(HasBits* has_bits) {
100     (*has_bits)[0] |= 2u;
101   }
set_has_tag(HasBits * has_bits)102   static void set_has_tag(HasBits* has_bits) {
103     (*has_bits)[0] |= 1u;
104   }
105 };
106 
AttributionNode(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)107 AttributionNode::AttributionNode(::PROTOBUF_NAMESPACE_ID::Arena* arena,
108                          bool is_message_owned)
109   : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
110   SharedCtor(arena, is_message_owned);
111   // @@protoc_insertion_point(arena_constructor:android.os.statsd.AttributionNode)
112 }
AttributionNode(const AttributionNode & from)113 AttributionNode::AttributionNode(const AttributionNode& from)
114   : ::PROTOBUF_NAMESPACE_ID::Message() {
115   AttributionNode* const _this = this; (void)_this;
116   new (&_impl_) Impl_{
117       decltype(_impl_._has_bits_){from._impl_._has_bits_}
118     , /*decltype(_impl_._cached_size_)*/{}
119     , decltype(_impl_.tag_){}
120     , decltype(_impl_.uid_){}};
121 
122   _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
123   _impl_.tag_.InitDefault();
124   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
125     _impl_.tag_.Set("", GetArenaForAllocation());
126   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
127   if (from._internal_has_tag()) {
128     _this->_impl_.tag_.Set(from._internal_tag(),
129       _this->GetArenaForAllocation());
130   }
131   _this->_impl_.uid_ = from._impl_.uid_;
132   // @@protoc_insertion_point(copy_constructor:android.os.statsd.AttributionNode)
133 }
134 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)135 inline void AttributionNode::SharedCtor(
136     ::_pb::Arena* arena, bool is_message_owned) {
137   (void)arena;
138   (void)is_message_owned;
139   new (&_impl_) Impl_{
140       decltype(_impl_._has_bits_){}
141     , /*decltype(_impl_._cached_size_)*/{}
142     , decltype(_impl_.tag_){}
143     , decltype(_impl_.uid_){0}
144   };
145   _impl_.tag_.InitDefault();
146   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
147     _impl_.tag_.Set("", GetArenaForAllocation());
148   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
149 }
150 
~AttributionNode()151 AttributionNode::~AttributionNode() {
152   // @@protoc_insertion_point(destructor:android.os.statsd.AttributionNode)
153   if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
154   (void)arena;
155     return;
156   }
157   SharedDtor();
158 }
159 
SharedDtor()160 inline void AttributionNode::SharedDtor() {
161   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
162   _impl_.tag_.Destroy();
163 }
164 
SetCachedSize(int size) const165 void AttributionNode::SetCachedSize(int size) const {
166   _impl_._cached_size_.Set(size);
167 }
168 
Clear()169 void AttributionNode::Clear() {
170 // @@protoc_insertion_point(message_clear_start:android.os.statsd.AttributionNode)
171   ::uint32_t cached_has_bits = 0;
172   // Prevent compiler warnings about cached_has_bits being unused
173   (void) cached_has_bits;
174 
175   cached_has_bits = _impl_._has_bits_[0];
176   if (cached_has_bits & 0x00000001u) {
177     _impl_.tag_.ClearNonDefaultToEmpty();
178   }
179   _impl_.uid_ = 0;
180   _impl_._has_bits_.Clear();
181   _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
182 }
183 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)184 const char* AttributionNode::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
185 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
186   _Internal::HasBits has_bits{};
187   while (!ctx->Done(&ptr)) {
188     ::uint32_t tag;
189     ptr = ::_pbi::ReadTag(ptr, &tag);
190     switch (tag >> 3) {
191       // optional int32 uid = 1;
192       case 1:
193         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
194           _Internal::set_has_uid(&has_bits);
195           _impl_.uid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
196           CHK_(ptr);
197         } else {
198           goto handle_unusual;
199         }
200         continue;
201       // optional string tag = 2;
202       case 2:
203         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
204           auto str = _internal_mutable_tag();
205           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
206           CHK_(ptr);
207           #ifndef NDEBUG
208           ::_pbi::VerifyUTF8(str, "android.os.statsd.AttributionNode.tag");
209           #endif  // !NDEBUG
210         } else {
211           goto handle_unusual;
212         }
213         continue;
214       default:
215         goto handle_unusual;
216     }  // switch
217   handle_unusual:
218     if ((tag == 0) || ((tag & 7) == 4)) {
219       CHK_(ptr);
220       ctx->SetLastTag(tag);
221       goto message_done;
222     }
223     ptr = UnknownFieldParse(
224         tag,
225         _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
226         ptr, ctx);
227     CHK_(ptr != nullptr);
228   }  // while
229 message_done:
230   _impl_._has_bits_.Or(has_bits);
231   return ptr;
232 failure:
233   ptr = nullptr;
234   goto message_done;
235 #undef CHK_
236 }
237 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const238 ::uint8_t* AttributionNode::_InternalSerialize(
239     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
240   // @@protoc_insertion_point(serialize_to_array_start:android.os.statsd.AttributionNode)
241   ::uint32_t cached_has_bits = 0;
242   (void) cached_has_bits;
243 
244   cached_has_bits = _impl_._has_bits_[0];
245   // optional int32 uid = 1;
246   if (cached_has_bits & 0x00000002u) {
247     target = stream->EnsureSpace(target);
248     target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_uid(), target);
249   }
250 
251   // optional string tag = 2;
252   if (cached_has_bits & 0x00000001u) {
253     ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
254       this->_internal_tag().data(), static_cast<int>(this->_internal_tag().length()),
255       ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
256       "android.os.statsd.AttributionNode.tag");
257     target = stream->WriteStringMaybeAliased(
258         2, this->_internal_tag(), target);
259   }
260 
261   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
262     target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
263         _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
264   }
265   // @@protoc_insertion_point(serialize_to_array_end:android.os.statsd.AttributionNode)
266   return target;
267 }
268 
ByteSizeLong() const269 size_t AttributionNode::ByteSizeLong() const {
270 // @@protoc_insertion_point(message_byte_size_start:android.os.statsd.AttributionNode)
271   size_t total_size = 0;
272 
273   ::uint32_t cached_has_bits = 0;
274   // Prevent compiler warnings about cached_has_bits being unused
275   (void) cached_has_bits;
276 
277   cached_has_bits = _impl_._has_bits_[0];
278   if (cached_has_bits & 0x00000003u) {
279     // optional string tag = 2;
280     if (cached_has_bits & 0x00000001u) {
281       total_size += 1 +
282         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
283           this->_internal_tag());
284     }
285 
286     // optional int32 uid = 1;
287     if (cached_has_bits & 0x00000002u) {
288       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_uid());
289     }
290 
291   }
292   return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
293 }
294 
295 const ::PROTOBUF_NAMESPACE_ID::Message::ClassData AttributionNode::_class_data_ = {
296     ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
297     AttributionNode::MergeImpl
298 };
GetClassData() const299 const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*AttributionNode::GetClassData() const { return &_class_data_; }
300 
301 
MergeImpl(::PROTOBUF_NAMESPACE_ID::Message & to_msg,const::PROTOBUF_NAMESPACE_ID::Message & from_msg)302 void AttributionNode::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
303   auto* const _this = static_cast<AttributionNode*>(&to_msg);
304   auto& from = static_cast<const AttributionNode&>(from_msg);
305   // @@protoc_insertion_point(class_specific_merge_from_start:android.os.statsd.AttributionNode)
306   GOOGLE_DCHECK_NE(&from, _this);
307   ::uint32_t cached_has_bits = 0;
308   (void) cached_has_bits;
309 
310   cached_has_bits = from._impl_._has_bits_[0];
311   if (cached_has_bits & 0x00000003u) {
312     if (cached_has_bits & 0x00000001u) {
313       _this->_internal_set_tag(from._internal_tag());
314     }
315     if (cached_has_bits & 0x00000002u) {
316       _this->_impl_.uid_ = from._impl_.uid_;
317     }
318     _this->_impl_._has_bits_[0] |= cached_has_bits;
319   }
320   _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
321 }
322 
CopyFrom(const AttributionNode & from)323 void AttributionNode::CopyFrom(const AttributionNode& from) {
324 // @@protoc_insertion_point(class_specific_copy_from_start:android.os.statsd.AttributionNode)
325   if (&from == this) return;
326   Clear();
327   MergeFrom(from);
328 }
329 
IsInitialized() const330 bool AttributionNode::IsInitialized() const {
331   return true;
332 }
333 
InternalSwap(AttributionNode * other)334 void AttributionNode::InternalSwap(AttributionNode* other) {
335   using std::swap;
336   auto* lhs_arena = GetArenaForAllocation();
337   auto* rhs_arena = other->GetArenaForAllocation();
338   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
339   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
340   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
341       &_impl_.tag_, lhs_arena,
342       &other->_impl_.tag_, rhs_arena
343   );
344   swap(_impl_.uid_, other->_impl_.uid_);
345 }
346 
GetMetadata() const347 ::PROTOBUF_NAMESPACE_ID::Metadata AttributionNode::GetMetadata() const {
348   return ::_pbi::AssignDescriptors(
349       &descriptor_table_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto_getter, &descriptor_table_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto_once,
350       file_level_metadata_frameworks_2fproto_5flogging_2fstats_2fattribution_5fnode_2eproto[0]);
351 }
352 
353 // @@protoc_insertion_point(namespace_scope)
354 }  // namespace statsd
355 }  // namespace os
356 }  // namespace android
357 PROTOBUF_NAMESPACE_OPEN
358 template<> PROTOBUF_NOINLINE ::android::os::statsd::AttributionNode*
CreateMaybeMessage(Arena * arena)359 Arena::CreateMaybeMessage< ::android::os::statsd::AttributionNode >(Arena* arena) {
360   return Arena::CreateMessageInternal< ::android::os::statsd::AttributionNode >(arena);
361 }
362 PROTOBUF_NAMESPACE_CLOSE
363 
364 // @@protoc_insertion_point(global_scope)
365 #include <google/protobuf/port_undef.inc>
366