1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: icing/index/numeric/wildcard-property-storage.proto
3
4 #include "icing/index/numeric/wildcard-property-storage.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 icing {
22 namespace lib {
WildcardPropertyStorage(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR WildcardPropertyStorage::WildcardPropertyStorage(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_.property_entries_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}} {}
27 struct WildcardPropertyStorageDefaultTypeInternal {
WildcardPropertyStorageDefaultTypeInternalicing::lib::WildcardPropertyStorageDefaultTypeInternal28 PROTOBUF_CONSTEXPR WildcardPropertyStorageDefaultTypeInternal()
29 : _instance(::_pbi::ConstantInitialized{}) {}
~WildcardPropertyStorageDefaultTypeInternalicing::lib::WildcardPropertyStorageDefaultTypeInternal30 ~WildcardPropertyStorageDefaultTypeInternal() {}
31 union { // NOLINT(misc-non-private-member-variables-in-classes)
32 WildcardPropertyStorage _instance;
33 };
34 };
35 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WildcardPropertyStorageDefaultTypeInternal _WildcardPropertyStorage_default_instance_;
36 } // namespace lib
37 } // namespace icing
38 namespace icing {
39 namespace lib {
40
41 // ===================================================================
42
43 class WildcardPropertyStorage::_Internal {
44 public:
45 };
46
WildcardPropertyStorage(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)47 WildcardPropertyStorage::WildcardPropertyStorage(::PROTOBUF_NAMESPACE_ID::Arena* arena,
48 bool is_message_owned)
49 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
50 SharedCtor(arena, is_message_owned);
51 // @@protoc_insertion_point(arena_constructor:icing.lib.WildcardPropertyStorage)
52 }
WildcardPropertyStorage(const WildcardPropertyStorage & from)53 WildcardPropertyStorage::WildcardPropertyStorage(const WildcardPropertyStorage& from)
54 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
55 WildcardPropertyStorage* const _this = this; (void)_this;
56 new (&_impl_) Impl_{
57 decltype(_impl_.property_entries_){from._impl_.property_entries_}
58 , /*decltype(_impl_._cached_size_)*/{}};
59
60 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
61 // @@protoc_insertion_point(copy_constructor:icing.lib.WildcardPropertyStorage)
62 }
63
SharedCtor(::_pb::Arena * arena,bool is_message_owned)64 inline void WildcardPropertyStorage::SharedCtor(
65 ::_pb::Arena* arena, bool is_message_owned) {
66 (void)arena;
67 (void)is_message_owned;
68 new (&_impl_) Impl_{
69 decltype(_impl_.property_entries_){arena}
70 , /*decltype(_impl_._cached_size_)*/{}
71 };
72 }
73
~WildcardPropertyStorage()74 WildcardPropertyStorage::~WildcardPropertyStorage() {
75 // @@protoc_insertion_point(destructor:icing.lib.WildcardPropertyStorage)
76 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
77 (void)arena;
78 return;
79 }
80 SharedDtor();
81 }
82
SharedDtor()83 inline void WildcardPropertyStorage::SharedDtor() {
84 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
85 _impl_.property_entries_.~RepeatedPtrField();
86 }
87
SetCachedSize(int size) const88 void WildcardPropertyStorage::SetCachedSize(int size) const {
89 _impl_._cached_size_.Set(size);
90 }
91
Clear()92 void WildcardPropertyStorage::Clear() {
93 // @@protoc_insertion_point(message_clear_start:icing.lib.WildcardPropertyStorage)
94 ::uint32_t cached_has_bits = 0;
95 // Prevent compiler warnings about cached_has_bits being unused
96 (void) cached_has_bits;
97
98 _impl_.property_entries_.Clear();
99 _internal_metadata_.Clear<std::string>();
100 }
101
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)102 const char* WildcardPropertyStorage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
103 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
104 while (!ctx->Done(&ptr)) {
105 ::uint32_t tag;
106 ptr = ::_pbi::ReadTag(ptr, &tag);
107 switch (tag >> 3) {
108 // repeated string property_entries = 1;
109 case 1:
110 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
111 ptr -= 1;
112 do {
113 ptr += 1;
114 auto str = _internal_add_property_entries();
115 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
116 CHK_(ptr);
117 if (!ctx->DataAvailable(ptr)) break;
118 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
119 } else {
120 goto handle_unusual;
121 }
122 continue;
123 default:
124 goto handle_unusual;
125 } // switch
126 handle_unusual:
127 if ((tag == 0) || ((tag & 7) == 4)) {
128 CHK_(ptr);
129 ctx->SetLastTag(tag);
130 goto message_done;
131 }
132 ptr = UnknownFieldParse(
133 tag,
134 _internal_metadata_.mutable_unknown_fields<std::string>(),
135 ptr, ctx);
136 CHK_(ptr != nullptr);
137 } // while
138 message_done:
139 return ptr;
140 failure:
141 ptr = nullptr;
142 goto message_done;
143 #undef CHK_
144 }
145
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const146 ::uint8_t* WildcardPropertyStorage::_InternalSerialize(
147 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
148 // @@protoc_insertion_point(serialize_to_array_start:icing.lib.WildcardPropertyStorage)
149 ::uint32_t cached_has_bits = 0;
150 (void) cached_has_bits;
151
152 // repeated string property_entries = 1;
153 for (int i = 0, n = this->_internal_property_entries_size(); i < n; i++) {
154 const auto& s = this->_internal_property_entries(i);
155 target = stream->WriteString(1, s, target);
156 }
157
158 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
159 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
160 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
161 }
162 // @@protoc_insertion_point(serialize_to_array_end:icing.lib.WildcardPropertyStorage)
163 return target;
164 }
165
ByteSizeLong() const166 size_t WildcardPropertyStorage::ByteSizeLong() const {
167 // @@protoc_insertion_point(message_byte_size_start:icing.lib.WildcardPropertyStorage)
168 size_t total_size = 0;
169
170 ::uint32_t cached_has_bits = 0;
171 // Prevent compiler warnings about cached_has_bits being unused
172 (void) cached_has_bits;
173
174 // repeated string property_entries = 1;
175 total_size += 1 *
176 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.property_entries_.size());
177 for (int i = 0, n = _impl_.property_entries_.size(); i < n; i++) {
178 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
179 _impl_.property_entries_.Get(i));
180 }
181
182 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
183 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
184 }
185 int cached_size = ::_pbi::ToCachedSize(total_size);
186 SetCachedSize(cached_size);
187 return total_size;
188 }
189
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)190 void WildcardPropertyStorage::CheckTypeAndMergeFrom(
191 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
192 MergeFrom(*::_pbi::DownCast<const WildcardPropertyStorage*>(
193 &from));
194 }
195
MergeFrom(const WildcardPropertyStorage & from)196 void WildcardPropertyStorage::MergeFrom(const WildcardPropertyStorage& from) {
197 WildcardPropertyStorage* const _this = this;
198 // @@protoc_insertion_point(class_specific_merge_from_start:icing.lib.WildcardPropertyStorage)
199 GOOGLE_DCHECK_NE(&from, _this);
200 ::uint32_t cached_has_bits = 0;
201 (void) cached_has_bits;
202
203 _this->_impl_.property_entries_.MergeFrom(from._impl_.property_entries_);
204 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
205 }
206
CopyFrom(const WildcardPropertyStorage & from)207 void WildcardPropertyStorage::CopyFrom(const WildcardPropertyStorage& from) {
208 // @@protoc_insertion_point(class_specific_copy_from_start:icing.lib.WildcardPropertyStorage)
209 if (&from == this) return;
210 Clear();
211 MergeFrom(from);
212 }
213
IsInitialized() const214 bool WildcardPropertyStorage::IsInitialized() const {
215 return true;
216 }
217
InternalSwap(WildcardPropertyStorage * other)218 void WildcardPropertyStorage::InternalSwap(WildcardPropertyStorage* other) {
219 using std::swap;
220 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
221 _impl_.property_entries_.InternalSwap(&other->_impl_.property_entries_);
222 }
223
GetTypeName() const224 std::string WildcardPropertyStorage::GetTypeName() const {
225 return "icing.lib.WildcardPropertyStorage";
226 }
227
228
229 // @@protoc_insertion_point(namespace_scope)
230 } // namespace lib
231 } // namespace icing
232 PROTOBUF_NAMESPACE_OPEN
233 template<> PROTOBUF_NOINLINE ::icing::lib::WildcardPropertyStorage*
CreateMaybeMessage(Arena * arena)234 Arena::CreateMaybeMessage< ::icing::lib::WildcardPropertyStorage >(Arena* arena) {
235 return Arena::CreateMessageInternal< ::icing::lib::WildcardPropertyStorage >(arena);
236 }
237 PROTOBUF_NAMESPACE_CLOSE
238
239 // @@protoc_insertion_point(global_scope)
240 #include <google/protobuf/port_undef.inc>
241