1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: icing/proto/scoring.proto
3
4 #include "icing/proto/scoring.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 {
ScoringSpecProto_RankingStrategy(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR ScoringSpecProto_RankingStrategy::ScoringSpecProto_RankingStrategy(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._cached_size_)*/{}} {}
26 struct ScoringSpecProto_RankingStrategyDefaultTypeInternal {
ScoringSpecProto_RankingStrategyDefaultTypeInternalicing::lib::ScoringSpecProto_RankingStrategyDefaultTypeInternal27 PROTOBUF_CONSTEXPR ScoringSpecProto_RankingStrategyDefaultTypeInternal()
28 : _instance(::_pbi::ConstantInitialized{}) {}
~ScoringSpecProto_RankingStrategyDefaultTypeInternalicing::lib::ScoringSpecProto_RankingStrategyDefaultTypeInternal29 ~ScoringSpecProto_RankingStrategyDefaultTypeInternal() {}
30 union { // NOLINT(misc-non-private-member-variables-in-classes)
31 ScoringSpecProto_RankingStrategy _instance;
32 };
33 };
34 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ScoringSpecProto_RankingStrategyDefaultTypeInternal _ScoringSpecProto_RankingStrategy_default_instance_;
ScoringSpecProto_Order(::_pbi::ConstantInitialized)35 PROTOBUF_CONSTEXPR ScoringSpecProto_Order::ScoringSpecProto_Order(
36 ::_pbi::ConstantInitialized): _impl_{
37 /*decltype(_impl_._cached_size_)*/{}} {}
38 struct ScoringSpecProto_OrderDefaultTypeInternal {
ScoringSpecProto_OrderDefaultTypeInternalicing::lib::ScoringSpecProto_OrderDefaultTypeInternal39 PROTOBUF_CONSTEXPR ScoringSpecProto_OrderDefaultTypeInternal()
40 : _instance(::_pbi::ConstantInitialized{}) {}
~ScoringSpecProto_OrderDefaultTypeInternalicing::lib::ScoringSpecProto_OrderDefaultTypeInternal41 ~ScoringSpecProto_OrderDefaultTypeInternal() {}
42 union { // NOLINT(misc-non-private-member-variables-in-classes)
43 ScoringSpecProto_Order _instance;
44 };
45 };
46 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ScoringSpecProto_OrderDefaultTypeInternal _ScoringSpecProto_Order_default_instance_;
ScoringSpecProto(::_pbi::ConstantInitialized)47 PROTOBUF_CONSTEXPR ScoringSpecProto::ScoringSpecProto(
48 ::_pbi::ConstantInitialized): _impl_{
49 /*decltype(_impl_._has_bits_)*/{}
50 , /*decltype(_impl_._cached_size_)*/{}
51 , /*decltype(_impl_.type_property_weights_)*/{}
52 , /*decltype(_impl_.additional_advanced_scoring_expressions_)*/{}
53 , /*decltype(_impl_.schema_type_alias_map_protos_)*/{}
54 , /*decltype(_impl_.scoring_feature_types_enabled_)*/{}
55 , /*decltype(_impl_._scoring_feature_types_enabled_cached_byte_size_)*/{0}
56 , /*decltype(_impl_.advanced_scoring_expression_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
57 , /*decltype(_impl_.rank_by_)*/0
58 , /*decltype(_impl_.order_by_)*/0} {}
59 struct ScoringSpecProtoDefaultTypeInternal {
ScoringSpecProtoDefaultTypeInternalicing::lib::ScoringSpecProtoDefaultTypeInternal60 PROTOBUF_CONSTEXPR ScoringSpecProtoDefaultTypeInternal()
61 : _instance(::_pbi::ConstantInitialized{}) {}
~ScoringSpecProtoDefaultTypeInternalicing::lib::ScoringSpecProtoDefaultTypeInternal62 ~ScoringSpecProtoDefaultTypeInternal() {}
63 union { // NOLINT(misc-non-private-member-variables-in-classes)
64 ScoringSpecProto _instance;
65 };
66 };
67 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ScoringSpecProtoDefaultTypeInternal _ScoringSpecProto_default_instance_;
SuggestionScoringSpecProto_SuggestionRankingStrategy(::_pbi::ConstantInitialized)68 PROTOBUF_CONSTEXPR SuggestionScoringSpecProto_SuggestionRankingStrategy::SuggestionScoringSpecProto_SuggestionRankingStrategy(
69 ::_pbi::ConstantInitialized): _impl_{
70 /*decltype(_impl_._cached_size_)*/{}} {}
71 struct SuggestionScoringSpecProto_SuggestionRankingStrategyDefaultTypeInternal {
SuggestionScoringSpecProto_SuggestionRankingStrategyDefaultTypeInternalicing::lib::SuggestionScoringSpecProto_SuggestionRankingStrategyDefaultTypeInternal72 PROTOBUF_CONSTEXPR SuggestionScoringSpecProto_SuggestionRankingStrategyDefaultTypeInternal()
73 : _instance(::_pbi::ConstantInitialized{}) {}
~SuggestionScoringSpecProto_SuggestionRankingStrategyDefaultTypeInternalicing::lib::SuggestionScoringSpecProto_SuggestionRankingStrategyDefaultTypeInternal74 ~SuggestionScoringSpecProto_SuggestionRankingStrategyDefaultTypeInternal() {}
75 union { // NOLINT(misc-non-private-member-variables-in-classes)
76 SuggestionScoringSpecProto_SuggestionRankingStrategy _instance;
77 };
78 };
79 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SuggestionScoringSpecProto_SuggestionRankingStrategyDefaultTypeInternal _SuggestionScoringSpecProto_SuggestionRankingStrategy_default_instance_;
SuggestionScoringSpecProto(::_pbi::ConstantInitialized)80 PROTOBUF_CONSTEXPR SuggestionScoringSpecProto::SuggestionScoringSpecProto(
81 ::_pbi::ConstantInitialized): _impl_{
82 /*decltype(_impl_._has_bits_)*/{}
83 , /*decltype(_impl_._cached_size_)*/{}
84 , /*decltype(_impl_.scoring_match_type_)*/0
85 , /*decltype(_impl_.rank_by_)*/0} {}
86 struct SuggestionScoringSpecProtoDefaultTypeInternal {
SuggestionScoringSpecProtoDefaultTypeInternalicing::lib::SuggestionScoringSpecProtoDefaultTypeInternal87 PROTOBUF_CONSTEXPR SuggestionScoringSpecProtoDefaultTypeInternal()
88 : _instance(::_pbi::ConstantInitialized{}) {}
~SuggestionScoringSpecProtoDefaultTypeInternalicing::lib::SuggestionScoringSpecProtoDefaultTypeInternal89 ~SuggestionScoringSpecProtoDefaultTypeInternal() {}
90 union { // NOLINT(misc-non-private-member-variables-in-classes)
91 SuggestionScoringSpecProto _instance;
92 };
93 };
94 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SuggestionScoringSpecProtoDefaultTypeInternal _SuggestionScoringSpecProto_default_instance_;
TypePropertyWeights(::_pbi::ConstantInitialized)95 PROTOBUF_CONSTEXPR TypePropertyWeights::TypePropertyWeights(
96 ::_pbi::ConstantInitialized): _impl_{
97 /*decltype(_impl_._has_bits_)*/{}
98 , /*decltype(_impl_._cached_size_)*/{}
99 , /*decltype(_impl_.property_weights_)*/{}
100 , /*decltype(_impl_.schema_type_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {}
101 struct TypePropertyWeightsDefaultTypeInternal {
TypePropertyWeightsDefaultTypeInternalicing::lib::TypePropertyWeightsDefaultTypeInternal102 PROTOBUF_CONSTEXPR TypePropertyWeightsDefaultTypeInternal()
103 : _instance(::_pbi::ConstantInitialized{}) {}
~TypePropertyWeightsDefaultTypeInternalicing::lib::TypePropertyWeightsDefaultTypeInternal104 ~TypePropertyWeightsDefaultTypeInternal() {}
105 union { // NOLINT(misc-non-private-member-variables-in-classes)
106 TypePropertyWeights _instance;
107 };
108 };
109 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TypePropertyWeightsDefaultTypeInternal _TypePropertyWeights_default_instance_;
PropertyWeight(::_pbi::ConstantInitialized)110 PROTOBUF_CONSTEXPR PropertyWeight::PropertyWeight(
111 ::_pbi::ConstantInitialized): _impl_{
112 /*decltype(_impl_._has_bits_)*/{}
113 , /*decltype(_impl_._cached_size_)*/{}
114 , /*decltype(_impl_.path_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
115 , /*decltype(_impl_.weight_)*/0} {}
116 struct PropertyWeightDefaultTypeInternal {
PropertyWeightDefaultTypeInternalicing::lib::PropertyWeightDefaultTypeInternal117 PROTOBUF_CONSTEXPR PropertyWeightDefaultTypeInternal()
118 : _instance(::_pbi::ConstantInitialized{}) {}
~PropertyWeightDefaultTypeInternalicing::lib::PropertyWeightDefaultTypeInternal119 ~PropertyWeightDefaultTypeInternal() {}
120 union { // NOLINT(misc-non-private-member-variables-in-classes)
121 PropertyWeight _instance;
122 };
123 };
124 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PropertyWeightDefaultTypeInternal _PropertyWeight_default_instance_;
SchemaTypeAliasMapProto(::_pbi::ConstantInitialized)125 PROTOBUF_CONSTEXPR SchemaTypeAliasMapProto::SchemaTypeAliasMapProto(
126 ::_pbi::ConstantInitialized): _impl_{
127 /*decltype(_impl_._has_bits_)*/{}
128 , /*decltype(_impl_._cached_size_)*/{}
129 , /*decltype(_impl_.schema_types_)*/{}
130 , /*decltype(_impl_.alias_schema_type_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {}
131 struct SchemaTypeAliasMapProtoDefaultTypeInternal {
SchemaTypeAliasMapProtoDefaultTypeInternalicing::lib::SchemaTypeAliasMapProtoDefaultTypeInternal132 PROTOBUF_CONSTEXPR SchemaTypeAliasMapProtoDefaultTypeInternal()
133 : _instance(::_pbi::ConstantInitialized{}) {}
~SchemaTypeAliasMapProtoDefaultTypeInternalicing::lib::SchemaTypeAliasMapProtoDefaultTypeInternal134 ~SchemaTypeAliasMapProtoDefaultTypeInternal() {}
135 union { // NOLINT(misc-non-private-member-variables-in-classes)
136 SchemaTypeAliasMapProto _instance;
137 };
138 };
139 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SchemaTypeAliasMapProtoDefaultTypeInternal _SchemaTypeAliasMapProto_default_instance_;
140 } // namespace lib
141 } // namespace icing
142 namespace icing {
143 namespace lib {
ScoringSpecProto_RankingStrategy_Code_IsValid(int value)144 bool ScoringSpecProto_RankingStrategy_Code_IsValid(int value) {
145 switch (value) {
146 case 0:
147 case 1:
148 case 2:
149 case 3:
150 case 4:
151 case 5:
152 case 6:
153 case 7:
154 case 8:
155 case 9:
156 case 10:
157 case 11:
158 return true;
159 default:
160 return false;
161 }
162 }
163
164 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ScoringSpecProto_RankingStrategy_Code_strings[12] = {};
165
166 static const char ScoringSpecProto_RankingStrategy_Code_names[] =
167 "ADVANCED_SCORING_EXPRESSION"
168 "CREATION_TIMESTAMP"
169 "DOCUMENT_SCORE"
170 "JOIN_AGGREGATE_SCORE"
171 "NONE"
172 "RELEVANCE_SCORE"
173 "USAGE_TYPE1_COUNT"
174 "USAGE_TYPE1_LAST_USED_TIMESTAMP"
175 "USAGE_TYPE2_COUNT"
176 "USAGE_TYPE2_LAST_USED_TIMESTAMP"
177 "USAGE_TYPE3_COUNT"
178 "USAGE_TYPE3_LAST_USED_TIMESTAMP";
179
180 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ScoringSpecProto_RankingStrategy_Code_entries[] = {
181 { {ScoringSpecProto_RankingStrategy_Code_names + 0, 27}, 11 },
182 { {ScoringSpecProto_RankingStrategy_Code_names + 27, 18}, 2 },
183 { {ScoringSpecProto_RankingStrategy_Code_names + 45, 14}, 1 },
184 { {ScoringSpecProto_RankingStrategy_Code_names + 59, 20}, 10 },
185 { {ScoringSpecProto_RankingStrategy_Code_names + 79, 4}, 0 },
186 { {ScoringSpecProto_RankingStrategy_Code_names + 83, 15}, 9 },
187 { {ScoringSpecProto_RankingStrategy_Code_names + 98, 17}, 3 },
188 { {ScoringSpecProto_RankingStrategy_Code_names + 115, 31}, 6 },
189 { {ScoringSpecProto_RankingStrategy_Code_names + 146, 17}, 4 },
190 { {ScoringSpecProto_RankingStrategy_Code_names + 163, 31}, 7 },
191 { {ScoringSpecProto_RankingStrategy_Code_names + 194, 17}, 5 },
192 { {ScoringSpecProto_RankingStrategy_Code_names + 211, 31}, 8 },
193 };
194
195 static const int ScoringSpecProto_RankingStrategy_Code_entries_by_number[] = {
196 4, // 0 -> NONE
197 2, // 1 -> DOCUMENT_SCORE
198 1, // 2 -> CREATION_TIMESTAMP
199 6, // 3 -> USAGE_TYPE1_COUNT
200 8, // 4 -> USAGE_TYPE2_COUNT
201 10, // 5 -> USAGE_TYPE3_COUNT
202 7, // 6 -> USAGE_TYPE1_LAST_USED_TIMESTAMP
203 9, // 7 -> USAGE_TYPE2_LAST_USED_TIMESTAMP
204 11, // 8 -> USAGE_TYPE3_LAST_USED_TIMESTAMP
205 5, // 9 -> RELEVANCE_SCORE
206 3, // 10 -> JOIN_AGGREGATE_SCORE
207 0, // 11 -> ADVANCED_SCORING_EXPRESSION
208 };
209
ScoringSpecProto_RankingStrategy_Code_Name(ScoringSpecProto_RankingStrategy_Code value)210 const std::string& ScoringSpecProto_RankingStrategy_Code_Name(
211 ScoringSpecProto_RankingStrategy_Code value) {
212 static const bool dummy =
213 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
214 ScoringSpecProto_RankingStrategy_Code_entries,
215 ScoringSpecProto_RankingStrategy_Code_entries_by_number,
216 12, ScoringSpecProto_RankingStrategy_Code_strings);
217 (void) dummy;
218 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
219 ScoringSpecProto_RankingStrategy_Code_entries,
220 ScoringSpecProto_RankingStrategy_Code_entries_by_number,
221 12, value);
222 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
223 ScoringSpecProto_RankingStrategy_Code_strings[idx].get();
224 }
ScoringSpecProto_RankingStrategy_Code_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,ScoringSpecProto_RankingStrategy_Code * value)225 bool ScoringSpecProto_RankingStrategy_Code_Parse(
226 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ScoringSpecProto_RankingStrategy_Code* value) {
227 int int_value;
228 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
229 ScoringSpecProto_RankingStrategy_Code_entries, 12, name, &int_value);
230 if (success) {
231 *value = static_cast<ScoringSpecProto_RankingStrategy_Code>(int_value);
232 }
233 return success;
234 }
235 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
236 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::NONE;
237 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::DOCUMENT_SCORE;
238 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::CREATION_TIMESTAMP;
239 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::USAGE_TYPE1_COUNT;
240 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::USAGE_TYPE2_COUNT;
241 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::USAGE_TYPE3_COUNT;
242 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::USAGE_TYPE1_LAST_USED_TIMESTAMP;
243 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::USAGE_TYPE2_LAST_USED_TIMESTAMP;
244 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::USAGE_TYPE3_LAST_USED_TIMESTAMP;
245 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::RELEVANCE_SCORE;
246 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::JOIN_AGGREGATE_SCORE;
247 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::ADVANCED_SCORING_EXPRESSION;
248 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::Code_MIN;
249 constexpr ScoringSpecProto_RankingStrategy_Code ScoringSpecProto_RankingStrategy::Code_MAX;
250 constexpr int ScoringSpecProto_RankingStrategy::Code_ARRAYSIZE;
251 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
ScoringSpecProto_Order_Code_IsValid(int value)252 bool ScoringSpecProto_Order_Code_IsValid(int value) {
253 switch (value) {
254 case 0:
255 case 1:
256 return true;
257 default:
258 return false;
259 }
260 }
261
262 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ScoringSpecProto_Order_Code_strings[2] = {};
263
264 static const char ScoringSpecProto_Order_Code_names[] =
265 "ASC"
266 "DESC";
267
268 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ScoringSpecProto_Order_Code_entries[] = {
269 { {ScoringSpecProto_Order_Code_names + 0, 3}, 1 },
270 { {ScoringSpecProto_Order_Code_names + 3, 4}, 0 },
271 };
272
273 static const int ScoringSpecProto_Order_Code_entries_by_number[] = {
274 1, // 0 -> DESC
275 0, // 1 -> ASC
276 };
277
ScoringSpecProto_Order_Code_Name(ScoringSpecProto_Order_Code value)278 const std::string& ScoringSpecProto_Order_Code_Name(
279 ScoringSpecProto_Order_Code value) {
280 static const bool dummy =
281 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
282 ScoringSpecProto_Order_Code_entries,
283 ScoringSpecProto_Order_Code_entries_by_number,
284 2, ScoringSpecProto_Order_Code_strings);
285 (void) dummy;
286 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
287 ScoringSpecProto_Order_Code_entries,
288 ScoringSpecProto_Order_Code_entries_by_number,
289 2, value);
290 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
291 ScoringSpecProto_Order_Code_strings[idx].get();
292 }
ScoringSpecProto_Order_Code_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,ScoringSpecProto_Order_Code * value)293 bool ScoringSpecProto_Order_Code_Parse(
294 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ScoringSpecProto_Order_Code* value) {
295 int int_value;
296 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
297 ScoringSpecProto_Order_Code_entries, 2, name, &int_value);
298 if (success) {
299 *value = static_cast<ScoringSpecProto_Order_Code>(int_value);
300 }
301 return success;
302 }
303 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
304 constexpr ScoringSpecProto_Order_Code ScoringSpecProto_Order::DESC;
305 constexpr ScoringSpecProto_Order_Code ScoringSpecProto_Order::ASC;
306 constexpr ScoringSpecProto_Order_Code ScoringSpecProto_Order::Code_MIN;
307 constexpr ScoringSpecProto_Order_Code ScoringSpecProto_Order::Code_MAX;
308 constexpr int ScoringSpecProto_Order::Code_ARRAYSIZE;
309 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_IsValid(int value)310 bool SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_IsValid(int value) {
311 switch (value) {
312 case 0:
313 case 1:
314 case 2:
315 return true;
316 default:
317 return false;
318 }
319 }
320
321 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_strings[3] = {};
322
323 static const char SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_names[] =
324 "DOCUMENT_COUNT"
325 "NONE"
326 "TERM_FREQUENCY";
327
328 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_entries[] = {
329 { {SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_names + 0, 14}, 1 },
330 { {SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_names + 14, 4}, 0 },
331 { {SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_names + 18, 14}, 2 },
332 };
333
334 static const int SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_entries_by_number[] = {
335 1, // 0 -> NONE
336 0, // 1 -> DOCUMENT_COUNT
337 2, // 2 -> TERM_FREQUENCY
338 };
339
SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_Name(SuggestionScoringSpecProto_SuggestionRankingStrategy_Code value)340 const std::string& SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_Name(
341 SuggestionScoringSpecProto_SuggestionRankingStrategy_Code value) {
342 static const bool dummy =
343 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
344 SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_entries,
345 SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_entries_by_number,
346 3, SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_strings);
347 (void) dummy;
348 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
349 SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_entries,
350 SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_entries_by_number,
351 3, value);
352 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
353 SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_strings[idx].get();
354 }
SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,SuggestionScoringSpecProto_SuggestionRankingStrategy_Code * value)355 bool SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_Parse(
356 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SuggestionScoringSpecProto_SuggestionRankingStrategy_Code* value) {
357 int int_value;
358 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
359 SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_entries, 3, name, &int_value);
360 if (success) {
361 *value = static_cast<SuggestionScoringSpecProto_SuggestionRankingStrategy_Code>(int_value);
362 }
363 return success;
364 }
365 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
366 constexpr SuggestionScoringSpecProto_SuggestionRankingStrategy_Code SuggestionScoringSpecProto_SuggestionRankingStrategy::NONE;
367 constexpr SuggestionScoringSpecProto_SuggestionRankingStrategy_Code SuggestionScoringSpecProto_SuggestionRankingStrategy::DOCUMENT_COUNT;
368 constexpr SuggestionScoringSpecProto_SuggestionRankingStrategy_Code SuggestionScoringSpecProto_SuggestionRankingStrategy::TERM_FREQUENCY;
369 constexpr SuggestionScoringSpecProto_SuggestionRankingStrategy_Code SuggestionScoringSpecProto_SuggestionRankingStrategy::Code_MIN;
370 constexpr SuggestionScoringSpecProto_SuggestionRankingStrategy_Code SuggestionScoringSpecProto_SuggestionRankingStrategy::Code_MAX;
371 constexpr int SuggestionScoringSpecProto_SuggestionRankingStrategy::Code_ARRAYSIZE;
372 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
ScoringFeatureType_IsValid(int value)373 bool ScoringFeatureType_IsValid(int value) {
374 switch (value) {
375 case 0:
376 case 1:
377 return true;
378 default:
379 return false;
380 }
381 }
382
383 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ScoringFeatureType_strings[2] = {};
384
385 static const char ScoringFeatureType_names[] =
386 "SCORABLE_PROPERTY_RANKING"
387 "SCORING_FEATURE_TYPE_UNKNOWN";
388
389 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ScoringFeatureType_entries[] = {
390 { {ScoringFeatureType_names + 0, 25}, 1 },
391 { {ScoringFeatureType_names + 25, 28}, 0 },
392 };
393
394 static const int ScoringFeatureType_entries_by_number[] = {
395 1, // 0 -> SCORING_FEATURE_TYPE_UNKNOWN
396 0, // 1 -> SCORABLE_PROPERTY_RANKING
397 };
398
ScoringFeatureType_Name(ScoringFeatureType value)399 const std::string& ScoringFeatureType_Name(
400 ScoringFeatureType value) {
401 static const bool dummy =
402 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
403 ScoringFeatureType_entries,
404 ScoringFeatureType_entries_by_number,
405 2, ScoringFeatureType_strings);
406 (void) dummy;
407 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
408 ScoringFeatureType_entries,
409 ScoringFeatureType_entries_by_number,
410 2, value);
411 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
412 ScoringFeatureType_strings[idx].get();
413 }
ScoringFeatureType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,ScoringFeatureType * value)414 bool ScoringFeatureType_Parse(
415 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ScoringFeatureType* value) {
416 int int_value;
417 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
418 ScoringFeatureType_entries, 2, name, &int_value);
419 if (success) {
420 *value = static_cast<ScoringFeatureType>(int_value);
421 }
422 return success;
423 }
424
425 // ===================================================================
426
427 class ScoringSpecProto_RankingStrategy::_Internal {
428 public:
429 };
430
ScoringSpecProto_RankingStrategy(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)431 ScoringSpecProto_RankingStrategy::ScoringSpecProto_RankingStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena,
432 bool is_message_owned)
433 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
434 SharedCtor(arena, is_message_owned);
435 // @@protoc_insertion_point(arena_constructor:icing.lib.ScoringSpecProto.RankingStrategy)
436 }
ScoringSpecProto_RankingStrategy(const ScoringSpecProto_RankingStrategy & from)437 ScoringSpecProto_RankingStrategy::ScoringSpecProto_RankingStrategy(const ScoringSpecProto_RankingStrategy& from)
438 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
439 ScoringSpecProto_RankingStrategy* const _this = this; (void)_this;
440 new (&_impl_) Impl_{
441 /*decltype(_impl_._cached_size_)*/{}};
442
443 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
444 // @@protoc_insertion_point(copy_constructor:icing.lib.ScoringSpecProto.RankingStrategy)
445 }
446
SharedCtor(::_pb::Arena * arena,bool is_message_owned)447 inline void ScoringSpecProto_RankingStrategy::SharedCtor(
448 ::_pb::Arena* arena, bool is_message_owned) {
449 (void)arena;
450 (void)is_message_owned;
451 new (&_impl_) Impl_{
452 /*decltype(_impl_._cached_size_)*/{}
453 };
454 }
455
~ScoringSpecProto_RankingStrategy()456 ScoringSpecProto_RankingStrategy::~ScoringSpecProto_RankingStrategy() {
457 // @@protoc_insertion_point(destructor:icing.lib.ScoringSpecProto.RankingStrategy)
458 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
459 (void)arena;
460 return;
461 }
462 SharedDtor();
463 }
464
SharedDtor()465 inline void ScoringSpecProto_RankingStrategy::SharedDtor() {
466 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
467 }
468
SetCachedSize(int size) const469 void ScoringSpecProto_RankingStrategy::SetCachedSize(int size) const {
470 _impl_._cached_size_.Set(size);
471 }
472
Clear()473 void ScoringSpecProto_RankingStrategy::Clear() {
474 // @@protoc_insertion_point(message_clear_start:icing.lib.ScoringSpecProto.RankingStrategy)
475 ::uint32_t cached_has_bits = 0;
476 // Prevent compiler warnings about cached_has_bits being unused
477 (void) cached_has_bits;
478
479 _internal_metadata_.Clear<std::string>();
480 }
481
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)482 const char* ScoringSpecProto_RankingStrategy::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
483 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
484 while (!ctx->Done(&ptr)) {
485 ::uint32_t tag;
486 ptr = ::_pbi::ReadTag(ptr, &tag);
487 if ((tag == 0) || ((tag & 7) == 4)) {
488 CHK_(ptr);
489 ctx->SetLastTag(tag);
490 goto message_done;
491 }
492 ptr = UnknownFieldParse(
493 tag,
494 _internal_metadata_.mutable_unknown_fields<std::string>(),
495 ptr, ctx);
496 CHK_(ptr != nullptr);
497 } // while
498 message_done:
499 return ptr;
500 failure:
501 ptr = nullptr;
502 goto message_done;
503 #undef CHK_
504 }
505
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const506 ::uint8_t* ScoringSpecProto_RankingStrategy::_InternalSerialize(
507 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
508 // @@protoc_insertion_point(serialize_to_array_start:icing.lib.ScoringSpecProto.RankingStrategy)
509 ::uint32_t cached_has_bits = 0;
510 (void) cached_has_bits;
511
512 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
513 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
514 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
515 }
516 // @@protoc_insertion_point(serialize_to_array_end:icing.lib.ScoringSpecProto.RankingStrategy)
517 return target;
518 }
519
ByteSizeLong() const520 size_t ScoringSpecProto_RankingStrategy::ByteSizeLong() const {
521 // @@protoc_insertion_point(message_byte_size_start:icing.lib.ScoringSpecProto.RankingStrategy)
522 size_t total_size = 0;
523
524 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
525 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
526 }
527 int cached_size = ::_pbi::ToCachedSize(total_size);
528 SetCachedSize(cached_size);
529 return total_size;
530 }
531
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)532 void ScoringSpecProto_RankingStrategy::CheckTypeAndMergeFrom(
533 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
534 MergeFrom(*::_pbi::DownCast<const ScoringSpecProto_RankingStrategy*>(
535 &from));
536 }
537
MergeFrom(const ScoringSpecProto_RankingStrategy & from)538 void ScoringSpecProto_RankingStrategy::MergeFrom(const ScoringSpecProto_RankingStrategy& from) {
539 ScoringSpecProto_RankingStrategy* const _this = this;
540 // @@protoc_insertion_point(class_specific_merge_from_start:icing.lib.ScoringSpecProto.RankingStrategy)
541 GOOGLE_DCHECK_NE(&from, _this);
542 ::uint32_t cached_has_bits = 0;
543 (void) cached_has_bits;
544
545 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
546 }
547
CopyFrom(const ScoringSpecProto_RankingStrategy & from)548 void ScoringSpecProto_RankingStrategy::CopyFrom(const ScoringSpecProto_RankingStrategy& from) {
549 // @@protoc_insertion_point(class_specific_copy_from_start:icing.lib.ScoringSpecProto.RankingStrategy)
550 if (&from == this) return;
551 Clear();
552 MergeFrom(from);
553 }
554
IsInitialized() const555 bool ScoringSpecProto_RankingStrategy::IsInitialized() const {
556 return true;
557 }
558
InternalSwap(ScoringSpecProto_RankingStrategy * other)559 void ScoringSpecProto_RankingStrategy::InternalSwap(ScoringSpecProto_RankingStrategy* other) {
560 using std::swap;
561 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
562 }
563
GetTypeName() const564 std::string ScoringSpecProto_RankingStrategy::GetTypeName() const {
565 return "icing.lib.ScoringSpecProto.RankingStrategy";
566 }
567
568
569 // ===================================================================
570
571 class ScoringSpecProto_Order::_Internal {
572 public:
573 };
574
ScoringSpecProto_Order(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)575 ScoringSpecProto_Order::ScoringSpecProto_Order(::PROTOBUF_NAMESPACE_ID::Arena* arena,
576 bool is_message_owned)
577 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
578 SharedCtor(arena, is_message_owned);
579 // @@protoc_insertion_point(arena_constructor:icing.lib.ScoringSpecProto.Order)
580 }
ScoringSpecProto_Order(const ScoringSpecProto_Order & from)581 ScoringSpecProto_Order::ScoringSpecProto_Order(const ScoringSpecProto_Order& from)
582 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
583 ScoringSpecProto_Order* const _this = this; (void)_this;
584 new (&_impl_) Impl_{
585 /*decltype(_impl_._cached_size_)*/{}};
586
587 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
588 // @@protoc_insertion_point(copy_constructor:icing.lib.ScoringSpecProto.Order)
589 }
590
SharedCtor(::_pb::Arena * arena,bool is_message_owned)591 inline void ScoringSpecProto_Order::SharedCtor(
592 ::_pb::Arena* arena, bool is_message_owned) {
593 (void)arena;
594 (void)is_message_owned;
595 new (&_impl_) Impl_{
596 /*decltype(_impl_._cached_size_)*/{}
597 };
598 }
599
~ScoringSpecProto_Order()600 ScoringSpecProto_Order::~ScoringSpecProto_Order() {
601 // @@protoc_insertion_point(destructor:icing.lib.ScoringSpecProto.Order)
602 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
603 (void)arena;
604 return;
605 }
606 SharedDtor();
607 }
608
SharedDtor()609 inline void ScoringSpecProto_Order::SharedDtor() {
610 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
611 }
612
SetCachedSize(int size) const613 void ScoringSpecProto_Order::SetCachedSize(int size) const {
614 _impl_._cached_size_.Set(size);
615 }
616
Clear()617 void ScoringSpecProto_Order::Clear() {
618 // @@protoc_insertion_point(message_clear_start:icing.lib.ScoringSpecProto.Order)
619 ::uint32_t cached_has_bits = 0;
620 // Prevent compiler warnings about cached_has_bits being unused
621 (void) cached_has_bits;
622
623 _internal_metadata_.Clear<std::string>();
624 }
625
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)626 const char* ScoringSpecProto_Order::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
627 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
628 while (!ctx->Done(&ptr)) {
629 ::uint32_t tag;
630 ptr = ::_pbi::ReadTag(ptr, &tag);
631 if ((tag == 0) || ((tag & 7) == 4)) {
632 CHK_(ptr);
633 ctx->SetLastTag(tag);
634 goto message_done;
635 }
636 ptr = UnknownFieldParse(
637 tag,
638 _internal_metadata_.mutable_unknown_fields<std::string>(),
639 ptr, ctx);
640 CHK_(ptr != nullptr);
641 } // while
642 message_done:
643 return ptr;
644 failure:
645 ptr = nullptr;
646 goto message_done;
647 #undef CHK_
648 }
649
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const650 ::uint8_t* ScoringSpecProto_Order::_InternalSerialize(
651 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
652 // @@protoc_insertion_point(serialize_to_array_start:icing.lib.ScoringSpecProto.Order)
653 ::uint32_t cached_has_bits = 0;
654 (void) cached_has_bits;
655
656 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
657 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
658 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
659 }
660 // @@protoc_insertion_point(serialize_to_array_end:icing.lib.ScoringSpecProto.Order)
661 return target;
662 }
663
ByteSizeLong() const664 size_t ScoringSpecProto_Order::ByteSizeLong() const {
665 // @@protoc_insertion_point(message_byte_size_start:icing.lib.ScoringSpecProto.Order)
666 size_t total_size = 0;
667
668 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
669 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
670 }
671 int cached_size = ::_pbi::ToCachedSize(total_size);
672 SetCachedSize(cached_size);
673 return total_size;
674 }
675
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)676 void ScoringSpecProto_Order::CheckTypeAndMergeFrom(
677 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
678 MergeFrom(*::_pbi::DownCast<const ScoringSpecProto_Order*>(
679 &from));
680 }
681
MergeFrom(const ScoringSpecProto_Order & from)682 void ScoringSpecProto_Order::MergeFrom(const ScoringSpecProto_Order& from) {
683 ScoringSpecProto_Order* const _this = this;
684 // @@protoc_insertion_point(class_specific_merge_from_start:icing.lib.ScoringSpecProto.Order)
685 GOOGLE_DCHECK_NE(&from, _this);
686 ::uint32_t cached_has_bits = 0;
687 (void) cached_has_bits;
688
689 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
690 }
691
CopyFrom(const ScoringSpecProto_Order & from)692 void ScoringSpecProto_Order::CopyFrom(const ScoringSpecProto_Order& from) {
693 // @@protoc_insertion_point(class_specific_copy_from_start:icing.lib.ScoringSpecProto.Order)
694 if (&from == this) return;
695 Clear();
696 MergeFrom(from);
697 }
698
IsInitialized() const699 bool ScoringSpecProto_Order::IsInitialized() const {
700 return true;
701 }
702
InternalSwap(ScoringSpecProto_Order * other)703 void ScoringSpecProto_Order::InternalSwap(ScoringSpecProto_Order* other) {
704 using std::swap;
705 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
706 }
707
GetTypeName() const708 std::string ScoringSpecProto_Order::GetTypeName() const {
709 return "icing.lib.ScoringSpecProto.Order";
710 }
711
712
713 // ===================================================================
714
715 class ScoringSpecProto::_Internal {
716 public:
717 using HasBits = decltype(std::declval<ScoringSpecProto>()._impl_._has_bits_);
set_has_rank_by(HasBits * has_bits)718 static void set_has_rank_by(HasBits* has_bits) {
719 (*has_bits)[0] |= 2u;
720 }
set_has_order_by(HasBits * has_bits)721 static void set_has_order_by(HasBits* has_bits) {
722 (*has_bits)[0] |= 4u;
723 }
set_has_advanced_scoring_expression(HasBits * has_bits)724 static void set_has_advanced_scoring_expression(HasBits* has_bits) {
725 (*has_bits)[0] |= 1u;
726 }
727 };
728
ScoringSpecProto(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)729 ScoringSpecProto::ScoringSpecProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
730 bool is_message_owned)
731 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
732 SharedCtor(arena, is_message_owned);
733 // @@protoc_insertion_point(arena_constructor:icing.lib.ScoringSpecProto)
734 }
ScoringSpecProto(const ScoringSpecProto & from)735 ScoringSpecProto::ScoringSpecProto(const ScoringSpecProto& from)
736 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
737 ScoringSpecProto* const _this = this; (void)_this;
738 new (&_impl_) Impl_{
739 decltype(_impl_._has_bits_){from._impl_._has_bits_}
740 , /*decltype(_impl_._cached_size_)*/{}
741 , decltype(_impl_.type_property_weights_){from._impl_.type_property_weights_}
742 , decltype(_impl_.additional_advanced_scoring_expressions_){from._impl_.additional_advanced_scoring_expressions_}
743 , decltype(_impl_.schema_type_alias_map_protos_){from._impl_.schema_type_alias_map_protos_}
744 , decltype(_impl_.scoring_feature_types_enabled_){from._impl_.scoring_feature_types_enabled_}
745 , /*decltype(_impl_._scoring_feature_types_enabled_cached_byte_size_)*/{0}
746 , decltype(_impl_.advanced_scoring_expression_){}
747 , decltype(_impl_.rank_by_){}
748 , decltype(_impl_.order_by_){}};
749
750 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
751 _impl_.advanced_scoring_expression_.InitDefault();
752 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
753 _impl_.advanced_scoring_expression_.Set("", GetArenaForAllocation());
754 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
755 if (from._internal_has_advanced_scoring_expression()) {
756 _this->_impl_.advanced_scoring_expression_.Set(from._internal_advanced_scoring_expression(),
757 _this->GetArenaForAllocation());
758 }
759 ::memcpy(&_impl_.rank_by_, &from._impl_.rank_by_,
760 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.order_by_) -
761 reinterpret_cast<char*>(&_impl_.rank_by_)) + sizeof(_impl_.order_by_));
762 // @@protoc_insertion_point(copy_constructor:icing.lib.ScoringSpecProto)
763 }
764
SharedCtor(::_pb::Arena * arena,bool is_message_owned)765 inline void ScoringSpecProto::SharedCtor(
766 ::_pb::Arena* arena, bool is_message_owned) {
767 (void)arena;
768 (void)is_message_owned;
769 new (&_impl_) Impl_{
770 decltype(_impl_._has_bits_){}
771 , /*decltype(_impl_._cached_size_)*/{}
772 , decltype(_impl_.type_property_weights_){arena}
773 , decltype(_impl_.additional_advanced_scoring_expressions_){arena}
774 , decltype(_impl_.schema_type_alias_map_protos_){arena}
775 , decltype(_impl_.scoring_feature_types_enabled_){arena}
776 , /*decltype(_impl_._scoring_feature_types_enabled_cached_byte_size_)*/{0}
777 , decltype(_impl_.advanced_scoring_expression_){}
778 , decltype(_impl_.rank_by_){0}
779 , decltype(_impl_.order_by_){0}
780 };
781 _impl_.advanced_scoring_expression_.InitDefault();
782 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
783 _impl_.advanced_scoring_expression_.Set("", GetArenaForAllocation());
784 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
785 }
786
~ScoringSpecProto()787 ScoringSpecProto::~ScoringSpecProto() {
788 // @@protoc_insertion_point(destructor:icing.lib.ScoringSpecProto)
789 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
790 (void)arena;
791 return;
792 }
793 SharedDtor();
794 }
795
SharedDtor()796 inline void ScoringSpecProto::SharedDtor() {
797 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
798 _impl_.type_property_weights_.~RepeatedPtrField();
799 _impl_.additional_advanced_scoring_expressions_.~RepeatedPtrField();
800 _impl_.schema_type_alias_map_protos_.~RepeatedPtrField();
801 _impl_.scoring_feature_types_enabled_.~RepeatedField();
802 _impl_.advanced_scoring_expression_.Destroy();
803 }
804
SetCachedSize(int size) const805 void ScoringSpecProto::SetCachedSize(int size) const {
806 _impl_._cached_size_.Set(size);
807 }
808
Clear()809 void ScoringSpecProto::Clear() {
810 // @@protoc_insertion_point(message_clear_start:icing.lib.ScoringSpecProto)
811 ::uint32_t cached_has_bits = 0;
812 // Prevent compiler warnings about cached_has_bits being unused
813 (void) cached_has_bits;
814
815 _impl_.type_property_weights_.Clear();
816 _impl_.additional_advanced_scoring_expressions_.Clear();
817 _impl_.schema_type_alias_map_protos_.Clear();
818 _impl_.scoring_feature_types_enabled_.Clear();
819 cached_has_bits = _impl_._has_bits_[0];
820 if (cached_has_bits & 0x00000001u) {
821 _impl_.advanced_scoring_expression_.ClearNonDefaultToEmpty();
822 }
823 if (cached_has_bits & 0x00000006u) {
824 ::memset(&_impl_.rank_by_, 0, static_cast<size_t>(
825 reinterpret_cast<char*>(&_impl_.order_by_) -
826 reinterpret_cast<char*>(&_impl_.rank_by_)) + sizeof(_impl_.order_by_));
827 }
828 _impl_._has_bits_.Clear();
829 _internal_metadata_.Clear<std::string>();
830 }
831
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)832 const char* ScoringSpecProto::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
833 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
834 _Internal::HasBits has_bits{};
835 while (!ctx->Done(&ptr)) {
836 ::uint32_t tag;
837 ptr = ::_pbi::ReadTag(ptr, &tag);
838 switch (tag >> 3) {
839 // optional .icing.lib.ScoringSpecProto.RankingStrategy.Code rank_by = 1;
840 case 1:
841 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
842 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
843 CHK_(ptr);
844 if (PROTOBUF_PREDICT_TRUE(::icing::lib::ScoringSpecProto_RankingStrategy_Code_IsValid(val))) {
845 _internal_set_rank_by(static_cast<::icing::lib::ScoringSpecProto_RankingStrategy_Code>(val));
846 } else {
847 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
848 }
849 } else {
850 goto handle_unusual;
851 }
852 continue;
853 // optional .icing.lib.ScoringSpecProto.Order.Code order_by = 2;
854 case 2:
855 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
856 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
857 CHK_(ptr);
858 if (PROTOBUF_PREDICT_TRUE(::icing::lib::ScoringSpecProto_Order_Code_IsValid(val))) {
859 _internal_set_order_by(static_cast<::icing::lib::ScoringSpecProto_Order_Code>(val));
860 } else {
861 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
862 }
863 } else {
864 goto handle_unusual;
865 }
866 continue;
867 // repeated .icing.lib.TypePropertyWeights type_property_weights = 3;
868 case 3:
869 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
870 ptr -= 1;
871 do {
872 ptr += 1;
873 ptr = ctx->ParseMessage(_internal_add_type_property_weights(), ptr);
874 CHK_(ptr);
875 if (!ctx->DataAvailable(ptr)) break;
876 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
877 } else {
878 goto handle_unusual;
879 }
880 continue;
881 // optional string advanced_scoring_expression = 4;
882 case 4:
883 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
884 auto str = _internal_mutable_advanced_scoring_expression();
885 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
886 CHK_(ptr);
887 } else {
888 goto handle_unusual;
889 }
890 continue;
891 // repeated string additional_advanced_scoring_expressions = 5;
892 case 5:
893 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
894 ptr -= 1;
895 do {
896 ptr += 1;
897 auto str = _internal_add_additional_advanced_scoring_expressions();
898 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
899 CHK_(ptr);
900 if (!ctx->DataAvailable(ptr)) break;
901 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
902 } else {
903 goto handle_unusual;
904 }
905 continue;
906 // repeated .icing.lib.SchemaTypeAliasMapProto schema_type_alias_map_protos = 6;
907 case 6:
908 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
909 ptr -= 1;
910 do {
911 ptr += 1;
912 ptr = ctx->ParseMessage(_internal_add_schema_type_alias_map_protos(), ptr);
913 CHK_(ptr);
914 if (!ctx->DataAvailable(ptr)) break;
915 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
916 } else {
917 goto handle_unusual;
918 }
919 continue;
920 // repeated .icing.lib.ScoringFeatureType scoring_feature_types_enabled = 7 [packed = true];
921 case 7:
922 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
923 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_scoring_feature_types_enabled(), ptr, ctx, ::icing::lib::ScoringFeatureType_IsValid, &_internal_metadata_, 7);
924 CHK_(ptr);
925 } else if (static_cast<::uint8_t>(tag) == 56) {
926 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
927 CHK_(ptr);
928 if (PROTOBUF_PREDICT_TRUE(::icing::lib::ScoringFeatureType_IsValid(val))) {
929 _internal_add_scoring_feature_types_enabled(static_cast<::icing::lib::ScoringFeatureType>(val));
930 } else {
931 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(7, val, mutable_unknown_fields());
932 }
933 } else {
934 goto handle_unusual;
935 }
936 continue;
937 default:
938 goto handle_unusual;
939 } // switch
940 handle_unusual:
941 if ((tag == 0) || ((tag & 7) == 4)) {
942 CHK_(ptr);
943 ctx->SetLastTag(tag);
944 goto message_done;
945 }
946 ptr = UnknownFieldParse(
947 tag,
948 _internal_metadata_.mutable_unknown_fields<std::string>(),
949 ptr, ctx);
950 CHK_(ptr != nullptr);
951 } // while
952 message_done:
953 _impl_._has_bits_.Or(has_bits);
954 return ptr;
955 failure:
956 ptr = nullptr;
957 goto message_done;
958 #undef CHK_
959 }
960
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const961 ::uint8_t* ScoringSpecProto::_InternalSerialize(
962 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
963 // @@protoc_insertion_point(serialize_to_array_start:icing.lib.ScoringSpecProto)
964 ::uint32_t cached_has_bits = 0;
965 (void) cached_has_bits;
966
967 cached_has_bits = _impl_._has_bits_[0];
968 // optional .icing.lib.ScoringSpecProto.RankingStrategy.Code rank_by = 1;
969 if (cached_has_bits & 0x00000002u) {
970 target = stream->EnsureSpace(target);
971 target = ::_pbi::WireFormatLite::WriteEnumToArray(
972 1, this->_internal_rank_by(), target);
973 }
974
975 // optional .icing.lib.ScoringSpecProto.Order.Code order_by = 2;
976 if (cached_has_bits & 0x00000004u) {
977 target = stream->EnsureSpace(target);
978 target = ::_pbi::WireFormatLite::WriteEnumToArray(
979 2, this->_internal_order_by(), target);
980 }
981
982 // repeated .icing.lib.TypePropertyWeights type_property_weights = 3;
983 for (unsigned i = 0,
984 n = static_cast<unsigned>(this->_internal_type_property_weights_size()); i < n; i++) {
985 const auto& repfield = this->_internal_type_property_weights(i);
986 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
987 InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream);
988 }
989
990 // optional string advanced_scoring_expression = 4;
991 if (cached_has_bits & 0x00000001u) {
992 target = stream->WriteStringMaybeAliased(
993 4, this->_internal_advanced_scoring_expression(), target);
994 }
995
996 // repeated string additional_advanced_scoring_expressions = 5;
997 for (int i = 0, n = this->_internal_additional_advanced_scoring_expressions_size(); i < n; i++) {
998 const auto& s = this->_internal_additional_advanced_scoring_expressions(i);
999 target = stream->WriteString(5, s, target);
1000 }
1001
1002 // repeated .icing.lib.SchemaTypeAliasMapProto schema_type_alias_map_protos = 6;
1003 for (unsigned i = 0,
1004 n = static_cast<unsigned>(this->_internal_schema_type_alias_map_protos_size()); i < n; i++) {
1005 const auto& repfield = this->_internal_schema_type_alias_map_protos(i);
1006 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1007 InternalWriteMessage(6, repfield, repfield.GetCachedSize(), target, stream);
1008 }
1009
1010 // repeated .icing.lib.ScoringFeatureType scoring_feature_types_enabled = 7 [packed = true];
1011 {
1012 int byte_size = _impl_._scoring_feature_types_enabled_cached_byte_size_.load(std::memory_order_relaxed);
1013 if (byte_size > 0) {
1014 target = stream->WriteEnumPacked(
1015 7, _impl_.scoring_feature_types_enabled_, byte_size, target);
1016 }
1017 }
1018
1019 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1020 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1021 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1022 }
1023 // @@protoc_insertion_point(serialize_to_array_end:icing.lib.ScoringSpecProto)
1024 return target;
1025 }
1026
ByteSizeLong() const1027 size_t ScoringSpecProto::ByteSizeLong() const {
1028 // @@protoc_insertion_point(message_byte_size_start:icing.lib.ScoringSpecProto)
1029 size_t total_size = 0;
1030
1031 ::uint32_t cached_has_bits = 0;
1032 // Prevent compiler warnings about cached_has_bits being unused
1033 (void) cached_has_bits;
1034
1035 // repeated .icing.lib.TypePropertyWeights type_property_weights = 3;
1036 total_size += 1UL * this->_internal_type_property_weights_size();
1037 for (const auto& msg : this->_impl_.type_property_weights_) {
1038 total_size +=
1039 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1040 }
1041
1042 // repeated string additional_advanced_scoring_expressions = 5;
1043 total_size += 1 *
1044 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.additional_advanced_scoring_expressions_.size());
1045 for (int i = 0, n = _impl_.additional_advanced_scoring_expressions_.size(); i < n; i++) {
1046 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1047 _impl_.additional_advanced_scoring_expressions_.Get(i));
1048 }
1049
1050 // repeated .icing.lib.SchemaTypeAliasMapProto schema_type_alias_map_protos = 6;
1051 total_size += 1UL * this->_internal_schema_type_alias_map_protos_size();
1052 for (const auto& msg : this->_impl_.schema_type_alias_map_protos_) {
1053 total_size +=
1054 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1055 }
1056
1057 // repeated .icing.lib.ScoringFeatureType scoring_feature_types_enabled = 7 [packed = true];
1058 {
1059 size_t data_size = 0;
1060 unsigned int count = static_cast<unsigned int>(this->_internal_scoring_feature_types_enabled_size());for (unsigned int i = 0; i < count; i++) {
1061 data_size += ::_pbi::WireFormatLite::EnumSize(
1062 this->_internal_scoring_feature_types_enabled(static_cast<int>(i)));
1063 }
1064 if (data_size > 0) {
1065 total_size += 1 +
1066 ::_pbi::WireFormatLite::Int32Size(static_cast<::int32_t>(data_size));
1067 }
1068 int cached_size = ::_pbi::ToCachedSize(data_size);
1069 _impl_._scoring_feature_types_enabled_cached_byte_size_.store(cached_size,
1070 std::memory_order_relaxed);
1071 total_size += data_size;
1072 }
1073
1074 cached_has_bits = _impl_._has_bits_[0];
1075 if (cached_has_bits & 0x00000007u) {
1076 // optional string advanced_scoring_expression = 4;
1077 if (cached_has_bits & 0x00000001u) {
1078 total_size += 1 +
1079 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1080 this->_internal_advanced_scoring_expression());
1081 }
1082
1083 // optional .icing.lib.ScoringSpecProto.RankingStrategy.Code rank_by = 1;
1084 if (cached_has_bits & 0x00000002u) {
1085 total_size += 1 +
1086 ::_pbi::WireFormatLite::EnumSize(this->_internal_rank_by());
1087 }
1088
1089 // optional .icing.lib.ScoringSpecProto.Order.Code order_by = 2;
1090 if (cached_has_bits & 0x00000004u) {
1091 total_size += 1 +
1092 ::_pbi::WireFormatLite::EnumSize(this->_internal_order_by());
1093 }
1094
1095 }
1096 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1097 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1098 }
1099 int cached_size = ::_pbi::ToCachedSize(total_size);
1100 SetCachedSize(cached_size);
1101 return total_size;
1102 }
1103
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1104 void ScoringSpecProto::CheckTypeAndMergeFrom(
1105 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1106 MergeFrom(*::_pbi::DownCast<const ScoringSpecProto*>(
1107 &from));
1108 }
1109
MergeFrom(const ScoringSpecProto & from)1110 void ScoringSpecProto::MergeFrom(const ScoringSpecProto& from) {
1111 ScoringSpecProto* const _this = this;
1112 // @@protoc_insertion_point(class_specific_merge_from_start:icing.lib.ScoringSpecProto)
1113 GOOGLE_DCHECK_NE(&from, _this);
1114 ::uint32_t cached_has_bits = 0;
1115 (void) cached_has_bits;
1116
1117 _this->_impl_.type_property_weights_.MergeFrom(from._impl_.type_property_weights_);
1118 _this->_impl_.additional_advanced_scoring_expressions_.MergeFrom(from._impl_.additional_advanced_scoring_expressions_);
1119 _this->_impl_.schema_type_alias_map_protos_.MergeFrom(from._impl_.schema_type_alias_map_protos_);
1120 _this->_impl_.scoring_feature_types_enabled_.MergeFrom(from._impl_.scoring_feature_types_enabled_);
1121 cached_has_bits = from._impl_._has_bits_[0];
1122 if (cached_has_bits & 0x00000007u) {
1123 if (cached_has_bits & 0x00000001u) {
1124 _this->_internal_set_advanced_scoring_expression(from._internal_advanced_scoring_expression());
1125 }
1126 if (cached_has_bits & 0x00000002u) {
1127 _this->_impl_.rank_by_ = from._impl_.rank_by_;
1128 }
1129 if (cached_has_bits & 0x00000004u) {
1130 _this->_impl_.order_by_ = from._impl_.order_by_;
1131 }
1132 _this->_impl_._has_bits_[0] |= cached_has_bits;
1133 }
1134 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1135 }
1136
CopyFrom(const ScoringSpecProto & from)1137 void ScoringSpecProto::CopyFrom(const ScoringSpecProto& from) {
1138 // @@protoc_insertion_point(class_specific_copy_from_start:icing.lib.ScoringSpecProto)
1139 if (&from == this) return;
1140 Clear();
1141 MergeFrom(from);
1142 }
1143
IsInitialized() const1144 bool ScoringSpecProto::IsInitialized() const {
1145 return true;
1146 }
1147
InternalSwap(ScoringSpecProto * other)1148 void ScoringSpecProto::InternalSwap(ScoringSpecProto* other) {
1149 using std::swap;
1150 auto* lhs_arena = GetArenaForAllocation();
1151 auto* rhs_arena = other->GetArenaForAllocation();
1152 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1153 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1154 _impl_.type_property_weights_.InternalSwap(&other->_impl_.type_property_weights_);
1155 _impl_.additional_advanced_scoring_expressions_.InternalSwap(&other->_impl_.additional_advanced_scoring_expressions_);
1156 _impl_.schema_type_alias_map_protos_.InternalSwap(&other->_impl_.schema_type_alias_map_protos_);
1157 _impl_.scoring_feature_types_enabled_.InternalSwap(&other->_impl_.scoring_feature_types_enabled_);
1158 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1159 &_impl_.advanced_scoring_expression_, lhs_arena,
1160 &other->_impl_.advanced_scoring_expression_, rhs_arena
1161 );
1162 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1163 PROTOBUF_FIELD_OFFSET(ScoringSpecProto, _impl_.order_by_)
1164 + sizeof(ScoringSpecProto::_impl_.order_by_) // NOLINT
1165 - PROTOBUF_FIELD_OFFSET(ScoringSpecProto, _impl_.rank_by_)>(
1166 reinterpret_cast<char*>(&_impl_.rank_by_),
1167 reinterpret_cast<char*>(&other->_impl_.rank_by_));
1168 }
1169
GetTypeName() const1170 std::string ScoringSpecProto::GetTypeName() const {
1171 return "icing.lib.ScoringSpecProto";
1172 }
1173
1174
1175 // ===================================================================
1176
1177 class SuggestionScoringSpecProto_SuggestionRankingStrategy::_Internal {
1178 public:
1179 };
1180
SuggestionScoringSpecProto_SuggestionRankingStrategy(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1181 SuggestionScoringSpecProto_SuggestionRankingStrategy::SuggestionScoringSpecProto_SuggestionRankingStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1182 bool is_message_owned)
1183 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1184 SharedCtor(arena, is_message_owned);
1185 // @@protoc_insertion_point(arena_constructor:icing.lib.SuggestionScoringSpecProto.SuggestionRankingStrategy)
1186 }
SuggestionScoringSpecProto_SuggestionRankingStrategy(const SuggestionScoringSpecProto_SuggestionRankingStrategy & from)1187 SuggestionScoringSpecProto_SuggestionRankingStrategy::SuggestionScoringSpecProto_SuggestionRankingStrategy(const SuggestionScoringSpecProto_SuggestionRankingStrategy& from)
1188 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1189 SuggestionScoringSpecProto_SuggestionRankingStrategy* const _this = this; (void)_this;
1190 new (&_impl_) Impl_{
1191 /*decltype(_impl_._cached_size_)*/{}};
1192
1193 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1194 // @@protoc_insertion_point(copy_constructor:icing.lib.SuggestionScoringSpecProto.SuggestionRankingStrategy)
1195 }
1196
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1197 inline void SuggestionScoringSpecProto_SuggestionRankingStrategy::SharedCtor(
1198 ::_pb::Arena* arena, bool is_message_owned) {
1199 (void)arena;
1200 (void)is_message_owned;
1201 new (&_impl_) Impl_{
1202 /*decltype(_impl_._cached_size_)*/{}
1203 };
1204 }
1205
~SuggestionScoringSpecProto_SuggestionRankingStrategy()1206 SuggestionScoringSpecProto_SuggestionRankingStrategy::~SuggestionScoringSpecProto_SuggestionRankingStrategy() {
1207 // @@protoc_insertion_point(destructor:icing.lib.SuggestionScoringSpecProto.SuggestionRankingStrategy)
1208 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1209 (void)arena;
1210 return;
1211 }
1212 SharedDtor();
1213 }
1214
SharedDtor()1215 inline void SuggestionScoringSpecProto_SuggestionRankingStrategy::SharedDtor() {
1216 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1217 }
1218
SetCachedSize(int size) const1219 void SuggestionScoringSpecProto_SuggestionRankingStrategy::SetCachedSize(int size) const {
1220 _impl_._cached_size_.Set(size);
1221 }
1222
Clear()1223 void SuggestionScoringSpecProto_SuggestionRankingStrategy::Clear() {
1224 // @@protoc_insertion_point(message_clear_start:icing.lib.SuggestionScoringSpecProto.SuggestionRankingStrategy)
1225 ::uint32_t cached_has_bits = 0;
1226 // Prevent compiler warnings about cached_has_bits being unused
1227 (void) cached_has_bits;
1228
1229 _internal_metadata_.Clear<std::string>();
1230 }
1231
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1232 const char* SuggestionScoringSpecProto_SuggestionRankingStrategy::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1233 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1234 while (!ctx->Done(&ptr)) {
1235 ::uint32_t tag;
1236 ptr = ::_pbi::ReadTag(ptr, &tag);
1237 if ((tag == 0) || ((tag & 7) == 4)) {
1238 CHK_(ptr);
1239 ctx->SetLastTag(tag);
1240 goto message_done;
1241 }
1242 ptr = UnknownFieldParse(
1243 tag,
1244 _internal_metadata_.mutable_unknown_fields<std::string>(),
1245 ptr, ctx);
1246 CHK_(ptr != nullptr);
1247 } // while
1248 message_done:
1249 return ptr;
1250 failure:
1251 ptr = nullptr;
1252 goto message_done;
1253 #undef CHK_
1254 }
1255
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1256 ::uint8_t* SuggestionScoringSpecProto_SuggestionRankingStrategy::_InternalSerialize(
1257 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1258 // @@protoc_insertion_point(serialize_to_array_start:icing.lib.SuggestionScoringSpecProto.SuggestionRankingStrategy)
1259 ::uint32_t cached_has_bits = 0;
1260 (void) cached_has_bits;
1261
1262 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1263 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1264 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1265 }
1266 // @@protoc_insertion_point(serialize_to_array_end:icing.lib.SuggestionScoringSpecProto.SuggestionRankingStrategy)
1267 return target;
1268 }
1269
ByteSizeLong() const1270 size_t SuggestionScoringSpecProto_SuggestionRankingStrategy::ByteSizeLong() const {
1271 // @@protoc_insertion_point(message_byte_size_start:icing.lib.SuggestionScoringSpecProto.SuggestionRankingStrategy)
1272 size_t total_size = 0;
1273
1274 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1275 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1276 }
1277 int cached_size = ::_pbi::ToCachedSize(total_size);
1278 SetCachedSize(cached_size);
1279 return total_size;
1280 }
1281
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1282 void SuggestionScoringSpecProto_SuggestionRankingStrategy::CheckTypeAndMergeFrom(
1283 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1284 MergeFrom(*::_pbi::DownCast<const SuggestionScoringSpecProto_SuggestionRankingStrategy*>(
1285 &from));
1286 }
1287
MergeFrom(const SuggestionScoringSpecProto_SuggestionRankingStrategy & from)1288 void SuggestionScoringSpecProto_SuggestionRankingStrategy::MergeFrom(const SuggestionScoringSpecProto_SuggestionRankingStrategy& from) {
1289 SuggestionScoringSpecProto_SuggestionRankingStrategy* const _this = this;
1290 // @@protoc_insertion_point(class_specific_merge_from_start:icing.lib.SuggestionScoringSpecProto.SuggestionRankingStrategy)
1291 GOOGLE_DCHECK_NE(&from, _this);
1292 ::uint32_t cached_has_bits = 0;
1293 (void) cached_has_bits;
1294
1295 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1296 }
1297
CopyFrom(const SuggestionScoringSpecProto_SuggestionRankingStrategy & from)1298 void SuggestionScoringSpecProto_SuggestionRankingStrategy::CopyFrom(const SuggestionScoringSpecProto_SuggestionRankingStrategy& from) {
1299 // @@protoc_insertion_point(class_specific_copy_from_start:icing.lib.SuggestionScoringSpecProto.SuggestionRankingStrategy)
1300 if (&from == this) return;
1301 Clear();
1302 MergeFrom(from);
1303 }
1304
IsInitialized() const1305 bool SuggestionScoringSpecProto_SuggestionRankingStrategy::IsInitialized() const {
1306 return true;
1307 }
1308
InternalSwap(SuggestionScoringSpecProto_SuggestionRankingStrategy * other)1309 void SuggestionScoringSpecProto_SuggestionRankingStrategy::InternalSwap(SuggestionScoringSpecProto_SuggestionRankingStrategy* other) {
1310 using std::swap;
1311 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1312 }
1313
GetTypeName() const1314 std::string SuggestionScoringSpecProto_SuggestionRankingStrategy::GetTypeName() const {
1315 return "icing.lib.SuggestionScoringSpecProto.SuggestionRankingStrategy";
1316 }
1317
1318
1319 // ===================================================================
1320
1321 class SuggestionScoringSpecProto::_Internal {
1322 public:
1323 using HasBits = decltype(std::declval<SuggestionScoringSpecProto>()._impl_._has_bits_);
set_has_scoring_match_type(HasBits * has_bits)1324 static void set_has_scoring_match_type(HasBits* has_bits) {
1325 (*has_bits)[0] |= 1u;
1326 }
set_has_rank_by(HasBits * has_bits)1327 static void set_has_rank_by(HasBits* has_bits) {
1328 (*has_bits)[0] |= 2u;
1329 }
1330 };
1331
SuggestionScoringSpecProto(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1332 SuggestionScoringSpecProto::SuggestionScoringSpecProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1333 bool is_message_owned)
1334 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1335 SharedCtor(arena, is_message_owned);
1336 // @@protoc_insertion_point(arena_constructor:icing.lib.SuggestionScoringSpecProto)
1337 }
SuggestionScoringSpecProto(const SuggestionScoringSpecProto & from)1338 SuggestionScoringSpecProto::SuggestionScoringSpecProto(const SuggestionScoringSpecProto& from)
1339 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1340 SuggestionScoringSpecProto* const _this = this; (void)_this;
1341 new (&_impl_) Impl_{
1342 decltype(_impl_._has_bits_){from._impl_._has_bits_}
1343 , /*decltype(_impl_._cached_size_)*/{}
1344 , decltype(_impl_.scoring_match_type_){}
1345 , decltype(_impl_.rank_by_){}};
1346
1347 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1348 ::memcpy(&_impl_.scoring_match_type_, &from._impl_.scoring_match_type_,
1349 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.rank_by_) -
1350 reinterpret_cast<char*>(&_impl_.scoring_match_type_)) + sizeof(_impl_.rank_by_));
1351 // @@protoc_insertion_point(copy_constructor:icing.lib.SuggestionScoringSpecProto)
1352 }
1353
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1354 inline void SuggestionScoringSpecProto::SharedCtor(
1355 ::_pb::Arena* arena, bool is_message_owned) {
1356 (void)arena;
1357 (void)is_message_owned;
1358 new (&_impl_) Impl_{
1359 decltype(_impl_._has_bits_){}
1360 , /*decltype(_impl_._cached_size_)*/{}
1361 , decltype(_impl_.scoring_match_type_){0}
1362 , decltype(_impl_.rank_by_){0}
1363 };
1364 }
1365
~SuggestionScoringSpecProto()1366 SuggestionScoringSpecProto::~SuggestionScoringSpecProto() {
1367 // @@protoc_insertion_point(destructor:icing.lib.SuggestionScoringSpecProto)
1368 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1369 (void)arena;
1370 return;
1371 }
1372 SharedDtor();
1373 }
1374
SharedDtor()1375 inline void SuggestionScoringSpecProto::SharedDtor() {
1376 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1377 }
1378
SetCachedSize(int size) const1379 void SuggestionScoringSpecProto::SetCachedSize(int size) const {
1380 _impl_._cached_size_.Set(size);
1381 }
1382
Clear()1383 void SuggestionScoringSpecProto::Clear() {
1384 // @@protoc_insertion_point(message_clear_start:icing.lib.SuggestionScoringSpecProto)
1385 ::uint32_t cached_has_bits = 0;
1386 // Prevent compiler warnings about cached_has_bits being unused
1387 (void) cached_has_bits;
1388
1389 cached_has_bits = _impl_._has_bits_[0];
1390 if (cached_has_bits & 0x00000003u) {
1391 ::memset(&_impl_.scoring_match_type_, 0, static_cast<size_t>(
1392 reinterpret_cast<char*>(&_impl_.rank_by_) -
1393 reinterpret_cast<char*>(&_impl_.scoring_match_type_)) + sizeof(_impl_.rank_by_));
1394 }
1395 _impl_._has_bits_.Clear();
1396 _internal_metadata_.Clear<std::string>();
1397 }
1398
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1399 const char* SuggestionScoringSpecProto::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1400 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1401 _Internal::HasBits has_bits{};
1402 while (!ctx->Done(&ptr)) {
1403 ::uint32_t tag;
1404 ptr = ::_pbi::ReadTag(ptr, &tag);
1405 switch (tag >> 3) {
1406 // optional .icing.lib.TermMatchType.Code scoring_match_type = 1;
1407 case 1:
1408 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
1409 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1410 CHK_(ptr);
1411 if (PROTOBUF_PREDICT_TRUE(::icing::lib::TermMatchType_Code_IsValid(val))) {
1412 _internal_set_scoring_match_type(static_cast<::icing::lib::TermMatchType_Code>(val));
1413 } else {
1414 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
1415 }
1416 } else {
1417 goto handle_unusual;
1418 }
1419 continue;
1420 // optional .icing.lib.SuggestionScoringSpecProto.SuggestionRankingStrategy.Code rank_by = 2;
1421 case 2:
1422 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
1423 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1424 CHK_(ptr);
1425 if (PROTOBUF_PREDICT_TRUE(::icing::lib::SuggestionScoringSpecProto_SuggestionRankingStrategy_Code_IsValid(val))) {
1426 _internal_set_rank_by(static_cast<::icing::lib::SuggestionScoringSpecProto_SuggestionRankingStrategy_Code>(val));
1427 } else {
1428 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
1429 }
1430 } else {
1431 goto handle_unusual;
1432 }
1433 continue;
1434 default:
1435 goto handle_unusual;
1436 } // switch
1437 handle_unusual:
1438 if ((tag == 0) || ((tag & 7) == 4)) {
1439 CHK_(ptr);
1440 ctx->SetLastTag(tag);
1441 goto message_done;
1442 }
1443 ptr = UnknownFieldParse(
1444 tag,
1445 _internal_metadata_.mutable_unknown_fields<std::string>(),
1446 ptr, ctx);
1447 CHK_(ptr != nullptr);
1448 } // while
1449 message_done:
1450 _impl_._has_bits_.Or(has_bits);
1451 return ptr;
1452 failure:
1453 ptr = nullptr;
1454 goto message_done;
1455 #undef CHK_
1456 }
1457
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1458 ::uint8_t* SuggestionScoringSpecProto::_InternalSerialize(
1459 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1460 // @@protoc_insertion_point(serialize_to_array_start:icing.lib.SuggestionScoringSpecProto)
1461 ::uint32_t cached_has_bits = 0;
1462 (void) cached_has_bits;
1463
1464 cached_has_bits = _impl_._has_bits_[0];
1465 // optional .icing.lib.TermMatchType.Code scoring_match_type = 1;
1466 if (cached_has_bits & 0x00000001u) {
1467 target = stream->EnsureSpace(target);
1468 target = ::_pbi::WireFormatLite::WriteEnumToArray(
1469 1, this->_internal_scoring_match_type(), target);
1470 }
1471
1472 // optional .icing.lib.SuggestionScoringSpecProto.SuggestionRankingStrategy.Code rank_by = 2;
1473 if (cached_has_bits & 0x00000002u) {
1474 target = stream->EnsureSpace(target);
1475 target = ::_pbi::WireFormatLite::WriteEnumToArray(
1476 2, this->_internal_rank_by(), target);
1477 }
1478
1479 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1480 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1481 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1482 }
1483 // @@protoc_insertion_point(serialize_to_array_end:icing.lib.SuggestionScoringSpecProto)
1484 return target;
1485 }
1486
ByteSizeLong() const1487 size_t SuggestionScoringSpecProto::ByteSizeLong() const {
1488 // @@protoc_insertion_point(message_byte_size_start:icing.lib.SuggestionScoringSpecProto)
1489 size_t total_size = 0;
1490
1491 ::uint32_t cached_has_bits = 0;
1492 // Prevent compiler warnings about cached_has_bits being unused
1493 (void) cached_has_bits;
1494
1495 cached_has_bits = _impl_._has_bits_[0];
1496 if (cached_has_bits & 0x00000003u) {
1497 // optional .icing.lib.TermMatchType.Code scoring_match_type = 1;
1498 if (cached_has_bits & 0x00000001u) {
1499 total_size += 1 +
1500 ::_pbi::WireFormatLite::EnumSize(this->_internal_scoring_match_type());
1501 }
1502
1503 // optional .icing.lib.SuggestionScoringSpecProto.SuggestionRankingStrategy.Code rank_by = 2;
1504 if (cached_has_bits & 0x00000002u) {
1505 total_size += 1 +
1506 ::_pbi::WireFormatLite::EnumSize(this->_internal_rank_by());
1507 }
1508
1509 }
1510 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1511 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1512 }
1513 int cached_size = ::_pbi::ToCachedSize(total_size);
1514 SetCachedSize(cached_size);
1515 return total_size;
1516 }
1517
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1518 void SuggestionScoringSpecProto::CheckTypeAndMergeFrom(
1519 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1520 MergeFrom(*::_pbi::DownCast<const SuggestionScoringSpecProto*>(
1521 &from));
1522 }
1523
MergeFrom(const SuggestionScoringSpecProto & from)1524 void SuggestionScoringSpecProto::MergeFrom(const SuggestionScoringSpecProto& from) {
1525 SuggestionScoringSpecProto* const _this = this;
1526 // @@protoc_insertion_point(class_specific_merge_from_start:icing.lib.SuggestionScoringSpecProto)
1527 GOOGLE_DCHECK_NE(&from, _this);
1528 ::uint32_t cached_has_bits = 0;
1529 (void) cached_has_bits;
1530
1531 cached_has_bits = from._impl_._has_bits_[0];
1532 if (cached_has_bits & 0x00000003u) {
1533 if (cached_has_bits & 0x00000001u) {
1534 _this->_impl_.scoring_match_type_ = from._impl_.scoring_match_type_;
1535 }
1536 if (cached_has_bits & 0x00000002u) {
1537 _this->_impl_.rank_by_ = from._impl_.rank_by_;
1538 }
1539 _this->_impl_._has_bits_[0] |= cached_has_bits;
1540 }
1541 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1542 }
1543
CopyFrom(const SuggestionScoringSpecProto & from)1544 void SuggestionScoringSpecProto::CopyFrom(const SuggestionScoringSpecProto& from) {
1545 // @@protoc_insertion_point(class_specific_copy_from_start:icing.lib.SuggestionScoringSpecProto)
1546 if (&from == this) return;
1547 Clear();
1548 MergeFrom(from);
1549 }
1550
IsInitialized() const1551 bool SuggestionScoringSpecProto::IsInitialized() const {
1552 return true;
1553 }
1554
InternalSwap(SuggestionScoringSpecProto * other)1555 void SuggestionScoringSpecProto::InternalSwap(SuggestionScoringSpecProto* other) {
1556 using std::swap;
1557 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1558 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1559 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1560 PROTOBUF_FIELD_OFFSET(SuggestionScoringSpecProto, _impl_.rank_by_)
1561 + sizeof(SuggestionScoringSpecProto::_impl_.rank_by_) // NOLINT
1562 - PROTOBUF_FIELD_OFFSET(SuggestionScoringSpecProto, _impl_.scoring_match_type_)>(
1563 reinterpret_cast<char*>(&_impl_.scoring_match_type_),
1564 reinterpret_cast<char*>(&other->_impl_.scoring_match_type_));
1565 }
1566
GetTypeName() const1567 std::string SuggestionScoringSpecProto::GetTypeName() const {
1568 return "icing.lib.SuggestionScoringSpecProto";
1569 }
1570
1571
1572 // ===================================================================
1573
1574 class TypePropertyWeights::_Internal {
1575 public:
1576 using HasBits = decltype(std::declval<TypePropertyWeights>()._impl_._has_bits_);
set_has_schema_type(HasBits * has_bits)1577 static void set_has_schema_type(HasBits* has_bits) {
1578 (*has_bits)[0] |= 1u;
1579 }
1580 };
1581
TypePropertyWeights(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1582 TypePropertyWeights::TypePropertyWeights(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1583 bool is_message_owned)
1584 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1585 SharedCtor(arena, is_message_owned);
1586 // @@protoc_insertion_point(arena_constructor:icing.lib.TypePropertyWeights)
1587 }
TypePropertyWeights(const TypePropertyWeights & from)1588 TypePropertyWeights::TypePropertyWeights(const TypePropertyWeights& from)
1589 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1590 TypePropertyWeights* const _this = this; (void)_this;
1591 new (&_impl_) Impl_{
1592 decltype(_impl_._has_bits_){from._impl_._has_bits_}
1593 , /*decltype(_impl_._cached_size_)*/{}
1594 , decltype(_impl_.property_weights_){from._impl_.property_weights_}
1595 , decltype(_impl_.schema_type_){}};
1596
1597 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1598 _impl_.schema_type_.InitDefault();
1599 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1600 _impl_.schema_type_.Set("", GetArenaForAllocation());
1601 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1602 if (from._internal_has_schema_type()) {
1603 _this->_impl_.schema_type_.Set(from._internal_schema_type(),
1604 _this->GetArenaForAllocation());
1605 }
1606 // @@protoc_insertion_point(copy_constructor:icing.lib.TypePropertyWeights)
1607 }
1608
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1609 inline void TypePropertyWeights::SharedCtor(
1610 ::_pb::Arena* arena, bool is_message_owned) {
1611 (void)arena;
1612 (void)is_message_owned;
1613 new (&_impl_) Impl_{
1614 decltype(_impl_._has_bits_){}
1615 , /*decltype(_impl_._cached_size_)*/{}
1616 , decltype(_impl_.property_weights_){arena}
1617 , decltype(_impl_.schema_type_){}
1618 };
1619 _impl_.schema_type_.InitDefault();
1620 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1621 _impl_.schema_type_.Set("", GetArenaForAllocation());
1622 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1623 }
1624
~TypePropertyWeights()1625 TypePropertyWeights::~TypePropertyWeights() {
1626 // @@protoc_insertion_point(destructor:icing.lib.TypePropertyWeights)
1627 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1628 (void)arena;
1629 return;
1630 }
1631 SharedDtor();
1632 }
1633
SharedDtor()1634 inline void TypePropertyWeights::SharedDtor() {
1635 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1636 _impl_.property_weights_.~RepeatedPtrField();
1637 _impl_.schema_type_.Destroy();
1638 }
1639
SetCachedSize(int size) const1640 void TypePropertyWeights::SetCachedSize(int size) const {
1641 _impl_._cached_size_.Set(size);
1642 }
1643
Clear()1644 void TypePropertyWeights::Clear() {
1645 // @@protoc_insertion_point(message_clear_start:icing.lib.TypePropertyWeights)
1646 ::uint32_t cached_has_bits = 0;
1647 // Prevent compiler warnings about cached_has_bits being unused
1648 (void) cached_has_bits;
1649
1650 _impl_.property_weights_.Clear();
1651 cached_has_bits = _impl_._has_bits_[0];
1652 if (cached_has_bits & 0x00000001u) {
1653 _impl_.schema_type_.ClearNonDefaultToEmpty();
1654 }
1655 _impl_._has_bits_.Clear();
1656 _internal_metadata_.Clear<std::string>();
1657 }
1658
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1659 const char* TypePropertyWeights::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1660 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1661 _Internal::HasBits has_bits{};
1662 while (!ctx->Done(&ptr)) {
1663 ::uint32_t tag;
1664 ptr = ::_pbi::ReadTag(ptr, &tag);
1665 switch (tag >> 3) {
1666 // optional string schema_type = 1;
1667 case 1:
1668 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
1669 auto str = _internal_mutable_schema_type();
1670 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
1671 CHK_(ptr);
1672 } else {
1673 goto handle_unusual;
1674 }
1675 continue;
1676 // repeated .icing.lib.PropertyWeight property_weights = 2;
1677 case 2:
1678 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
1679 ptr -= 1;
1680 do {
1681 ptr += 1;
1682 ptr = ctx->ParseMessage(_internal_add_property_weights(), ptr);
1683 CHK_(ptr);
1684 if (!ctx->DataAvailable(ptr)) break;
1685 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
1686 } else {
1687 goto handle_unusual;
1688 }
1689 continue;
1690 default:
1691 goto handle_unusual;
1692 } // switch
1693 handle_unusual:
1694 if ((tag == 0) || ((tag & 7) == 4)) {
1695 CHK_(ptr);
1696 ctx->SetLastTag(tag);
1697 goto message_done;
1698 }
1699 ptr = UnknownFieldParse(
1700 tag,
1701 _internal_metadata_.mutable_unknown_fields<std::string>(),
1702 ptr, ctx);
1703 CHK_(ptr != nullptr);
1704 } // while
1705 message_done:
1706 _impl_._has_bits_.Or(has_bits);
1707 return ptr;
1708 failure:
1709 ptr = nullptr;
1710 goto message_done;
1711 #undef CHK_
1712 }
1713
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1714 ::uint8_t* TypePropertyWeights::_InternalSerialize(
1715 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1716 // @@protoc_insertion_point(serialize_to_array_start:icing.lib.TypePropertyWeights)
1717 ::uint32_t cached_has_bits = 0;
1718 (void) cached_has_bits;
1719
1720 cached_has_bits = _impl_._has_bits_[0];
1721 // optional string schema_type = 1;
1722 if (cached_has_bits & 0x00000001u) {
1723 target = stream->WriteStringMaybeAliased(
1724 1, this->_internal_schema_type(), target);
1725 }
1726
1727 // repeated .icing.lib.PropertyWeight property_weights = 2;
1728 for (unsigned i = 0,
1729 n = static_cast<unsigned>(this->_internal_property_weights_size()); i < n; i++) {
1730 const auto& repfield = this->_internal_property_weights(i);
1731 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1732 InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
1733 }
1734
1735 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1736 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1737 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1738 }
1739 // @@protoc_insertion_point(serialize_to_array_end:icing.lib.TypePropertyWeights)
1740 return target;
1741 }
1742
ByteSizeLong() const1743 size_t TypePropertyWeights::ByteSizeLong() const {
1744 // @@protoc_insertion_point(message_byte_size_start:icing.lib.TypePropertyWeights)
1745 size_t total_size = 0;
1746
1747 ::uint32_t cached_has_bits = 0;
1748 // Prevent compiler warnings about cached_has_bits being unused
1749 (void) cached_has_bits;
1750
1751 // repeated .icing.lib.PropertyWeight property_weights = 2;
1752 total_size += 1UL * this->_internal_property_weights_size();
1753 for (const auto& msg : this->_impl_.property_weights_) {
1754 total_size +=
1755 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1756 }
1757
1758 // optional string schema_type = 1;
1759 cached_has_bits = _impl_._has_bits_[0];
1760 if (cached_has_bits & 0x00000001u) {
1761 total_size += 1 +
1762 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1763 this->_internal_schema_type());
1764 }
1765
1766 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1767 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1768 }
1769 int cached_size = ::_pbi::ToCachedSize(total_size);
1770 SetCachedSize(cached_size);
1771 return total_size;
1772 }
1773
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1774 void TypePropertyWeights::CheckTypeAndMergeFrom(
1775 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1776 MergeFrom(*::_pbi::DownCast<const TypePropertyWeights*>(
1777 &from));
1778 }
1779
MergeFrom(const TypePropertyWeights & from)1780 void TypePropertyWeights::MergeFrom(const TypePropertyWeights& from) {
1781 TypePropertyWeights* const _this = this;
1782 // @@protoc_insertion_point(class_specific_merge_from_start:icing.lib.TypePropertyWeights)
1783 GOOGLE_DCHECK_NE(&from, _this);
1784 ::uint32_t cached_has_bits = 0;
1785 (void) cached_has_bits;
1786
1787 _this->_impl_.property_weights_.MergeFrom(from._impl_.property_weights_);
1788 if (from._internal_has_schema_type()) {
1789 _this->_internal_set_schema_type(from._internal_schema_type());
1790 }
1791 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1792 }
1793
CopyFrom(const TypePropertyWeights & from)1794 void TypePropertyWeights::CopyFrom(const TypePropertyWeights& from) {
1795 // @@protoc_insertion_point(class_specific_copy_from_start:icing.lib.TypePropertyWeights)
1796 if (&from == this) return;
1797 Clear();
1798 MergeFrom(from);
1799 }
1800
IsInitialized() const1801 bool TypePropertyWeights::IsInitialized() const {
1802 return true;
1803 }
1804
InternalSwap(TypePropertyWeights * other)1805 void TypePropertyWeights::InternalSwap(TypePropertyWeights* other) {
1806 using std::swap;
1807 auto* lhs_arena = GetArenaForAllocation();
1808 auto* rhs_arena = other->GetArenaForAllocation();
1809 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1810 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1811 _impl_.property_weights_.InternalSwap(&other->_impl_.property_weights_);
1812 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1813 &_impl_.schema_type_, lhs_arena,
1814 &other->_impl_.schema_type_, rhs_arena
1815 );
1816 }
1817
GetTypeName() const1818 std::string TypePropertyWeights::GetTypeName() const {
1819 return "icing.lib.TypePropertyWeights";
1820 }
1821
1822
1823 // ===================================================================
1824
1825 class PropertyWeight::_Internal {
1826 public:
1827 using HasBits = decltype(std::declval<PropertyWeight>()._impl_._has_bits_);
set_has_path(HasBits * has_bits)1828 static void set_has_path(HasBits* has_bits) {
1829 (*has_bits)[0] |= 1u;
1830 }
set_has_weight(HasBits * has_bits)1831 static void set_has_weight(HasBits* has_bits) {
1832 (*has_bits)[0] |= 2u;
1833 }
1834 };
1835
PropertyWeight(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1836 PropertyWeight::PropertyWeight(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1837 bool is_message_owned)
1838 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1839 SharedCtor(arena, is_message_owned);
1840 // @@protoc_insertion_point(arena_constructor:icing.lib.PropertyWeight)
1841 }
PropertyWeight(const PropertyWeight & from)1842 PropertyWeight::PropertyWeight(const PropertyWeight& from)
1843 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1844 PropertyWeight* const _this = this; (void)_this;
1845 new (&_impl_) Impl_{
1846 decltype(_impl_._has_bits_){from._impl_._has_bits_}
1847 , /*decltype(_impl_._cached_size_)*/{}
1848 , decltype(_impl_.path_){}
1849 , decltype(_impl_.weight_){}};
1850
1851 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1852 _impl_.path_.InitDefault();
1853 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1854 _impl_.path_.Set("", GetArenaForAllocation());
1855 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1856 if (from._internal_has_path()) {
1857 _this->_impl_.path_.Set(from._internal_path(),
1858 _this->GetArenaForAllocation());
1859 }
1860 _this->_impl_.weight_ = from._impl_.weight_;
1861 // @@protoc_insertion_point(copy_constructor:icing.lib.PropertyWeight)
1862 }
1863
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1864 inline void PropertyWeight::SharedCtor(
1865 ::_pb::Arena* arena, bool is_message_owned) {
1866 (void)arena;
1867 (void)is_message_owned;
1868 new (&_impl_) Impl_{
1869 decltype(_impl_._has_bits_){}
1870 , /*decltype(_impl_._cached_size_)*/{}
1871 , decltype(_impl_.path_){}
1872 , decltype(_impl_.weight_){0}
1873 };
1874 _impl_.path_.InitDefault();
1875 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1876 _impl_.path_.Set("", GetArenaForAllocation());
1877 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1878 }
1879
~PropertyWeight()1880 PropertyWeight::~PropertyWeight() {
1881 // @@protoc_insertion_point(destructor:icing.lib.PropertyWeight)
1882 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1883 (void)arena;
1884 return;
1885 }
1886 SharedDtor();
1887 }
1888
SharedDtor()1889 inline void PropertyWeight::SharedDtor() {
1890 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1891 _impl_.path_.Destroy();
1892 }
1893
SetCachedSize(int size) const1894 void PropertyWeight::SetCachedSize(int size) const {
1895 _impl_._cached_size_.Set(size);
1896 }
1897
Clear()1898 void PropertyWeight::Clear() {
1899 // @@protoc_insertion_point(message_clear_start:icing.lib.PropertyWeight)
1900 ::uint32_t cached_has_bits = 0;
1901 // Prevent compiler warnings about cached_has_bits being unused
1902 (void) cached_has_bits;
1903
1904 cached_has_bits = _impl_._has_bits_[0];
1905 if (cached_has_bits & 0x00000001u) {
1906 _impl_.path_.ClearNonDefaultToEmpty();
1907 }
1908 _impl_.weight_ = 0;
1909 _impl_._has_bits_.Clear();
1910 _internal_metadata_.Clear<std::string>();
1911 }
1912
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1913 const char* PropertyWeight::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1914 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1915 _Internal::HasBits has_bits{};
1916 while (!ctx->Done(&ptr)) {
1917 ::uint32_t tag;
1918 ptr = ::_pbi::ReadTag(ptr, &tag);
1919 switch (tag >> 3) {
1920 // optional string path = 1;
1921 case 1:
1922 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
1923 auto str = _internal_mutable_path();
1924 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
1925 CHK_(ptr);
1926 } else {
1927 goto handle_unusual;
1928 }
1929 continue;
1930 // optional double weight = 2;
1931 case 2:
1932 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 17)) {
1933 _Internal::set_has_weight(&has_bits);
1934 _impl_.weight_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
1935 ptr += sizeof(double);
1936 } else {
1937 goto handle_unusual;
1938 }
1939 continue;
1940 default:
1941 goto handle_unusual;
1942 } // switch
1943 handle_unusual:
1944 if ((tag == 0) || ((tag & 7) == 4)) {
1945 CHK_(ptr);
1946 ctx->SetLastTag(tag);
1947 goto message_done;
1948 }
1949 ptr = UnknownFieldParse(
1950 tag,
1951 _internal_metadata_.mutable_unknown_fields<std::string>(),
1952 ptr, ctx);
1953 CHK_(ptr != nullptr);
1954 } // while
1955 message_done:
1956 _impl_._has_bits_.Or(has_bits);
1957 return ptr;
1958 failure:
1959 ptr = nullptr;
1960 goto message_done;
1961 #undef CHK_
1962 }
1963
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1964 ::uint8_t* PropertyWeight::_InternalSerialize(
1965 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1966 // @@protoc_insertion_point(serialize_to_array_start:icing.lib.PropertyWeight)
1967 ::uint32_t cached_has_bits = 0;
1968 (void) cached_has_bits;
1969
1970 cached_has_bits = _impl_._has_bits_[0];
1971 // optional string path = 1;
1972 if (cached_has_bits & 0x00000001u) {
1973 target = stream->WriteStringMaybeAliased(
1974 1, this->_internal_path(), target);
1975 }
1976
1977 // optional double weight = 2;
1978 if (cached_has_bits & 0x00000002u) {
1979 target = stream->EnsureSpace(target);
1980 target = ::_pbi::WireFormatLite::WriteDoubleToArray(2, this->_internal_weight(), target);
1981 }
1982
1983 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1984 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1985 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1986 }
1987 // @@protoc_insertion_point(serialize_to_array_end:icing.lib.PropertyWeight)
1988 return target;
1989 }
1990
ByteSizeLong() const1991 size_t PropertyWeight::ByteSizeLong() const {
1992 // @@protoc_insertion_point(message_byte_size_start:icing.lib.PropertyWeight)
1993 size_t total_size = 0;
1994
1995 ::uint32_t cached_has_bits = 0;
1996 // Prevent compiler warnings about cached_has_bits being unused
1997 (void) cached_has_bits;
1998
1999 cached_has_bits = _impl_._has_bits_[0];
2000 if (cached_has_bits & 0x00000003u) {
2001 // optional string path = 1;
2002 if (cached_has_bits & 0x00000001u) {
2003 total_size += 1 +
2004 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2005 this->_internal_path());
2006 }
2007
2008 // optional double weight = 2;
2009 if (cached_has_bits & 0x00000002u) {
2010 total_size += 1 + 8;
2011 }
2012
2013 }
2014 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
2015 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
2016 }
2017 int cached_size = ::_pbi::ToCachedSize(total_size);
2018 SetCachedSize(cached_size);
2019 return total_size;
2020 }
2021
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)2022 void PropertyWeight::CheckTypeAndMergeFrom(
2023 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
2024 MergeFrom(*::_pbi::DownCast<const PropertyWeight*>(
2025 &from));
2026 }
2027
MergeFrom(const PropertyWeight & from)2028 void PropertyWeight::MergeFrom(const PropertyWeight& from) {
2029 PropertyWeight* const _this = this;
2030 // @@protoc_insertion_point(class_specific_merge_from_start:icing.lib.PropertyWeight)
2031 GOOGLE_DCHECK_NE(&from, _this);
2032 ::uint32_t cached_has_bits = 0;
2033 (void) cached_has_bits;
2034
2035 cached_has_bits = from._impl_._has_bits_[0];
2036 if (cached_has_bits & 0x00000003u) {
2037 if (cached_has_bits & 0x00000001u) {
2038 _this->_internal_set_path(from._internal_path());
2039 }
2040 if (cached_has_bits & 0x00000002u) {
2041 _this->_impl_.weight_ = from._impl_.weight_;
2042 }
2043 _this->_impl_._has_bits_[0] |= cached_has_bits;
2044 }
2045 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
2046 }
2047
CopyFrom(const PropertyWeight & from)2048 void PropertyWeight::CopyFrom(const PropertyWeight& from) {
2049 // @@protoc_insertion_point(class_specific_copy_from_start:icing.lib.PropertyWeight)
2050 if (&from == this) return;
2051 Clear();
2052 MergeFrom(from);
2053 }
2054
IsInitialized() const2055 bool PropertyWeight::IsInitialized() const {
2056 return true;
2057 }
2058
InternalSwap(PropertyWeight * other)2059 void PropertyWeight::InternalSwap(PropertyWeight* other) {
2060 using std::swap;
2061 auto* lhs_arena = GetArenaForAllocation();
2062 auto* rhs_arena = other->GetArenaForAllocation();
2063 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
2064 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
2065 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
2066 &_impl_.path_, lhs_arena,
2067 &other->_impl_.path_, rhs_arena
2068 );
2069 swap(_impl_.weight_, other->_impl_.weight_);
2070 }
2071
GetTypeName() const2072 std::string PropertyWeight::GetTypeName() const {
2073 return "icing.lib.PropertyWeight";
2074 }
2075
2076
2077 // ===================================================================
2078
2079 class SchemaTypeAliasMapProto::_Internal {
2080 public:
2081 using HasBits = decltype(std::declval<SchemaTypeAliasMapProto>()._impl_._has_bits_);
set_has_alias_schema_type(HasBits * has_bits)2082 static void set_has_alias_schema_type(HasBits* has_bits) {
2083 (*has_bits)[0] |= 1u;
2084 }
2085 };
2086
SchemaTypeAliasMapProto(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)2087 SchemaTypeAliasMapProto::SchemaTypeAliasMapProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
2088 bool is_message_owned)
2089 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
2090 SharedCtor(arena, is_message_owned);
2091 // @@protoc_insertion_point(arena_constructor:icing.lib.SchemaTypeAliasMapProto)
2092 }
SchemaTypeAliasMapProto(const SchemaTypeAliasMapProto & from)2093 SchemaTypeAliasMapProto::SchemaTypeAliasMapProto(const SchemaTypeAliasMapProto& from)
2094 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
2095 SchemaTypeAliasMapProto* const _this = this; (void)_this;
2096 new (&_impl_) Impl_{
2097 decltype(_impl_._has_bits_){from._impl_._has_bits_}
2098 , /*decltype(_impl_._cached_size_)*/{}
2099 , decltype(_impl_.schema_types_){from._impl_.schema_types_}
2100 , decltype(_impl_.alias_schema_type_){}};
2101
2102 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
2103 _impl_.alias_schema_type_.InitDefault();
2104 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
2105 _impl_.alias_schema_type_.Set("", GetArenaForAllocation());
2106 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
2107 if (from._internal_has_alias_schema_type()) {
2108 _this->_impl_.alias_schema_type_.Set(from._internal_alias_schema_type(),
2109 _this->GetArenaForAllocation());
2110 }
2111 // @@protoc_insertion_point(copy_constructor:icing.lib.SchemaTypeAliasMapProto)
2112 }
2113
SharedCtor(::_pb::Arena * arena,bool is_message_owned)2114 inline void SchemaTypeAliasMapProto::SharedCtor(
2115 ::_pb::Arena* arena, bool is_message_owned) {
2116 (void)arena;
2117 (void)is_message_owned;
2118 new (&_impl_) Impl_{
2119 decltype(_impl_._has_bits_){}
2120 , /*decltype(_impl_._cached_size_)*/{}
2121 , decltype(_impl_.schema_types_){arena}
2122 , decltype(_impl_.alias_schema_type_){}
2123 };
2124 _impl_.alias_schema_type_.InitDefault();
2125 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
2126 _impl_.alias_schema_type_.Set("", GetArenaForAllocation());
2127 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
2128 }
2129
~SchemaTypeAliasMapProto()2130 SchemaTypeAliasMapProto::~SchemaTypeAliasMapProto() {
2131 // @@protoc_insertion_point(destructor:icing.lib.SchemaTypeAliasMapProto)
2132 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
2133 (void)arena;
2134 return;
2135 }
2136 SharedDtor();
2137 }
2138
SharedDtor()2139 inline void SchemaTypeAliasMapProto::SharedDtor() {
2140 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
2141 _impl_.schema_types_.~RepeatedPtrField();
2142 _impl_.alias_schema_type_.Destroy();
2143 }
2144
SetCachedSize(int size) const2145 void SchemaTypeAliasMapProto::SetCachedSize(int size) const {
2146 _impl_._cached_size_.Set(size);
2147 }
2148
Clear()2149 void SchemaTypeAliasMapProto::Clear() {
2150 // @@protoc_insertion_point(message_clear_start:icing.lib.SchemaTypeAliasMapProto)
2151 ::uint32_t cached_has_bits = 0;
2152 // Prevent compiler warnings about cached_has_bits being unused
2153 (void) cached_has_bits;
2154
2155 _impl_.schema_types_.Clear();
2156 cached_has_bits = _impl_._has_bits_[0];
2157 if (cached_has_bits & 0x00000001u) {
2158 _impl_.alias_schema_type_.ClearNonDefaultToEmpty();
2159 }
2160 _impl_._has_bits_.Clear();
2161 _internal_metadata_.Clear<std::string>();
2162 }
2163
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)2164 const char* SchemaTypeAliasMapProto::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
2165 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
2166 _Internal::HasBits has_bits{};
2167 while (!ctx->Done(&ptr)) {
2168 ::uint32_t tag;
2169 ptr = ::_pbi::ReadTag(ptr, &tag);
2170 switch (tag >> 3) {
2171 // optional string alias_schema_type = 1;
2172 case 1:
2173 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
2174 auto str = _internal_mutable_alias_schema_type();
2175 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
2176 CHK_(ptr);
2177 } else {
2178 goto handle_unusual;
2179 }
2180 continue;
2181 // repeated string schema_types = 2;
2182 case 2:
2183 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
2184 ptr -= 1;
2185 do {
2186 ptr += 1;
2187 auto str = _internal_add_schema_types();
2188 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
2189 CHK_(ptr);
2190 if (!ctx->DataAvailable(ptr)) break;
2191 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
2192 } else {
2193 goto handle_unusual;
2194 }
2195 continue;
2196 default:
2197 goto handle_unusual;
2198 } // switch
2199 handle_unusual:
2200 if ((tag == 0) || ((tag & 7) == 4)) {
2201 CHK_(ptr);
2202 ctx->SetLastTag(tag);
2203 goto message_done;
2204 }
2205 ptr = UnknownFieldParse(
2206 tag,
2207 _internal_metadata_.mutable_unknown_fields<std::string>(),
2208 ptr, ctx);
2209 CHK_(ptr != nullptr);
2210 } // while
2211 message_done:
2212 _impl_._has_bits_.Or(has_bits);
2213 return ptr;
2214 failure:
2215 ptr = nullptr;
2216 goto message_done;
2217 #undef CHK_
2218 }
2219
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const2220 ::uint8_t* SchemaTypeAliasMapProto::_InternalSerialize(
2221 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
2222 // @@protoc_insertion_point(serialize_to_array_start:icing.lib.SchemaTypeAliasMapProto)
2223 ::uint32_t cached_has_bits = 0;
2224 (void) cached_has_bits;
2225
2226 cached_has_bits = _impl_._has_bits_[0];
2227 // optional string alias_schema_type = 1;
2228 if (cached_has_bits & 0x00000001u) {
2229 target = stream->WriteStringMaybeAliased(
2230 1, this->_internal_alias_schema_type(), target);
2231 }
2232
2233 // repeated string schema_types = 2;
2234 for (int i = 0, n = this->_internal_schema_types_size(); i < n; i++) {
2235 const auto& s = this->_internal_schema_types(i);
2236 target = stream->WriteString(2, s, target);
2237 }
2238
2239 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
2240 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
2241 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
2242 }
2243 // @@protoc_insertion_point(serialize_to_array_end:icing.lib.SchemaTypeAliasMapProto)
2244 return target;
2245 }
2246
ByteSizeLong() const2247 size_t SchemaTypeAliasMapProto::ByteSizeLong() const {
2248 // @@protoc_insertion_point(message_byte_size_start:icing.lib.SchemaTypeAliasMapProto)
2249 size_t total_size = 0;
2250
2251 ::uint32_t cached_has_bits = 0;
2252 // Prevent compiler warnings about cached_has_bits being unused
2253 (void) cached_has_bits;
2254
2255 // repeated string schema_types = 2;
2256 total_size += 1 *
2257 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.schema_types_.size());
2258 for (int i = 0, n = _impl_.schema_types_.size(); i < n; i++) {
2259 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2260 _impl_.schema_types_.Get(i));
2261 }
2262
2263 // optional string alias_schema_type = 1;
2264 cached_has_bits = _impl_._has_bits_[0];
2265 if (cached_has_bits & 0x00000001u) {
2266 total_size += 1 +
2267 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2268 this->_internal_alias_schema_type());
2269 }
2270
2271 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
2272 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
2273 }
2274 int cached_size = ::_pbi::ToCachedSize(total_size);
2275 SetCachedSize(cached_size);
2276 return total_size;
2277 }
2278
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)2279 void SchemaTypeAliasMapProto::CheckTypeAndMergeFrom(
2280 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
2281 MergeFrom(*::_pbi::DownCast<const SchemaTypeAliasMapProto*>(
2282 &from));
2283 }
2284
MergeFrom(const SchemaTypeAliasMapProto & from)2285 void SchemaTypeAliasMapProto::MergeFrom(const SchemaTypeAliasMapProto& from) {
2286 SchemaTypeAliasMapProto* const _this = this;
2287 // @@protoc_insertion_point(class_specific_merge_from_start:icing.lib.SchemaTypeAliasMapProto)
2288 GOOGLE_DCHECK_NE(&from, _this);
2289 ::uint32_t cached_has_bits = 0;
2290 (void) cached_has_bits;
2291
2292 _this->_impl_.schema_types_.MergeFrom(from._impl_.schema_types_);
2293 if (from._internal_has_alias_schema_type()) {
2294 _this->_internal_set_alias_schema_type(from._internal_alias_schema_type());
2295 }
2296 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
2297 }
2298
CopyFrom(const SchemaTypeAliasMapProto & from)2299 void SchemaTypeAliasMapProto::CopyFrom(const SchemaTypeAliasMapProto& from) {
2300 // @@protoc_insertion_point(class_specific_copy_from_start:icing.lib.SchemaTypeAliasMapProto)
2301 if (&from == this) return;
2302 Clear();
2303 MergeFrom(from);
2304 }
2305
IsInitialized() const2306 bool SchemaTypeAliasMapProto::IsInitialized() const {
2307 return true;
2308 }
2309
InternalSwap(SchemaTypeAliasMapProto * other)2310 void SchemaTypeAliasMapProto::InternalSwap(SchemaTypeAliasMapProto* other) {
2311 using std::swap;
2312 auto* lhs_arena = GetArenaForAllocation();
2313 auto* rhs_arena = other->GetArenaForAllocation();
2314 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
2315 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
2316 _impl_.schema_types_.InternalSwap(&other->_impl_.schema_types_);
2317 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
2318 &_impl_.alias_schema_type_, lhs_arena,
2319 &other->_impl_.alias_schema_type_, rhs_arena
2320 );
2321 }
2322
GetTypeName() const2323 std::string SchemaTypeAliasMapProto::GetTypeName() const {
2324 return "icing.lib.SchemaTypeAliasMapProto";
2325 }
2326
2327
2328 // @@protoc_insertion_point(namespace_scope)
2329 } // namespace lib
2330 } // namespace icing
2331 PROTOBUF_NAMESPACE_OPEN
2332 template<> PROTOBUF_NOINLINE ::icing::lib::ScoringSpecProto_RankingStrategy*
CreateMaybeMessage(Arena * arena)2333 Arena::CreateMaybeMessage< ::icing::lib::ScoringSpecProto_RankingStrategy >(Arena* arena) {
2334 return Arena::CreateMessageInternal< ::icing::lib::ScoringSpecProto_RankingStrategy >(arena);
2335 }
2336 template<> PROTOBUF_NOINLINE ::icing::lib::ScoringSpecProto_Order*
CreateMaybeMessage(Arena * arena)2337 Arena::CreateMaybeMessage< ::icing::lib::ScoringSpecProto_Order >(Arena* arena) {
2338 return Arena::CreateMessageInternal< ::icing::lib::ScoringSpecProto_Order >(arena);
2339 }
2340 template<> PROTOBUF_NOINLINE ::icing::lib::ScoringSpecProto*
CreateMaybeMessage(Arena * arena)2341 Arena::CreateMaybeMessage< ::icing::lib::ScoringSpecProto >(Arena* arena) {
2342 return Arena::CreateMessageInternal< ::icing::lib::ScoringSpecProto >(arena);
2343 }
2344 template<> PROTOBUF_NOINLINE ::icing::lib::SuggestionScoringSpecProto_SuggestionRankingStrategy*
CreateMaybeMessage(Arena * arena)2345 Arena::CreateMaybeMessage< ::icing::lib::SuggestionScoringSpecProto_SuggestionRankingStrategy >(Arena* arena) {
2346 return Arena::CreateMessageInternal< ::icing::lib::SuggestionScoringSpecProto_SuggestionRankingStrategy >(arena);
2347 }
2348 template<> PROTOBUF_NOINLINE ::icing::lib::SuggestionScoringSpecProto*
CreateMaybeMessage(Arena * arena)2349 Arena::CreateMaybeMessage< ::icing::lib::SuggestionScoringSpecProto >(Arena* arena) {
2350 return Arena::CreateMessageInternal< ::icing::lib::SuggestionScoringSpecProto >(arena);
2351 }
2352 template<> PROTOBUF_NOINLINE ::icing::lib::TypePropertyWeights*
CreateMaybeMessage(Arena * arena)2353 Arena::CreateMaybeMessage< ::icing::lib::TypePropertyWeights >(Arena* arena) {
2354 return Arena::CreateMessageInternal< ::icing::lib::TypePropertyWeights >(arena);
2355 }
2356 template<> PROTOBUF_NOINLINE ::icing::lib::PropertyWeight*
CreateMaybeMessage(Arena * arena)2357 Arena::CreateMaybeMessage< ::icing::lib::PropertyWeight >(Arena* arena) {
2358 return Arena::CreateMessageInternal< ::icing::lib::PropertyWeight >(arena);
2359 }
2360 template<> PROTOBUF_NOINLINE ::icing::lib::SchemaTypeAliasMapProto*
CreateMaybeMessage(Arena * arena)2361 Arena::CreateMaybeMessage< ::icing::lib::SchemaTypeAliasMapProto >(Arena* arena) {
2362 return Arena::CreateMessageInternal< ::icing::lib::SchemaTypeAliasMapProto >(arena);
2363 }
2364 PROTOBUF_NAMESPACE_CLOSE
2365
2366 // @@protoc_insertion_point(global_scope)
2367 #include <google/protobuf/port_undef.inc>
2368