/proc/self/cwd/common/values/value_variant.h
Line | Count | Source |
1 | | // Copyright 2025 Google LLC |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | | // you may not use this file except in compliance with the License. |
5 | | // You may obtain a copy of the License at |
6 | | // |
7 | | // https://www.apache.org/licenses/LICENSE-2.0 |
8 | | // |
9 | | // Unless required by applicable law or agreed to in writing, software |
10 | | // distributed under the License is distributed on an "AS IS" BASIS, |
11 | | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | | // See the License for the specific language governing permissions and |
13 | | // limitations under the License. |
14 | | |
15 | | #ifndef THIRD_PARTY_CEL_CPP_COMMON_VALUES_VALUE_VARIANT_H_ |
16 | | #define THIRD_PARTY_CEL_CPP_COMMON_VALUES_VALUE_VARIANT_H_ |
17 | | |
18 | | #include <cstddef> |
19 | | #include <cstdint> |
20 | | #include <cstring> |
21 | | #include <memory> |
22 | | #include <new> |
23 | | #include <type_traits> |
24 | | #include <utility> |
25 | | |
26 | | #include "absl/base/attributes.h" |
27 | | #include "absl/base/nullability.h" |
28 | | #include "absl/log/absl_check.h" |
29 | | #include "absl/meta/type_traits.h" |
30 | | #include "absl/utility/utility.h" |
31 | | #include "common/arena.h" |
32 | | #include "common/value_kind.h" |
33 | | #include "common/values/bool_value.h" |
34 | | #include "common/values/bytes_value.h" |
35 | | #include "common/values/custom_list_value.h" |
36 | | #include "common/values/custom_map_value.h" |
37 | | #include "common/values/custom_struct_value.h" |
38 | | #include "common/values/double_value.h" |
39 | | #include "common/values/duration_value.h" |
40 | | #include "common/values/error_value.h" |
41 | | #include "common/values/int_value.h" |
42 | | #include "common/values/legacy_list_value.h" |
43 | | #include "common/values/legacy_map_value.h" |
44 | | #include "common/values/legacy_struct_value.h" |
45 | | #include "common/values/list_value.h" |
46 | | #include "common/values/map_value.h" |
47 | | #include "common/values/null_value.h" |
48 | | #include "common/values/opaque_value.h" |
49 | | #include "common/values/parsed_json_list_value.h" |
50 | | #include "common/values/parsed_json_map_value.h" |
51 | | #include "common/values/parsed_map_field_value.h" |
52 | | #include "common/values/parsed_message_value.h" |
53 | | #include "common/values/parsed_repeated_field_value.h" |
54 | | #include "common/values/string_value.h" |
55 | | #include "common/values/timestamp_value.h" |
56 | | #include "common/values/type_value.h" |
57 | | #include "common/values/uint_value.h" |
58 | | #include "common/values/unknown_value.h" |
59 | | #include "common/values/values.h" |
60 | | |
61 | | namespace cel { |
62 | | |
63 | | class Value; |
64 | | |
65 | | namespace common_internal { |
66 | | |
67 | | // Used by ValueVariant to indicate the active alternative. |
68 | | enum class ValueIndex : uint8_t { |
69 | | kNull = 0, |
70 | | kBool, |
71 | | kInt, |
72 | | kUint, |
73 | | kDouble, |
74 | | kDuration, |
75 | | kTimestamp, |
76 | | kType, |
77 | | kLegacyList, |
78 | | kParsedJsonList, |
79 | | kParsedRepeatedField, |
80 | | kCustomList, |
81 | | kLegacyMap, |
82 | | kParsedJsonMap, |
83 | | kParsedMapField, |
84 | | kCustomMap, |
85 | | kLegacyStruct, |
86 | | kParsedMessage, |
87 | | kCustomStruct, |
88 | | kOpaque, |
89 | | |
90 | | // Keep non-trivial alternatives together to aid in compiling optimizations. |
91 | | kBytes, |
92 | | kString, |
93 | | kError, |
94 | | kUnknown, |
95 | | }; |
96 | | |
97 | | // Used by ValueVariant to indicate pre-computed behaviors. |
98 | | enum class ValueFlags : uint32_t { |
99 | | kNone = 0, |
100 | | kNonTrivial = 1, |
101 | | }; |
102 | | |
103 | | ABSL_ATTRIBUTE_ALWAYS_INLINE inline constexpr ValueFlags operator&( |
104 | 4.30M | ValueFlags lhs, ValueFlags rhs) { |
105 | 4.30M | return static_cast<ValueFlags>( |
106 | 4.30M | static_cast<std::underlying_type_t<ValueFlags>>(lhs) & |
107 | 4.30M | static_cast<std::underlying_type_t<ValueFlags>>(rhs)); |
108 | 4.30M | } |
109 | | |
110 | | // Traits specialized by each alternative. |
111 | | // |
112 | | // ValueIndex ValueAlternative<T>::kIndex |
113 | | // |
114 | | // Indicates the alternative index corresponding to T. |
115 | | // |
116 | | // ValueKind ValueAlternative<T>::kKind |
117 | | // |
118 | | // Indicatates the kind corresponding to T. |
119 | | // |
120 | | // bool ValueAlternative<T>::kAlwaysTrivial |
121 | | // |
122 | | // True if T is trivially_copyable, false otherwise. |
123 | | // |
124 | | // ValueFlags ValueAlternative<T>::Flags(const T* absl_nonnull ) |
125 | | // |
126 | | // Returns the flags for the corresponding instance of T. |
127 | | template <typename T> |
128 | | struct ValueAlternative; |
129 | | |
130 | | template <> |
131 | | struct ValueAlternative<NullValue> { |
132 | | static constexpr ValueIndex kIndex = ValueIndex::kNull; |
133 | | static constexpr ValueKind kKind = NullValue::kKind; |
134 | | static constexpr bool kAlwaysTrivial = true; |
135 | | |
136 | 5.73k | static constexpr ValueFlags Flags(const NullValue* absl_nonnull) { |
137 | 5.73k | return ValueFlags::kNone; |
138 | 5.73k | } |
139 | | }; |
140 | | |
141 | | template <> |
142 | | struct ValueAlternative<BoolValue> { |
143 | | static constexpr ValueIndex kIndex = ValueIndex::kBool; |
144 | | static constexpr ValueKind kKind = BoolValue::kKind; |
145 | | static constexpr bool kAlwaysTrivial = true; |
146 | | |
147 | 32.8k | static constexpr ValueFlags Flags(const BoolValue* absl_nonnull) { |
148 | 32.8k | return ValueFlags::kNone; |
149 | 32.8k | } |
150 | | }; |
151 | | |
152 | | template <> |
153 | | struct ValueAlternative<IntValue> { |
154 | | static constexpr ValueIndex kIndex = ValueIndex::kInt; |
155 | | static constexpr ValueKind kKind = IntValue::kKind; |
156 | | static constexpr bool kAlwaysTrivial = true; |
157 | | |
158 | 91.7k | static constexpr ValueFlags Flags(const IntValue* absl_nonnull) { |
159 | 91.7k | return ValueFlags::kNone; |
160 | 91.7k | } |
161 | | }; |
162 | | |
163 | | template <> |
164 | | struct ValueAlternative<UintValue> { |
165 | | static constexpr ValueIndex kIndex = ValueIndex::kUint; |
166 | | static constexpr ValueKind kKind = UintValue::kKind; |
167 | | static constexpr bool kAlwaysTrivial = true; |
168 | | |
169 | 19.6k | static constexpr ValueFlags Flags(const UintValue* absl_nonnull) { |
170 | 19.6k | return ValueFlags::kNone; |
171 | 19.6k | } |
172 | | }; |
173 | | |
174 | | template <> |
175 | | struct ValueAlternative<DoubleValue> { |
176 | | static constexpr ValueIndex kIndex = ValueIndex::kDouble; |
177 | | static constexpr ValueKind kKind = DoubleValue::kKind; |
178 | | static constexpr bool kAlwaysTrivial = true; |
179 | | |
180 | 17.0k | static constexpr ValueFlags Flags(const DoubleValue* absl_nonnull) { |
181 | 17.0k | return ValueFlags::kNone; |
182 | 17.0k | } |
183 | | }; |
184 | | |
185 | | template <> |
186 | | struct ValueAlternative<DurationValue> { |
187 | | static constexpr ValueIndex kIndex = ValueIndex::kDuration; |
188 | | static constexpr ValueKind kKind = DurationValue::kKind; |
189 | | static constexpr bool kAlwaysTrivial = true; |
190 | | |
191 | 174 | static constexpr ValueFlags Flags(const DurationValue* absl_nonnull) { |
192 | 174 | return ValueFlags::kNone; |
193 | 174 | } |
194 | | }; |
195 | | |
196 | | template <> |
197 | | struct ValueAlternative<TimestampValue> { |
198 | | static constexpr ValueIndex kIndex = ValueIndex::kTimestamp; |
199 | | static constexpr ValueKind kKind = TimestampValue::kKind; |
200 | | static constexpr bool kAlwaysTrivial = true; |
201 | | |
202 | 49 | static constexpr ValueFlags Flags(const TimestampValue* absl_nonnull) { |
203 | 49 | return ValueFlags::kNone; |
204 | 49 | } |
205 | | }; |
206 | | |
207 | | template <> |
208 | | struct ValueAlternative<TypeValue> { |
209 | | static constexpr ValueIndex kIndex = ValueIndex::kType; |
210 | | static constexpr ValueKind kKind = TypeValue::kKind; |
211 | | static constexpr bool kAlwaysTrivial = true; |
212 | | |
213 | 759 | static constexpr ValueFlags Flags(const TypeValue* absl_nonnull) { |
214 | 759 | return ValueFlags::kNone; |
215 | 759 | } |
216 | | }; |
217 | | |
218 | | template <> |
219 | | struct ValueAlternative<LegacyListValue> { |
220 | | static constexpr ValueIndex kIndex = ValueIndex::kLegacyList; |
221 | | static constexpr ValueKind kKind = LegacyListValue::kKind; |
222 | | static constexpr bool kAlwaysTrivial = true; |
223 | | |
224 | 87 | static constexpr ValueFlags Flags(const LegacyListValue* absl_nonnull) { |
225 | 87 | return ValueFlags::kNone; |
226 | 87 | } |
227 | | }; |
228 | | |
229 | | template <> |
230 | | struct ValueAlternative<ParsedJsonListValue> { |
231 | | static constexpr ValueIndex kIndex = ValueIndex::kParsedJsonList; |
232 | | static constexpr ValueKind kKind = ParsedJsonListValue::kKind; |
233 | | static constexpr bool kAlwaysTrivial = true; |
234 | | |
235 | 0 | static constexpr ValueFlags Flags(const ParsedJsonListValue* absl_nonnull) { |
236 | 0 | return ValueFlags::kNone; |
237 | 0 | } |
238 | | }; |
239 | | |
240 | | template <> |
241 | | struct ValueAlternative<ParsedRepeatedFieldValue> { |
242 | | static constexpr ValueIndex kIndex = ValueIndex::kParsedRepeatedField; |
243 | | static constexpr ValueKind kKind = ParsedRepeatedFieldValue::kKind; |
244 | | static constexpr bool kAlwaysTrivial = true; |
245 | | |
246 | | static constexpr ValueFlags Flags( |
247 | 0 | const ParsedRepeatedFieldValue* absl_nonnull) { |
248 | 0 | return ValueFlags::kNone; |
249 | 0 | } |
250 | | }; |
251 | | |
252 | | template <> |
253 | | struct ValueAlternative<CustomListValue> { |
254 | | static constexpr ValueIndex kIndex = ValueIndex::kCustomList; |
255 | | static constexpr ValueKind kKind = CustomListValue::kKind; |
256 | | static constexpr bool kAlwaysTrivial = true; |
257 | | |
258 | 11.7k | static constexpr ValueFlags Flags(const CustomListValue* absl_nonnull) { |
259 | 11.7k | return ValueFlags::kNone; |
260 | 11.7k | } |
261 | | }; |
262 | | |
263 | | template <> |
264 | | struct ValueAlternative<LegacyMapValue> { |
265 | | static constexpr ValueIndex kIndex = ValueIndex::kLegacyMap; |
266 | | static constexpr ValueKind kKind = LegacyMapValue::kKind; |
267 | | static constexpr bool kAlwaysTrivial = true; |
268 | | |
269 | 677 | static constexpr ValueFlags Flags(const LegacyMapValue* absl_nonnull) { |
270 | 677 | return ValueFlags::kNone; |
271 | 677 | } |
272 | | }; |
273 | | |
274 | | template <> |
275 | | struct ValueAlternative<ParsedJsonMapValue> { |
276 | | static constexpr ValueIndex kIndex = ValueIndex::kParsedJsonMap; |
277 | | static constexpr ValueKind kKind = ParsedJsonMapValue::kKind; |
278 | | static constexpr bool kAlwaysTrivial = true; |
279 | | |
280 | 0 | static constexpr ValueFlags Flags(const ParsedJsonMapValue* absl_nonnull) { |
281 | 0 | return ValueFlags::kNone; |
282 | 0 | } |
283 | | }; |
284 | | |
285 | | template <> |
286 | | struct ValueAlternative<ParsedMapFieldValue> { |
287 | | static constexpr ValueIndex kIndex = ValueIndex::kParsedMapField; |
288 | | static constexpr ValueKind kKind = ParsedMapFieldValue::kKind; |
289 | | static constexpr bool kAlwaysTrivial = true; |
290 | | |
291 | 0 | static constexpr ValueFlags Flags(const ParsedMapFieldValue* absl_nonnull) { |
292 | 0 | return ValueFlags::kNone; |
293 | 0 | } |
294 | | }; |
295 | | |
296 | | template <> |
297 | | struct ValueAlternative<CustomMapValue> { |
298 | | static constexpr ValueIndex kIndex = ValueIndex::kCustomMap; |
299 | | static constexpr ValueKind kKind = CustomMapValue::kKind; |
300 | | static constexpr bool kAlwaysTrivial = true; |
301 | | |
302 | 8.13k | static constexpr ValueFlags Flags(const CustomMapValue* absl_nonnull) { |
303 | 8.13k | return ValueFlags::kNone; |
304 | 8.13k | } |
305 | | }; |
306 | | |
307 | | template <> |
308 | | struct ValueAlternative<LegacyStructValue> { |
309 | | static constexpr ValueIndex kIndex = ValueIndex::kLegacyStruct; |
310 | | static constexpr ValueKind kKind = LegacyStructValue::kKind; |
311 | | static constexpr bool kAlwaysTrivial = true; |
312 | | |
313 | 289 | static constexpr ValueFlags Flags(const LegacyStructValue* absl_nonnull) { |
314 | 289 | return ValueFlags::kNone; |
315 | 289 | } |
316 | | }; |
317 | | |
318 | | template <> |
319 | | struct ValueAlternative<ParsedMessageValue> { |
320 | | static constexpr ValueIndex kIndex = ValueIndex::kParsedMessage; |
321 | | static constexpr ValueKind kKind = ParsedMessageValue::kKind; |
322 | | static constexpr bool kAlwaysTrivial = true; |
323 | | |
324 | 0 | static constexpr ValueFlags Flags(const ParsedMessageValue* absl_nonnull) { |
325 | 0 | return ValueFlags::kNone; |
326 | 0 | } |
327 | | }; |
328 | | |
329 | | template <> |
330 | | struct ValueAlternative<CustomStructValue> { |
331 | | static constexpr ValueIndex kIndex = ValueIndex::kCustomStruct; |
332 | | static constexpr ValueKind kKind = CustomStructValue::kKind; |
333 | | static constexpr bool kAlwaysTrivial = true; |
334 | | |
335 | 0 | static constexpr ValueFlags Flags(const CustomStructValue* absl_nonnull) { |
336 | 0 | return ValueFlags::kNone; |
337 | 0 | } |
338 | | }; |
339 | | |
340 | | template <> |
341 | | struct ValueAlternative<OpaqueValue> { |
342 | | static constexpr ValueIndex kIndex = ValueIndex::kOpaque; |
343 | | static constexpr ValueKind kKind = OpaqueValue::kKind; |
344 | | static constexpr bool kAlwaysTrivial = true; |
345 | | |
346 | 0 | static constexpr ValueFlags Flags(const OpaqueValue* absl_nonnull) { |
347 | 0 | return ValueFlags::kNone; |
348 | 0 | } |
349 | | }; |
350 | | |
351 | | template <> |
352 | | struct ValueAlternative<BytesValue> { |
353 | | static constexpr ValueIndex kIndex = ValueIndex::kBytes; |
354 | | static constexpr ValueKind kKind = BytesValue::kKind; |
355 | | static constexpr bool kAlwaysTrivial = false; |
356 | | |
357 | 3.72k | static ValueFlags Flags(const BytesValue* absl_nonnull alternative) { |
358 | 3.72k | return ArenaTraits<BytesValue>::trivially_destructible(*alternative) |
359 | 3.72k | ? ValueFlags::kNone |
360 | 3.72k | : ValueFlags::kNonTrivial; |
361 | 3.72k | } |
362 | | }; |
363 | | |
364 | | template <> |
365 | | struct ValueAlternative<StringValue> { |
366 | | static constexpr ValueIndex kIndex = ValueIndex::kString; |
367 | | static constexpr ValueKind kKind = StringValue::kKind; |
368 | | static constexpr bool kAlwaysTrivial = false; |
369 | | |
370 | 14.7k | static ValueFlags Flags(const StringValue* absl_nonnull alternative) { |
371 | 14.7k | return ArenaTraits<StringValue>::trivially_destructible(*alternative) |
372 | 14.7k | ? ValueFlags::kNone |
373 | 14.7k | : ValueFlags::kNonTrivial; |
374 | 14.7k | } |
375 | | }; |
376 | | |
377 | | template <> |
378 | | struct ValueAlternative<ErrorValue> { |
379 | | static constexpr ValueIndex kIndex = ValueIndex::kError; |
380 | | static constexpr ValueKind kKind = ErrorValue::kKind; |
381 | | static constexpr bool kAlwaysTrivial = false; |
382 | | |
383 | 74.9k | static ValueFlags Flags(const ErrorValue* absl_nonnull alternative) { |
384 | 74.9k | return ArenaTraits<ErrorValue>::trivially_destructible(*alternative) |
385 | 74.9k | ? ValueFlags::kNone |
386 | 74.9k | : ValueFlags::kNonTrivial; |
387 | 74.9k | } |
388 | | }; |
389 | | |
390 | | template <> |
391 | | struct ValueAlternative<UnknownValue> { |
392 | | static constexpr ValueIndex kIndex = ValueIndex::kUnknown; |
393 | | static constexpr ValueKind kKind = UnknownValue::kKind; |
394 | | static constexpr bool kAlwaysTrivial = false; |
395 | | |
396 | 0 | static constexpr ValueFlags Flags(const UnknownValue* absl_nonnull) { |
397 | 0 | return ValueFlags::kNonTrivial; |
398 | 0 | } |
399 | | }; |
400 | | |
401 | | template <typename T, typename = void> |
402 | | struct IsValueAlternative : std::false_type {}; |
403 | | |
404 | | template <typename T> |
405 | | struct IsValueAlternative<T, std::void_t<decltype(ValueAlternative<T>{})>> |
406 | | : std::true_type {}; |
407 | | |
408 | | template <typename T> |
409 | | inline constexpr bool IsValueAlternativeV = IsValueAlternative<T>::value; |
410 | | |
411 | | // Alignment and size of the storage inside ValueVariant, not for ValueVariant |
412 | | // itself. |
413 | | inline constexpr size_t kValueVariantAlign = 8; |
414 | | inline constexpr size_t kValueVariantSize = 24; |
415 | | |
416 | | // Hand-rolled variant used by cel::Value which exhibits up to a 25% performance |
417 | | // improvement compared to using std::variant. |
418 | | // |
419 | | // The implementation abuses the fact that most alternatives are trivially |
420 | | // copyable and some are conditionally trivially copyable at runtime. For the |
421 | | // fast path, we perform raw byte copying. For the slow path, we fallback to a |
422 | | // non-inlined function. The compiler is typically smart enough to inline the |
423 | | // fast path and emit efficient instructions for the raw byte copying (usually |
424 | | // two instructions). It also uses switch for visiting, which most compilers can |
425 | | // optimize better compared to a function pointer table (which libc++ currently |
426 | | // uses and Clang currently does not optimize well). |
427 | | class alignas(kValueVariantAlign) CEL_COMMON_INTERNAL_VALUE_VARIANT_TRIVIAL_ABI |
428 | | ValueVariant final { |
429 | | public: |
430 | 210k | ValueVariant() = default; |
431 | | |
432 | | ValueVariant(const ValueVariant& other) noexcept |
433 | 239k | : index_(other.index_), kind_(other.kind_), flags_(other.flags_) { |
434 | 239k | if ((flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone) { |
435 | 138k | std::memcpy(raw_, other.raw_, sizeof(raw_)); |
436 | 138k | } else { |
437 | 100k | SlowCopyConstruct(other); |
438 | 100k | } |
439 | 239k | } |
440 | | |
441 | | ValueVariant(ValueVariant&& other) noexcept |
442 | 1.41M | : index_(other.index_), kind_(other.kind_), flags_(other.flags_) { |
443 | 1.41M | if ((flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone) { |
444 | 1.08M | std::memcpy(raw_, other.raw_, sizeof(raw_)); |
445 | 1.08M | } else { |
446 | 331k | SlowMoveConstruct(other); |
447 | 331k | } |
448 | 1.41M | } |
449 | | |
450 | 1.95M | ~ValueVariant() { |
451 | 1.95M | if ((flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNonTrivial) { |
452 | 552k | SlowDestruct(); |
453 | 552k | } |
454 | 1.95M | } |
455 | | |
456 | 122k | ValueVariant& operator=(const ValueVariant& other) noexcept { |
457 | 122k | if (this != &other) { |
458 | 122k | const bool trivial = |
459 | 122k | (flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone; |
460 | 122k | const bool other_trivial = |
461 | 122k | (other.flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone; |
462 | 122k | if (trivial && other_trivial) { |
463 | 109k | FastCopyAssign(other); |
464 | 109k | } else { |
465 | 13.7k | SlowCopyAssign(other, trivial, other_trivial); |
466 | 13.7k | } |
467 | 122k | } |
468 | 122k | return *this; |
469 | 122k | } |
470 | | |
471 | 178k | ValueVariant& operator=(ValueVariant&& other) noexcept { |
472 | 178k | if (this != &other) { |
473 | 178k | const bool trivial = |
474 | 178k | (flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone; |
475 | 178k | const bool other_trivial = |
476 | 178k | (other.flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone; |
477 | 178k | if (trivial && other_trivial) { |
478 | 54.0k | FastMoveAssign(other); |
479 | 124k | } else { |
480 | 124k | SlowMoveAssign(other, trivial, other_trivial); |
481 | 124k | } |
482 | 178k | } |
483 | 178k | return *this; |
484 | 178k | } |
485 | | |
486 | | template <typename T, typename... Args> |
487 | | explicit ValueVariant(absl::in_place_type_t<T>, Args&&... args) |
488 | 187k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { |
489 | 187k | static_assert(alignof(T) <= kValueVariantAlign); |
490 | 187k | static_assert(sizeof(T) <= kValueVariantSize); |
491 | | |
492 | 187k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) |
493 | 187k | T(std::forward<Args>(args)...)); |
494 | 187k | } cel::common_internal::ValueVariant::ValueVariant<cel::BoolValue, cel::BoolValue>(std::__1::in_place_type_t<cel::BoolValue>, cel::BoolValue&&) Line | Count | Source | 488 | 18.4k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 18.4k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 18.4k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 18.4k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 18.4k | T(std::forward<Args>(args)...)); | 494 | 18.4k | } |
Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::UnknownValue, cel::UnknownValue>(std::__1::in_place_type_t<cel::UnknownValue>, cel::UnknownValue&&) cel::common_internal::ValueVariant::ValueVariant<cel::ErrorValue, cel::ErrorValue>(std::__1::in_place_type_t<cel::ErrorValue>, cel::ErrorValue&&) Line | Count | Source | 488 | 10.7k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 10.7k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 10.7k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 10.7k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 10.7k | T(std::forward<Args>(args)...)); | 494 | 10.7k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::IntValue, cel::IntValue>(std::__1::in_place_type_t<cel::IntValue>, cel::IntValue&&) Line | Count | Source | 488 | 81.3k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 81.3k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 81.3k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 81.3k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 81.3k | T(std::forward<Args>(args)...)); | 494 | 81.3k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::UintValue, cel::UintValue>(std::__1::in_place_type_t<cel::UintValue>, cel::UintValue&&) Line | Count | Source | 488 | 19.4k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 19.4k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 19.4k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 19.4k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 19.4k | T(std::forward<Args>(args)...)); | 494 | 19.4k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::StringValue, cel::StringValue>(std::__1::in_place_type_t<cel::StringValue>, cel::StringValue&&) Line | Count | Source | 488 | 12.8k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 12.8k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 12.8k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 12.8k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 12.8k | T(std::forward<Args>(args)...)); | 494 | 12.8k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::TypeValue, cel::TypeValue>(std::__1::in_place_type_t<cel::TypeValue>, cel::TypeValue&&) Line | Count | Source | 488 | 759 | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 759 | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 759 | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 759 | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 759 | T(std::forward<Args>(args)...)); | 494 | 759 | } |
Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::CustomListValue, cel::CustomListValue>(std::__1::in_place_type_t<cel::CustomListValue>, cel::CustomListValue&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::UnknownValue, cel::UnknownValue&>(std::__1::in_place_type_t<cel::UnknownValue>, cel::UnknownValue&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::CustomMapValue, cel::CustomMapValue>(std::__1::in_place_type_t<cel::CustomMapValue>, cel::CustomMapValue&&) cel::common_internal::ValueVariant::ValueVariant<cel::StringValue, cel::StringValue const&>(std::__1::in_place_type_t<cel::StringValue>, cel::StringValue const&) Line | Count | Source | 488 | 1.94k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 1.94k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 1.94k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 1.94k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 1.94k | T(std::forward<Args>(args)...)); | 494 | 1.94k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::NullValue, cel::NullValue>(std::__1::in_place_type_t<cel::NullValue>, cel::NullValue&&) Line | Count | Source | 488 | 365 | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 365 | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 365 | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 365 | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 365 | T(std::forward<Args>(args)...)); | 494 | 365 | } |
cel::common_internal::ValueVariant::ValueVariant<cel::DoubleValue, cel::DoubleValue>(std::__1::in_place_type_t<cel::DoubleValue>, cel::DoubleValue&&) Line | Count | Source | 488 | 16.9k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 16.9k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 16.9k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 16.9k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 16.9k | T(std::forward<Args>(args)...)); | 494 | 16.9k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::BytesValue, cel::BytesValue>(std::__1::in_place_type_t<cel::BytesValue>, cel::BytesValue&&) Line | Count | Source | 488 | 3.62k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 3.62k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 3.62k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 3.62k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 3.62k | T(std::forward<Args>(args)...)); | 494 | 3.62k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::DurationValue, cel::DurationValue>(std::__1::in_place_type_t<cel::DurationValue>, cel::DurationValue&&) Line | Count | Source | 488 | 168 | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 168 | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 168 | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 168 | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 168 | T(std::forward<Args>(args)...)); | 494 | 168 | } |
cel::common_internal::ValueVariant::ValueVariant<cel::TimestampValue, cel::TimestampValue>(std::__1::in_place_type_t<cel::TimestampValue>, cel::TimestampValue&&) Line | Count | Source | 488 | 1 | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 1 | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 1 | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 1 | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 1 | T(std::forward<Args>(args)...)); | 494 | 1 | } |
Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::OpaqueValue, cel::OpaqueValue const&>(std::__1::in_place_type_t<cel::OpaqueValue>, cel::OpaqueValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::CustomListValue, cel::CustomListValue const&>(std::__1::in_place_type_t<cel::CustomListValue>, cel::CustomListValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedRepeatedFieldValue, cel::ParsedRepeatedFieldValue const&>(std::__1::in_place_type_t<cel::ParsedRepeatedFieldValue>, cel::ParsedRepeatedFieldValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedJsonListValue, cel::ParsedJsonListValue const&>(std::__1::in_place_type_t<cel::ParsedJsonListValue>, cel::ParsedJsonListValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::common_internal::LegacyListValue, cel::common_internal::LegacyListValue const&>(std::__1::in_place_type_t<cel::common_internal::LegacyListValue>, cel::common_internal::LegacyListValue const&) cel::common_internal::ValueVariant::ValueVariant<cel::CustomListValue, cel::CustomListValue const>(std::__1::in_place_type_t<cel::CustomListValue>, cel::CustomListValue const&&) Line | Count | Source | 488 | 11.7k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 11.7k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 11.7k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 11.7k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 11.7k | T(std::forward<Args>(args)...)); | 494 | 11.7k | } |
Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedRepeatedFieldValue, cel::ParsedRepeatedFieldValue const>(std::__1::in_place_type_t<cel::ParsedRepeatedFieldValue>, cel::ParsedRepeatedFieldValue const&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedJsonListValue, cel::ParsedJsonListValue const>(std::__1::in_place_type_t<cel::ParsedJsonListValue>, cel::ParsedJsonListValue const&&) cel::common_internal::ValueVariant::ValueVariant<cel::common_internal::LegacyListValue, cel::common_internal::LegacyListValue const>(std::__1::in_place_type_t<cel::common_internal::LegacyListValue>, cel::common_internal::LegacyListValue const&&) Line | Count | Source | 488 | 87 | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 87 | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 87 | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 87 | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 87 | T(std::forward<Args>(args)...)); | 494 | 87 | } |
Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::CustomMapValue, cel::CustomMapValue const&>(std::__1::in_place_type_t<cel::CustomMapValue>, cel::CustomMapValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedMapFieldValue, cel::ParsedMapFieldValue const&>(std::__1::in_place_type_t<cel::ParsedMapFieldValue>, cel::ParsedMapFieldValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedJsonMapValue, cel::ParsedJsonMapValue const&>(std::__1::in_place_type_t<cel::ParsedJsonMapValue>, cel::ParsedJsonMapValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::common_internal::LegacyMapValue, cel::common_internal::LegacyMapValue const&>(std::__1::in_place_type_t<cel::common_internal::LegacyMapValue>, cel::common_internal::LegacyMapValue const&) cel::common_internal::ValueVariant::ValueVariant<cel::CustomMapValue, cel::CustomMapValue const>(std::__1::in_place_type_t<cel::CustomMapValue>, cel::CustomMapValue const&&) Line | Count | Source | 488 | 8.13k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 8.13k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 8.13k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 8.13k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 8.13k | T(std::forward<Args>(args)...)); | 494 | 8.13k | } |
Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedMapFieldValue, cel::ParsedMapFieldValue const>(std::__1::in_place_type_t<cel::ParsedMapFieldValue>, cel::ParsedMapFieldValue const&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedJsonMapValue, cel::ParsedJsonMapValue const>(std::__1::in_place_type_t<cel::ParsedJsonMapValue>, cel::ParsedJsonMapValue const&&) cel::common_internal::ValueVariant::ValueVariant<cel::common_internal::LegacyMapValue, cel::common_internal::LegacyMapValue const>(std::__1::in_place_type_t<cel::common_internal::LegacyMapValue>, cel::common_internal::LegacyMapValue const&&) Line | Count | Source | 488 | 677 | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 677 | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 677 | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 677 | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 677 | T(std::forward<Args>(args)...)); | 494 | 677 | } |
Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedJsonListValue, cel::ParsedJsonListValue>(std::__1::in_place_type_t<cel::ParsedJsonListValue>, cel::ParsedJsonListValue&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedJsonMapValue, cel::ParsedJsonMapValue>(std::__1::in_place_type_t<cel::ParsedJsonMapValue>, cel::ParsedJsonMapValue&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::CustomStructValue, cel::CustomStructValue const&>(std::__1::in_place_type_t<cel::CustomStructValue>, cel::CustomStructValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedMessageValue, cel::ParsedMessageValue const&>(std::__1::in_place_type_t<cel::ParsedMessageValue>, cel::ParsedMessageValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::common_internal::LegacyStructValue, cel::common_internal::LegacyStructValue const&>(std::__1::in_place_type_t<cel::common_internal::LegacyStructValue>, cel::common_internal::LegacyStructValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::CustomStructValue, cel::CustomStructValue const>(std::__1::in_place_type_t<cel::CustomStructValue>, cel::CustomStructValue const&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedMessageValue, cel::ParsedMessageValue const>(std::__1::in_place_type_t<cel::ParsedMessageValue>, cel::ParsedMessageValue const&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::common_internal::LegacyStructValue, cel::common_internal::LegacyStructValue const>(std::__1::in_place_type_t<cel::common_internal::LegacyStructValue>, cel::common_internal::LegacyStructValue const&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::common_internal::LegacyStructValue, cel::common_internal::LegacyStructValue>(std::__1::in_place_type_t<cel::common_internal::LegacyStructValue>, cel::common_internal::LegacyStructValue&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::NullValue, cel::NullValue const&>(std::__1::in_place_type_t<cel::NullValue>, cel::NullValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::BoolValue, cel::BoolValue const&>(std::__1::in_place_type_t<cel::BoolValue>, cel::BoolValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::IntValue, cel::IntValue const&>(std::__1::in_place_type_t<cel::IntValue>, cel::IntValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::UintValue, cel::UintValue const&>(std::__1::in_place_type_t<cel::UintValue>, cel::UintValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::DoubleValue, cel::DoubleValue const&>(std::__1::in_place_type_t<cel::DoubleValue>, cel::DoubleValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::DurationValue, cel::DurationValue const&>(std::__1::in_place_type_t<cel::DurationValue>, cel::DurationValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::TimestampValue, cel::TimestampValue const&>(std::__1::in_place_type_t<cel::TimestampValue>, cel::TimestampValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::TypeValue, cel::TypeValue const&>(std::__1::in_place_type_t<cel::TypeValue>, cel::TypeValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedRepeatedFieldValue, cel::ParsedRepeatedFieldValue>(std::__1::in_place_type_t<cel::ParsedRepeatedFieldValue>, cel::ParsedRepeatedFieldValue&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedMapFieldValue, cel::ParsedMapFieldValue>(std::__1::in_place_type_t<cel::ParsedMapFieldValue>, cel::ParsedMapFieldValue&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedMessageValue, cel::ParsedMessageValue>(std::__1::in_place_type_t<cel::ParsedMessageValue>, cel::ParsedMessageValue&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::CustomStructValue, cel::CustomStructValue>(std::__1::in_place_type_t<cel::CustomStructValue>, cel::CustomStructValue&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::OpaqueValue, cel::OpaqueValue>(std::__1::in_place_type_t<cel::OpaqueValue>, cel::OpaqueValue&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::UnknownValue, cel::UnknownValue const&>(std::__1::in_place_type_t<cel::UnknownValue>, cel::UnknownValue const&) |
495 | | |
496 | | template <typename T, typename = std::enable_if_t< |
497 | | IsValueAlternativeV<absl::remove_cvref_t<T>>>> |
498 | | explicit ValueVariant(T&& value) |
499 | 20.6k | : ValueVariant(absl::in_place_type<absl::remove_cvref_t<T>>, |
500 | 20.6k | std::forward<T>(value)) {}Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::CustomListValue const&, void>(cel::CustomListValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedRepeatedFieldValue const&, void>(cel::ParsedRepeatedFieldValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedJsonListValue const&, void>(cel::ParsedJsonListValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::common_internal::LegacyListValue const&, void>(cel::common_internal::LegacyListValue const&) cel::common_internal::ValueVariant::ValueVariant<cel::CustomListValue const, void>(cel::CustomListValue const&&) Line | Count | Source | 499 | 11.7k | : ValueVariant(absl::in_place_type<absl::remove_cvref_t<T>>, | 500 | 11.7k | std::forward<T>(value)) {} |
Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedRepeatedFieldValue const, void>(cel::ParsedRepeatedFieldValue const&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedJsonListValue const, void>(cel::ParsedJsonListValue const&&) cel::common_internal::ValueVariant::ValueVariant<cel::common_internal::LegacyListValue const, void>(cel::common_internal::LegacyListValue const&&) Line | Count | Source | 499 | 87 | : ValueVariant(absl::in_place_type<absl::remove_cvref_t<T>>, | 500 | 87 | std::forward<T>(value)) {} |
Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::CustomMapValue const&, void>(cel::CustomMapValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedMapFieldValue const&, void>(cel::ParsedMapFieldValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedJsonMapValue const&, void>(cel::ParsedJsonMapValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::common_internal::LegacyMapValue const&, void>(cel::common_internal::LegacyMapValue const&) cel::common_internal::ValueVariant::ValueVariant<cel::CustomMapValue const, void>(cel::CustomMapValue const&&) Line | Count | Source | 499 | 8.13k | : ValueVariant(absl::in_place_type<absl::remove_cvref_t<T>>, | 500 | 8.13k | std::forward<T>(value)) {} |
Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedMapFieldValue const, void>(cel::ParsedMapFieldValue const&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedJsonMapValue const, void>(cel::ParsedJsonMapValue const&&) cel::common_internal::ValueVariant::ValueVariant<cel::common_internal::LegacyMapValue const, void>(cel::common_internal::LegacyMapValue const&&) Line | Count | Source | 499 | 677 | : ValueVariant(absl::in_place_type<absl::remove_cvref_t<T>>, | 500 | 677 | std::forward<T>(value)) {} |
Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::CustomStructValue const&, void>(cel::CustomStructValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedMessageValue const&, void>(cel::ParsedMessageValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::common_internal::LegacyStructValue const&, void>(cel::common_internal::LegacyStructValue const&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::CustomStructValue const, void>(cel::CustomStructValue const&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::ParsedMessageValue const, void>(cel::ParsedMessageValue const&&) Unexecuted instantiation: cel::common_internal::ValueVariant::ValueVariant<cel::common_internal::LegacyStructValue const, void>(cel::common_internal::LegacyStructValue const&&) |
501 | | |
502 | 1.15M | ValueKind kind() const { return kind_; } |
503 | | |
504 | | template <typename T> |
505 | 95.0k | void Assign(T&& value) { |
506 | 95.0k | using U = absl::remove_cvref_t<T>; |
507 | | |
508 | 95.0k | static_assert(alignof(U) <= kValueVariantAlign); |
509 | 95.0k | static_assert(sizeof(U) <= kValueVariantSize); |
510 | | |
511 | 95.0k | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { |
512 | 30.7k | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { |
513 | 1 | SlowDestruct(); |
514 | 1 | } |
515 | 30.7k | index_ = ValueAlternative<U>::kIndex; |
516 | 30.7k | kind_ = ValueAlternative<U>::kKind; |
517 | 30.7k | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) |
518 | 30.7k | U(std::forward<T>(value))); |
519 | 64.3k | } else { |
520 | | // U is not always trivial. See if the current active alternative is U. If |
521 | | // it is, we can just do a simple assignment without having to destruct |
522 | | // first. Otherwise fallback to destruct and construct. |
523 | 64.3k | if (index_ == ValueAlternative<U>::kIndex) { |
524 | 74 | *At<U>() = std::forward<T>(value); |
525 | 74 | flags_ = ValueAlternative<U>::Flags(At<U>()); |
526 | 64.2k | } else { |
527 | 64.2k | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { |
528 | 76 | SlowDestruct(); |
529 | 76 | } |
530 | 64.2k | index_ = ValueAlternative<U>::kIndex; |
531 | 64.2k | kind_ = ValueAlternative<U>::kKind; |
532 | 64.2k | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) |
533 | 64.2k | U(std::forward<T>(value))); |
534 | 64.2k | } |
535 | 64.3k | } |
536 | 95.0k | } Unexecuted instantiation: void cel::common_internal::ValueVariant::Assign<cel::OpaqueValue const&>(cel::OpaqueValue const&) Unexecuted instantiation: void cel::common_internal::ValueVariant::Assign<cel::OpaqueValue>(cel::OpaqueValue&&) void cel::common_internal::ValueVariant::Assign<cel::ErrorValue>(cel::ErrorValue&&) Line | Count | Source | 505 | 64.1k | void Assign(T&& value) { | 506 | 64.1k | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 64.1k | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 64.1k | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | | SlowDestruct(); | 514 | | } | 515 | | index_ = ValueAlternative<U>::kIndex; | 516 | | kind_ = ValueAlternative<U>::kKind; | 517 | | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | | U(std::forward<T>(value))); | 519 | 64.1k | } else { | 520 | | // U is not always trivial. See if the current active alternative is U. If | 521 | | // it is, we can just do a simple assignment without having to destruct | 522 | | // first. Otherwise fallback to destruct and construct. | 523 | 64.1k | if (index_ == ValueAlternative<U>::kIndex) { | 524 | 74 | *At<U>() = std::forward<T>(value); | 525 | 74 | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | 64.1k | } else { | 527 | 64.1k | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | 76 | SlowDestruct(); | 529 | 76 | } | 530 | 64.1k | index_ = ValueAlternative<U>::kIndex; | 531 | 64.1k | kind_ = ValueAlternative<U>::kKind; | 532 | 64.1k | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | 64.1k | U(std::forward<T>(value))); | 534 | 64.1k | } | 535 | 64.1k | } | 536 | 64.1k | } |
void cel::common_internal::ValueVariant::Assign<cel::NullValue>(cel::NullValue&&) Line | Count | Source | 505 | 5.37k | void Assign(T&& value) { | 506 | 5.37k | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 5.37k | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 5.37k | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 5.37k | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 5.37k | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 0 | SlowDestruct(); | 514 | 0 | } | 515 | 5.37k | index_ = ValueAlternative<U>::kIndex; | 516 | 5.37k | kind_ = ValueAlternative<U>::kKind; | 517 | 5.37k | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 5.37k | U(std::forward<T>(value))); | 519 | | } else { | 520 | | // U is not always trivial. See if the current active alternative is U. If | 521 | | // it is, we can just do a simple assignment without having to destruct | 522 | | // first. Otherwise fallback to destruct and construct. | 523 | | if (index_ == ValueAlternative<U>::kIndex) { | 524 | | *At<U>() = std::forward<T>(value); | 525 | | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | | } else { | 527 | | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | | SlowDestruct(); | 529 | | } | 530 | | index_ = ValueAlternative<U>::kIndex; | 531 | | kind_ = ValueAlternative<U>::kKind; | 532 | | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | | U(std::forward<T>(value))); | 534 | | } | 535 | | } | 536 | 5.37k | } |
void cel::common_internal::ValueVariant::Assign<cel::BoolValue>(cel::BoolValue&&) Line | Count | Source | 505 | 14.4k | void Assign(T&& value) { | 506 | 14.4k | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 14.4k | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 14.4k | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 14.4k | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 14.4k | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 1 | SlowDestruct(); | 514 | 1 | } | 515 | 14.4k | index_ = ValueAlternative<U>::kIndex; | 516 | 14.4k | kind_ = ValueAlternative<U>::kKind; | 517 | 14.4k | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 14.4k | U(std::forward<T>(value))); | 519 | | } else { | 520 | | // U is not always trivial. See if the current active alternative is U. If | 521 | | // it is, we can just do a simple assignment without having to destruct | 522 | | // first. Otherwise fallback to destruct and construct. | 523 | | if (index_ == ValueAlternative<U>::kIndex) { | 524 | | *At<U>() = std::forward<T>(value); | 525 | | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | | } else { | 527 | | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | | SlowDestruct(); | 529 | | } | 530 | | index_ = ValueAlternative<U>::kIndex; | 531 | | kind_ = ValueAlternative<U>::kKind; | 532 | | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | | U(std::forward<T>(value))); | 534 | | } | 535 | | } | 536 | 14.4k | } |
Unexecuted instantiation: void cel::common_internal::ValueVariant::Assign<cel::UnknownValue>(cel::UnknownValue&&) Unexecuted instantiation: void cel::common_internal::ValueVariant::Assign<cel::CustomListValue>(cel::CustomListValue&&) Unexecuted instantiation: void cel::common_internal::ValueVariant::Assign<cel::CustomMapValue>(cel::CustomMapValue&&) void cel::common_internal::ValueVariant::Assign<cel::IntValue>(cel::IntValue&&) Line | Count | Source | 505 | 10.4k | void Assign(T&& value) { | 506 | 10.4k | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 10.4k | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 10.4k | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 10.4k | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 10.4k | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 0 | SlowDestruct(); | 514 | 0 | } | 515 | 10.4k | index_ = ValueAlternative<U>::kIndex; | 516 | 10.4k | kind_ = ValueAlternative<U>::kKind; | 517 | 10.4k | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 10.4k | U(std::forward<T>(value))); | 519 | | } else { | 520 | | // U is not always trivial. See if the current active alternative is U. If | 521 | | // it is, we can just do a simple assignment without having to destruct | 522 | | // first. Otherwise fallback to destruct and construct. | 523 | | if (index_ == ValueAlternative<U>::kIndex) { | 524 | | *At<U>() = std::forward<T>(value); | 525 | | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | | } else { | 527 | | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | | SlowDestruct(); | 529 | | } | 530 | | index_ = ValueAlternative<U>::kIndex; | 531 | | kind_ = ValueAlternative<U>::kKind; | 532 | | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | | U(std::forward<T>(value))); | 534 | | } | 535 | | } | 536 | 10.4k | } |
void cel::common_internal::ValueVariant::Assign<cel::UintValue>(cel::UintValue&&) Line | Count | Source | 505 | 104 | void Assign(T&& value) { | 506 | 104 | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 104 | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 104 | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 104 | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 104 | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 0 | SlowDestruct(); | 514 | 0 | } | 515 | 104 | index_ = ValueAlternative<U>::kIndex; | 516 | 104 | kind_ = ValueAlternative<U>::kKind; | 517 | 104 | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 104 | U(std::forward<T>(value))); | 519 | | } else { | 520 | | // U is not always trivial. See if the current active alternative is U. If | 521 | | // it is, we can just do a simple assignment without having to destruct | 522 | | // first. Otherwise fallback to destruct and construct. | 523 | | if (index_ == ValueAlternative<U>::kIndex) { | 524 | | *At<U>() = std::forward<T>(value); | 525 | | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | | } else { | 527 | | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | | SlowDestruct(); | 529 | | } | 530 | | index_ = ValueAlternative<U>::kIndex; | 531 | | kind_ = ValueAlternative<U>::kKind; | 532 | | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | | U(std::forward<T>(value))); | 534 | | } | 535 | | } | 536 | 104 | } |
void cel::common_internal::ValueVariant::Assign<cel::DoubleValue>(cel::DoubleValue&&) Line | Count | Source | 505 | 117 | void Assign(T&& value) { | 506 | 117 | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 117 | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 117 | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 117 | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 117 | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 0 | SlowDestruct(); | 514 | 0 | } | 515 | 117 | index_ = ValueAlternative<U>::kIndex; | 516 | 117 | kind_ = ValueAlternative<U>::kKind; | 517 | 117 | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 117 | U(std::forward<T>(value))); | 519 | | } else { | 520 | | // U is not always trivial. See if the current active alternative is U. If | 521 | | // it is, we can just do a simple assignment without having to destruct | 522 | | // first. Otherwise fallback to destruct and construct. | 523 | | if (index_ == ValueAlternative<U>::kIndex) { | 524 | | *At<U>() = std::forward<T>(value); | 525 | | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | | } else { | 527 | | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | | SlowDestruct(); | 529 | | } | 530 | | index_ = ValueAlternative<U>::kIndex; | 531 | | kind_ = ValueAlternative<U>::kKind; | 532 | | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | | U(std::forward<T>(value))); | 534 | | } | 535 | | } | 536 | 117 | } |
void cel::common_internal::ValueVariant::Assign<cel::DurationValue>(cel::DurationValue&&) Line | Count | Source | 505 | 6 | void Assign(T&& value) { | 506 | 6 | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 6 | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 6 | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 6 | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 6 | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 0 | SlowDestruct(); | 514 | 0 | } | 515 | 6 | index_ = ValueAlternative<U>::kIndex; | 516 | 6 | kind_ = ValueAlternative<U>::kKind; | 517 | 6 | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 6 | U(std::forward<T>(value))); | 519 | | } else { | 520 | | // U is not always trivial. See if the current active alternative is U. If | 521 | | // it is, we can just do a simple assignment without having to destruct | 522 | | // first. Otherwise fallback to destruct and construct. | 523 | | if (index_ == ValueAlternative<U>::kIndex) { | 524 | | *At<U>() = std::forward<T>(value); | 525 | | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | | } else { | 527 | | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | | SlowDestruct(); | 529 | | } | 530 | | index_ = ValueAlternative<U>::kIndex; | 531 | | kind_ = ValueAlternative<U>::kKind; | 532 | | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | | U(std::forward<T>(value))); | 534 | | } | 535 | | } | 536 | 6 | } |
void cel::common_internal::ValueVariant::Assign<cel::TimestampValue>(cel::TimestampValue&&) Line | Count | Source | 505 | 48 | void Assign(T&& value) { | 506 | 48 | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 48 | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 48 | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 48 | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 48 | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 0 | SlowDestruct(); | 514 | 0 | } | 515 | 48 | index_ = ValueAlternative<U>::kIndex; | 516 | 48 | kind_ = ValueAlternative<U>::kKind; | 517 | 48 | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 48 | U(std::forward<T>(value))); | 519 | | } else { | 520 | | // U is not always trivial. See if the current active alternative is U. If | 521 | | // it is, we can just do a simple assignment without having to destruct | 522 | | // first. Otherwise fallback to destruct and construct. | 523 | | if (index_ == ValueAlternative<U>::kIndex) { | 524 | | *At<U>() = std::forward<T>(value); | 525 | | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | | } else { | 527 | | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | | SlowDestruct(); | 529 | | } | 530 | | index_ = ValueAlternative<U>::kIndex; | 531 | | kind_ = ValueAlternative<U>::kKind; | 532 | | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | | U(std::forward<T>(value))); | 534 | | } | 535 | | } | 536 | 48 | } |
void cel::common_internal::ValueVariant::Assign<cel::StringValue>(cel::StringValue&&) Line | Count | Source | 505 | 26 | void Assign(T&& value) { | 506 | 26 | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 26 | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 26 | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | | SlowDestruct(); | 514 | | } | 515 | | index_ = ValueAlternative<U>::kIndex; | 516 | | kind_ = ValueAlternative<U>::kKind; | 517 | | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | | U(std::forward<T>(value))); | 519 | 26 | } else { | 520 | | // U is not always trivial. See if the current active alternative is U. If | 521 | | // it is, we can just do a simple assignment without having to destruct | 522 | | // first. Otherwise fallback to destruct and construct. | 523 | 26 | if (index_ == ValueAlternative<U>::kIndex) { | 524 | 0 | *At<U>() = std::forward<T>(value); | 525 | 0 | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | 26 | } else { | 527 | 26 | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | 0 | SlowDestruct(); | 529 | 0 | } | 530 | 26 | index_ = ValueAlternative<U>::kIndex; | 531 | 26 | kind_ = ValueAlternative<U>::kKind; | 532 | 26 | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | 26 | U(std::forward<T>(value))); | 534 | 26 | } | 535 | 26 | } | 536 | 26 | } |
Unexecuted instantiation: void cel::common_internal::ValueVariant::Assign<cel::StringValue const&>(cel::StringValue const&) void cel::common_internal::ValueVariant::Assign<cel::BytesValue>(cel::BytesValue&&) Line | Count | Source | 505 | 102 | void Assign(T&& value) { | 506 | 102 | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 102 | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 102 | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | | SlowDestruct(); | 514 | | } | 515 | | index_ = ValueAlternative<U>::kIndex; | 516 | | kind_ = ValueAlternative<U>::kKind; | 517 | | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | | U(std::forward<T>(value))); | 519 | 102 | } else { | 520 | | // U is not always trivial. See if the current active alternative is U. If | 521 | | // it is, we can just do a simple assignment without having to destruct | 522 | | // first. Otherwise fallback to destruct and construct. | 523 | 102 | if (index_ == ValueAlternative<U>::kIndex) { | 524 | 0 | *At<U>() = std::forward<T>(value); | 525 | 0 | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | 102 | } else { | 527 | 102 | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | 0 | SlowDestruct(); | 529 | 0 | } | 530 | 102 | index_ = ValueAlternative<U>::kIndex; | 531 | 102 | kind_ = ValueAlternative<U>::kKind; | 532 | 102 | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | 102 | U(std::forward<T>(value))); | 534 | 102 | } | 535 | 102 | } | 536 | 102 | } |
void cel::common_internal::ValueVariant::Assign<cel::common_internal::LegacyStructValue>(cel::common_internal::LegacyStructValue&&) Line | Count | Source | 505 | 289 | void Assign(T&& value) { | 506 | 289 | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 289 | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 289 | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 289 | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 289 | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 0 | SlowDestruct(); | 514 | 0 | } | 515 | 289 | index_ = ValueAlternative<U>::kIndex; | 516 | 289 | kind_ = ValueAlternative<U>::kKind; | 517 | 289 | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 289 | U(std::forward<T>(value))); | 519 | | } else { | 520 | | // U is not always trivial. See if the current active alternative is U. If | 521 | | // it is, we can just do a simple assignment without having to destruct | 522 | | // first. Otherwise fallback to destruct and construct. | 523 | | if (index_ == ValueAlternative<U>::kIndex) { | 524 | | *At<U>() = std::forward<T>(value); | 525 | | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | | } else { | 527 | | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | | SlowDestruct(); | 529 | | } | 530 | | index_ = ValueAlternative<U>::kIndex; | 531 | | kind_ = ValueAlternative<U>::kKind; | 532 | | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | | U(std::forward<T>(value))); | 534 | | } | 535 | | } | 536 | 289 | } |
Unexecuted instantiation: void cel::common_internal::ValueVariant::Assign<cel::TypeValue>(cel::TypeValue&&) |
537 | | |
538 | | template <typename T> |
539 | 837k | bool Is() const { |
540 | 837k | return index_ == ValueAlternative<T>::kIndex; |
541 | 837k | } bool cel::common_internal::ValueVariant::Is<cel::BoolValue>() const Line | Count | Source | 539 | 44.5k | bool Is() const { | 540 | 44.5k | return index_ == ValueAlternative<T>::kIndex; | 541 | 44.5k | } |
bool cel::common_internal::ValueVariant::Is<cel::BytesValue>() const Line | Count | Source | 539 | 2.25k | bool Is() const { | 540 | 2.25k | return index_ == ValueAlternative<T>::kIndex; | 541 | 2.25k | } |
bool cel::common_internal::ValueVariant::Is<cel::DoubleValue>() const Line | Count | Source | 539 | 19.5k | bool Is() const { | 540 | 19.5k | return index_ == ValueAlternative<T>::kIndex; | 541 | 19.5k | } |
bool cel::common_internal::ValueVariant::Is<cel::DurationValue>() const Line | Count | Source | 539 | 5 | bool Is() const { | 540 | 5 | return index_ == ValueAlternative<T>::kIndex; | 541 | 5 | } |
bool cel::common_internal::ValueVariant::Is<cel::ErrorValue>() const Line | Count | Source | 539 | 402k | bool Is() const { | 540 | 402k | return index_ == ValueAlternative<T>::kIndex; | 541 | 402k | } |
bool cel::common_internal::ValueVariant::Is<cel::IntValue>() const Line | Count | Source | 539 | 42.7k | bool Is() const { | 540 | 42.7k | return index_ == ValueAlternative<T>::kIndex; | 541 | 42.7k | } |
bool cel::common_internal::ValueVariant::Is<cel::common_internal::LegacyListValue>() const Line | Count | Source | 539 | 18.9k | bool Is() const { | 540 | 18.9k | return index_ == ValueAlternative<T>::kIndex; | 541 | 18.9k | } |
bool cel::common_internal::ValueVariant::Is<cel::CustomListValue>() const Line | Count | Source | 539 | 18.9k | bool Is() const { | 540 | 18.9k | return index_ == ValueAlternative<T>::kIndex; | 541 | 18.9k | } |
bool cel::common_internal::ValueVariant::Is<cel::ParsedRepeatedFieldValue>() const Line | Count | Source | 539 | 682 | bool Is() const { | 540 | 682 | return index_ == ValueAlternative<T>::kIndex; | 541 | 682 | } |
bool cel::common_internal::ValueVariant::Is<cel::ParsedJsonListValue>() const Line | Count | Source | 539 | 682 | bool Is() const { | 540 | 682 | return index_ == ValueAlternative<T>::kIndex; | 541 | 682 | } |
bool cel::common_internal::ValueVariant::Is<cel::common_internal::LegacyMapValue>() const Line | Count | Source | 539 | 10.6k | bool Is() const { | 540 | 10.6k | return index_ == ValueAlternative<T>::kIndex; | 541 | 10.6k | } |
bool cel::common_internal::ValueVariant::Is<cel::CustomMapValue>() const Line | Count | Source | 539 | 9.46k | bool Is() const { | 540 | 9.46k | return index_ == ValueAlternative<T>::kIndex; | 541 | 9.46k | } |
bool cel::common_internal::ValueVariant::Is<cel::ParsedMapFieldValue>() const Line | Count | Source | 539 | 1.77k | bool Is() const { | 540 | 1.77k | return index_ == ValueAlternative<T>::kIndex; | 541 | 1.77k | } |
bool cel::common_internal::ValueVariant::Is<cel::ParsedJsonMapValue>() const Line | Count | Source | 539 | 1.77k | bool Is() const { | 540 | 1.77k | return index_ == ValueAlternative<T>::kIndex; | 541 | 1.77k | } |
bool cel::common_internal::ValueVariant::Is<cel::ParsedMessageValue>() const Line | Count | Source | 539 | 2.18k | bool Is() const { | 540 | 2.18k | return index_ == ValueAlternative<T>::kIndex; | 541 | 2.18k | } |
bool cel::common_internal::ValueVariant::Is<cel::NullValue>() const Line | Count | Source | 539 | 7 | bool Is() const { | 540 | 7 | return index_ == ValueAlternative<T>::kIndex; | 541 | 7 | } |
Unexecuted instantiation: bool cel::common_internal::ValueVariant::Is<cel::OpaqueValue>() const bool cel::common_internal::ValueVariant::Is<cel::CustomStructValue>() const Line | Count | Source | 539 | 2.18k | bool Is() const { | 540 | 2.18k | return index_ == ValueAlternative<T>::kIndex; | 541 | 2.18k | } |
bool cel::common_internal::ValueVariant::Is<cel::StringValue>() const Line | Count | Source | 539 | 9.87k | bool Is() const { | 540 | 9.87k | return index_ == ValueAlternative<T>::kIndex; | 541 | 9.87k | } |
bool cel::common_internal::ValueVariant::Is<cel::common_internal::LegacyStructValue>() const Line | Count | Source | 539 | 2.75k | bool Is() const { | 540 | 2.75k | return index_ == ValueAlternative<T>::kIndex; | 541 | 2.75k | } |
bool cel::common_internal::ValueVariant::Is<cel::TimestampValue>() const Line | Count | Source | 539 | 1 | bool Is() const { | 540 | 1 | return index_ == ValueAlternative<T>::kIndex; | 541 | 1 | } |
bool cel::common_internal::ValueVariant::Is<cel::TypeValue>() const Line | Count | Source | 539 | 79 | bool Is() const { | 540 | 79 | return index_ == ValueAlternative<T>::kIndex; | 541 | 79 | } |
bool cel::common_internal::ValueVariant::Is<cel::UintValue>() const Line | Count | Source | 539 | 23.1k | bool Is() const { | 540 | 23.1k | return index_ == ValueAlternative<T>::kIndex; | 541 | 23.1k | } |
bool cel::common_internal::ValueVariant::Is<cel::UnknownValue>() const Line | Count | Source | 539 | 222k | bool Is() const { | 540 | 222k | return index_ == ValueAlternative<T>::kIndex; | 541 | 222k | } |
|
542 | | |
543 | | template <typename T> |
544 | | T& Get() & ABSL_ATTRIBUTE_LIFETIME_BOUND { |
545 | | ABSL_DCHECK(Is<T>()); |
546 | | |
547 | | return *At<T>(); |
548 | | } |
549 | | |
550 | | template <typename T> |
551 | 213k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { |
552 | 213k | ABSL_DCHECK(Is<T>()); |
553 | | |
554 | 213k | return *At<T>(); |
555 | 213k | } cel::BoolValue const& cel::common_internal::ValueVariant::Get<cel::BoolValue>() const & Line | Count | Source | 551 | 17.8k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 17.8k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 17.8k | return *At<T>(); | 555 | 17.8k | } |
cel::NullValue const& cel::common_internal::ValueVariant::Get<cel::NullValue>() const & Line | Count | Source | 551 | 112 | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 112 | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 112 | return *At<T>(); | 555 | 112 | } |
cel::IntValue const& cel::common_internal::ValueVariant::Get<cel::IntValue>() const & Line | Count | Source | 551 | 123k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 123k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 123k | return *At<T>(); | 555 | 123k | } |
cel::UintValue const& cel::common_internal::ValueVariant::Get<cel::UintValue>() const & Line | Count | Source | 551 | 17.6k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 17.6k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 17.6k | return *At<T>(); | 555 | 17.6k | } |
cel::DoubleValue const& cel::common_internal::ValueVariant::Get<cel::DoubleValue>() const & Line | Count | Source | 551 | 22.6k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 22.6k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 22.6k | return *At<T>(); | 555 | 22.6k | } |
cel::DurationValue const& cel::common_internal::ValueVariant::Get<cel::DurationValue>() const & Line | Count | Source | 551 | 7 | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 7 | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 7 | return *At<T>(); | 555 | 7 | } |
cel::TimestampValue const& cel::common_internal::ValueVariant::Get<cel::TimestampValue>() const & Line | Count | Source | 551 | 2 | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 2 | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 2 | return *At<T>(); | 555 | 2 | } |
cel::TypeValue const& cel::common_internal::ValueVariant::Get<cel::TypeValue>() const & Line | Count | Source | 551 | 2.01k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 2.01k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 2.01k | return *At<T>(); | 555 | 2.01k | } |
cel::common_internal::LegacyListValue const& cel::common_internal::ValueVariant::Get<cel::common_internal::LegacyListValue>() const & Line | Count | Source | 551 | 181 | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 181 | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 181 | return *At<T>(); | 555 | 181 | } |
Unexecuted instantiation: cel::ParsedJsonListValue const& cel::common_internal::ValueVariant::Get<cel::ParsedJsonListValue>() const & Unexecuted instantiation: cel::ParsedRepeatedFieldValue const& cel::common_internal::ValueVariant::Get<cel::ParsedRepeatedFieldValue>() const & cel::CustomListValue const& cel::common_internal::ValueVariant::Get<cel::CustomListValue>() const & Line | Count | Source | 551 | 2.42k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 2.42k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 2.42k | return *At<T>(); | 555 | 2.42k | } |
cel::common_internal::LegacyMapValue const& cel::common_internal::ValueVariant::Get<cel::common_internal::LegacyMapValue>() const & Line | Count | Source | 551 | 2 | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 2 | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 2 | return *At<T>(); | 555 | 2 | } |
Unexecuted instantiation: cel::ParsedJsonMapValue const& cel::common_internal::ValueVariant::Get<cel::ParsedJsonMapValue>() const & Unexecuted instantiation: cel::ParsedMapFieldValue const& cel::common_internal::ValueVariant::Get<cel::ParsedMapFieldValue>() const & cel::CustomMapValue const& cel::common_internal::ValueVariant::Get<cel::CustomMapValue>() const & Line | Count | Source | 551 | 573 | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 573 | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 573 | return *At<T>(); | 555 | 573 | } |
cel::common_internal::LegacyStructValue const& cel::common_internal::ValueVariant::Get<cel::common_internal::LegacyStructValue>() const & Line | Count | Source | 551 | 3 | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 3 | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 3 | return *At<T>(); | 555 | 3 | } |
Unexecuted instantiation: cel::ParsedMessageValue const& cel::common_internal::ValueVariant::Get<cel::ParsedMessageValue>() const & Unexecuted instantiation: cel::CustomStructValue const& cel::common_internal::ValueVariant::Get<cel::CustomStructValue>() const & Unexecuted instantiation: cel::OpaqueValue const& cel::common_internal::ValueVariant::Get<cel::OpaqueValue>() const & cel::BytesValue const& cel::common_internal::ValueVariant::Get<cel::BytesValue>() const & Line | Count | Source | 551 | 5.04k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 5.04k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 5.04k | return *At<T>(); | 555 | 5.04k | } |
cel::StringValue const& cel::common_internal::ValueVariant::Get<cel::StringValue>() const & Line | Count | Source | 551 | 16.2k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 16.2k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 16.2k | return *At<T>(); | 555 | 16.2k | } |
cel::ErrorValue const& cel::common_internal::ValueVariant::Get<cel::ErrorValue>() const & Line | Count | Source | 551 | 5.05k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 5.05k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 5.05k | return *At<T>(); | 555 | 5.05k | } |
Unexecuted instantiation: cel::UnknownValue const& cel::common_internal::ValueVariant::Get<cel::UnknownValue>() const & |
556 | | |
557 | | template <typename T> |
558 | 0 | T&& Get() && ABSL_ATTRIBUTE_LIFETIME_BOUND { |
559 | 0 | ABSL_DCHECK(Is<T>()); |
560 | |
|
561 | 0 | return std::move(*At<T>()); |
562 | 0 | } Unexecuted instantiation: cel::BytesValue&& cel::common_internal::ValueVariant::Get<cel::BytesValue>() && Unexecuted instantiation: cel::ErrorValue&& cel::common_internal::ValueVariant::Get<cel::ErrorValue>() && Unexecuted instantiation: cel::ParsedMessageValue&& cel::common_internal::ValueVariant::Get<cel::ParsedMessageValue>() && Unexecuted instantiation: cel::OpaqueValue&& cel::common_internal::ValueVariant::Get<cel::OpaqueValue>() && Unexecuted instantiation: cel::ParsedJsonListValue&& cel::common_internal::ValueVariant::Get<cel::ParsedJsonListValue>() && Unexecuted instantiation: cel::ParsedJsonMapValue&& cel::common_internal::ValueVariant::Get<cel::ParsedJsonMapValue>() && Unexecuted instantiation: cel::CustomListValue&& cel::common_internal::ValueVariant::Get<cel::CustomListValue>() && Unexecuted instantiation: cel::CustomMapValue&& cel::common_internal::ValueVariant::Get<cel::CustomMapValue>() && Unexecuted instantiation: cel::ParsedMapFieldValue&& cel::common_internal::ValueVariant::Get<cel::ParsedMapFieldValue>() && Unexecuted instantiation: cel::ParsedRepeatedFieldValue&& cel::common_internal::ValueVariant::Get<cel::ParsedRepeatedFieldValue>() && Unexecuted instantiation: cel::CustomStructValue&& cel::common_internal::ValueVariant::Get<cel::CustomStructValue>() && Unexecuted instantiation: cel::StringValue&& cel::common_internal::ValueVariant::Get<cel::StringValue>() && Unexecuted instantiation: cel::TypeValue&& cel::common_internal::ValueVariant::Get<cel::TypeValue>() && Unexecuted instantiation: cel::UnknownValue&& cel::common_internal::ValueVariant::Get<cel::UnknownValue>() && |
563 | | |
564 | | template <typename T> |
565 | | const T&& Get() const&& ABSL_ATTRIBUTE_LIFETIME_BOUND { |
566 | | ABSL_DCHECK(Is<T>()); |
567 | | |
568 | | return std::move(*At<T>()); |
569 | | } |
570 | | |
571 | | template <typename T> |
572 | 0 | T* absl_nullable As() ABSL_ATTRIBUTE_LIFETIME_BOUND { |
573 | 0 | if (Is<T>()) { |
574 | 0 | return At<T>(); |
575 | 0 | } |
576 | 0 | return nullptr; |
577 | 0 | } Unexecuted instantiation: cel::BytesValue* cel::common_internal::ValueVariant::As<cel::BytesValue>() Unexecuted instantiation: cel::ErrorValue* cel::common_internal::ValueVariant::As<cel::ErrorValue>() Unexecuted instantiation: cel::common_internal::LegacyListValue* cel::common_internal::ValueVariant::As<cel::common_internal::LegacyListValue>() Unexecuted instantiation: cel::CustomListValue* cel::common_internal::ValueVariant::As<cel::CustomListValue>() Unexecuted instantiation: cel::ParsedRepeatedFieldValue* cel::common_internal::ValueVariant::As<cel::ParsedRepeatedFieldValue>() Unexecuted instantiation: cel::ParsedJsonListValue* cel::common_internal::ValueVariant::As<cel::ParsedJsonListValue>() Unexecuted instantiation: cel::common_internal::LegacyMapValue* cel::common_internal::ValueVariant::As<cel::common_internal::LegacyMapValue>() Unexecuted instantiation: cel::CustomMapValue* cel::common_internal::ValueVariant::As<cel::CustomMapValue>() Unexecuted instantiation: cel::ParsedMapFieldValue* cel::common_internal::ValueVariant::As<cel::ParsedMapFieldValue>() Unexecuted instantiation: cel::ParsedJsonMapValue* cel::common_internal::ValueVariant::As<cel::ParsedJsonMapValue>() Unexecuted instantiation: cel::ParsedMessageValue* cel::common_internal::ValueVariant::As<cel::ParsedMessageValue>() Unexecuted instantiation: cel::OpaqueValue* cel::common_internal::ValueVariant::As<cel::OpaqueValue>() Unexecuted instantiation: cel::CustomStructValue* cel::common_internal::ValueVariant::As<cel::CustomStructValue>() Unexecuted instantiation: cel::StringValue* cel::common_internal::ValueVariant::As<cel::StringValue>() Unexecuted instantiation: cel::common_internal::LegacyStructValue* cel::common_internal::ValueVariant::As<cel::common_internal::LegacyStructValue>() Unexecuted instantiation: cel::TypeValue* cel::common_internal::ValueVariant::As<cel::TypeValue>() Unexecuted instantiation: cel::UnknownValue* cel::common_internal::ValueVariant::As<cel::UnknownValue>() |
578 | | |
579 | | template <typename T> |
580 | 342k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { |
581 | 342k | if (Is<T>()) { |
582 | 36.0k | return At<T>(); |
583 | 36.0k | } |
584 | 306k | return nullptr; |
585 | 342k | } Unexecuted instantiation: cel::OpaqueValue const* cel::common_internal::ValueVariant::As<cel::OpaqueValue>() const cel::BoolValue const* cel::common_internal::ValueVariant::As<cel::BoolValue>() const Line | Count | Source | 580 | 12.5k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 12.5k | if (Is<T>()) { | 582 | 11.7k | return At<T>(); | 583 | 11.7k | } | 584 | 831 | return nullptr; | 585 | 12.5k | } |
cel::BytesValue const* cel::common_internal::ValueVariant::As<cel::BytesValue>() const Line | Count | Source | 580 | 333 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 333 | if (Is<T>()) { | 582 | 152 | return At<T>(); | 583 | 152 | } | 584 | 181 | return nullptr; | 585 | 333 | } |
cel::DoubleValue const* cel::common_internal::ValueVariant::As<cel::DoubleValue>() const Line | Count | Source | 580 | 7.26k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 7.26k | if (Is<T>()) { | 582 | 2.08k | return At<T>(); | 583 | 2.08k | } | 584 | 5.18k | return nullptr; | 585 | 7.26k | } |
Unexecuted instantiation: cel::DurationValue const* cel::common_internal::ValueVariant::As<cel::DurationValue>() const cel::ErrorValue const* cel::common_internal::ValueVariant::As<cel::ErrorValue>() const Line | Count | Source | 580 | 137k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 137k | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 137k | return nullptr; | 585 | 137k | } |
cel::IntValue const* cel::common_internal::ValueVariant::As<cel::IntValue>() const Line | Count | Source | 580 | 7.94k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 7.94k | if (Is<T>()) { | 582 | 2.38k | return At<T>(); | 583 | 2.38k | } | 584 | 5.56k | return nullptr; | 585 | 7.94k | } |
cel::common_internal::LegacyListValue const* cel::common_internal::ValueVariant::As<cel::common_internal::LegacyListValue>() const Line | Count | Source | 580 | 9.66k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 9.66k | if (Is<T>()) { | 582 | 1 | return At<T>(); | 583 | 1 | } | 584 | 9.66k | return nullptr; | 585 | 9.66k | } |
cel::CustomListValue const* cel::common_internal::ValueVariant::As<cel::CustomListValue>() const Line | Count | Source | 580 | 9.93k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 9.93k | if (Is<T>()) { | 582 | 9.79k | return At<T>(); | 583 | 9.79k | } | 584 | 144 | return nullptr; | 585 | 9.93k | } |
cel::ParsedRepeatedFieldValue const* cel::common_internal::ValueVariant::As<cel::ParsedRepeatedFieldValue>() const Line | Count | Source | 580 | 144 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 144 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 144 | return nullptr; | 585 | 144 | } |
cel::ParsedJsonListValue const* cel::common_internal::ValueVariant::As<cel::ParsedJsonListValue>() const Line | Count | Source | 580 | 144 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 144 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 144 | return nullptr; | 585 | 144 | } |
cel::common_internal::LegacyMapValue const* cel::common_internal::ValueVariant::As<cel::common_internal::LegacyMapValue>() const Line | Count | Source | 580 | 6.41k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 6.41k | if (Is<T>()) { | 582 | 666 | return At<T>(); | 583 | 666 | } | 584 | 5.75k | return nullptr; | 585 | 6.41k | } |
cel::CustomMapValue const* cel::common_internal::ValueVariant::As<cel::CustomMapValue>() const Line | Count | Source | 580 | 5.79k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 5.79k | if (Is<T>()) { | 582 | 5.75k | return At<T>(); | 583 | 5.75k | } | 584 | 35 | return nullptr; | 585 | 5.79k | } |
cel::ParsedMapFieldValue const* cel::common_internal::ValueVariant::As<cel::ParsedMapFieldValue>() const Line | Count | Source | 580 | 35 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 35 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 35 | return nullptr; | 585 | 35 | } |
cel::ParsedJsonMapValue const* cel::common_internal::ValueVariant::As<cel::ParsedJsonMapValue>() const Line | Count | Source | 580 | 35 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 35 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 35 | return nullptr; | 585 | 35 | } |
cel::ParsedMessageValue const* cel::common_internal::ValueVariant::As<cel::ParsedMessageValue>() const Line | Count | Source | 580 | 1 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 1 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 1 | return nullptr; | 585 | 1 | } |
Unexecuted instantiation: cel::NullValue const* cel::common_internal::ValueVariant::As<cel::NullValue>() const cel::CustomStructValue const* cel::common_internal::ValueVariant::As<cel::CustomStructValue>() const Line | Count | Source | 580 | 1 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 1 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 1 | return nullptr; | 585 | 1 | } |
cel::StringValue const* cel::common_internal::ValueVariant::As<cel::StringValue>() const Line | Count | Source | 580 | 619 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 619 | if (Is<T>()) { | 582 | 538 | return At<T>(); | 583 | 538 | } | 584 | 81 | return nullptr; | 585 | 619 | } |
cel::common_internal::LegacyStructValue const* cel::common_internal::ValueVariant::As<cel::common_internal::LegacyStructValue>() const Line | Count | Source | 580 | 285 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 285 | if (Is<T>()) { | 582 | 284 | return At<T>(); | 583 | 284 | } | 584 | 1 | return nullptr; | 585 | 285 | } |
Unexecuted instantiation: cel::TimestampValue const* cel::common_internal::ValueVariant::As<cel::TimestampValue>() const cel::TypeValue const* cel::common_internal::ValueVariant::As<cel::TypeValue>() const Line | Count | Source | 580 | 79 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 79 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 79 | return nullptr; | 585 | 79 | } |
cel::UintValue const* cel::common_internal::ValueVariant::As<cel::UintValue>() const Line | Count | Source | 580 | 5.55k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 5.55k | if (Is<T>()) { | 582 | 2.71k | return At<T>(); | 583 | 2.71k | } | 584 | 2.83k | return nullptr; | 585 | 5.55k | } |
cel::UnknownValue const* cel::common_internal::ValueVariant::As<cel::UnknownValue>() const Line | Count | Source | 580 | 137k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 137k | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 137k | return nullptr; | 585 | 137k | } |
|
586 | | |
587 | | template <typename Visitor> |
588 | | ABSL_ATTRIBUTE_ALWAYS_INLINE decltype(auto) Visit(Visitor&& visitor) & { |
589 | | return std::as_const(*this).Visit(std::forward<Visitor>(visitor)); |
590 | | } |
591 | | |
592 | | template <typename Visitor> |
593 | 121k | decltype(auto) Visit(Visitor&& visitor) const& { |
594 | 121k | switch (index_) { |
595 | 112 | case ValueIndex::kNull: |
596 | 112 | return std::forward<Visitor>(visitor)(Get<NullValue>()); |
597 | 5.02k | case ValueIndex::kBool: |
598 | 5.02k | return std::forward<Visitor>(visitor)(Get<BoolValue>()); |
599 | 89.1k | case ValueIndex::kInt: |
600 | 89.1k | return std::forward<Visitor>(visitor)(Get<IntValue>()); |
601 | 5.04k | case ValueIndex::kUint: |
602 | 5.04k | return std::forward<Visitor>(visitor)(Get<UintValue>()); |
603 | 9.95k | case ValueIndex::kDouble: |
604 | 9.95k | return std::forward<Visitor>(visitor)(Get<DoubleValue>()); |
605 | 1 | case ValueIndex::kDuration: |
606 | 1 | return std::forward<Visitor>(visitor)(Get<DurationValue>()); |
607 | 0 | case ValueIndex::kTimestamp: |
608 | 0 | return std::forward<Visitor>(visitor)(Get<TimestampValue>()); |
609 | 1.99k | case ValueIndex::kType: |
610 | 1.99k | return std::forward<Visitor>(visitor)(Get<TypeValue>()); |
611 | 180 | case ValueIndex::kLegacyList: |
612 | 180 | return std::forward<Visitor>(visitor)(Get<LegacyListValue>()); |
613 | 0 | case ValueIndex::kParsedJsonList: |
614 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedJsonListValue>()); |
615 | 0 | case ValueIndex::kParsedRepeatedField: |
616 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedRepeatedFieldValue>()); |
617 | 2.42k | case ValueIndex::kCustomList: |
618 | 2.42k | return std::forward<Visitor>(visitor)(Get<CustomListValue>()); |
619 | 1 | case ValueIndex::kLegacyMap: |
620 | 1 | return std::forward<Visitor>(visitor)(Get<LegacyMapValue>()); |
621 | 0 | case ValueIndex::kParsedJsonMap: |
622 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedJsonMapValue>()); |
623 | 0 | case ValueIndex::kParsedMapField: |
624 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedMapFieldValue>()); |
625 | 573 | case ValueIndex::kCustomMap: |
626 | 573 | return std::forward<Visitor>(visitor)(Get<CustomMapValue>()); |
627 | 2 | case ValueIndex::kLegacyStruct: |
628 | 2 | return std::forward<Visitor>(visitor)(Get<LegacyStructValue>()); |
629 | 0 | case ValueIndex::kParsedMessage: |
630 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedMessageValue>()); |
631 | 0 | case ValueIndex::kCustomStruct: |
632 | 0 | return std::forward<Visitor>(visitor)(Get<CustomStructValue>()); |
633 | 0 | case ValueIndex::kOpaque: |
634 | 0 | return std::forward<Visitor>(visitor)(Get<OpaqueValue>()); |
635 | 3.01k | case ValueIndex::kBytes: |
636 | 3.01k | return std::forward<Visitor>(visitor)(Get<BytesValue>()); |
637 | 4.47k | case ValueIndex::kString: |
638 | 4.47k | return std::forward<Visitor>(visitor)(Get<StringValue>()); |
639 | 0 | case ValueIndex::kError: |
640 | 0 | return std::forward<Visitor>(visitor)(Get<ErrorValue>()); |
641 | 0 | case ValueIndex::kUnknown: |
642 | 0 | return std::forward<Visitor>(visitor)(Get<UnknownValue>()); |
643 | 121k | } |
644 | 121k | } Unexecuted instantiation: decltype(auto) cel::common_internal::ValueVariant::Visit<cel::NativeTypeTraits<cel::Value, void>::Id(cel::Value const&)::{lambda(auto:1 const&)#1}>(cel::NativeTypeTraits<cel::Value, void>::Id(cel::Value const&)::{lambda(auto:1 const&)#1}&&) const &decltype(auto) cel::common_internal::ValueVariant::Visit<cel::ArenaTraits<cel::Value>::trivially_destructible(cel::Value const&)::{lambda(auto:1 const&)#1}>(cel::ArenaTraits<cel::Value>::trivially_destructible(cel::Value const&)::{lambda(auto:1 const&)#1}&&) const &Line | Count | Source | 593 | 104k | decltype(auto) Visit(Visitor&& visitor) const& { | 594 | 104k | switch (index_) { | 595 | 105 | case ValueIndex::kNull: | 596 | 105 | return std::forward<Visitor>(visitor)(Get<NullValue>()); | 597 | 3.80k | case ValueIndex::kBool: | 598 | 3.80k | return std::forward<Visitor>(visitor)(Get<BoolValue>()); | 599 | 82.7k | case ValueIndex::kInt: | 600 | 82.7k | return std::forward<Visitor>(visitor)(Get<IntValue>()); | 601 | 2.83k | case ValueIndex::kUint: | 602 | 2.83k | return std::forward<Visitor>(visitor)(Get<UintValue>()); | 603 | 6.47k | case ValueIndex::kDouble: | 604 | 6.47k | return std::forward<Visitor>(visitor)(Get<DoubleValue>()); | 605 | 1 | case ValueIndex::kDuration: | 606 | 1 | return std::forward<Visitor>(visitor)(Get<DurationValue>()); | 607 | 0 | case ValueIndex::kTimestamp: | 608 | 0 | return std::forward<Visitor>(visitor)(Get<TimestampValue>()); | 609 | 1.91k | case ValueIndex::kType: | 610 | 1.91k | return std::forward<Visitor>(visitor)(Get<TypeValue>()); | 611 | 154 | case ValueIndex::kLegacyList: | 612 | 154 | return std::forward<Visitor>(visitor)(Get<LegacyListValue>()); | 613 | 0 | case ValueIndex::kParsedJsonList: | 614 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedJsonListValue>()); | 615 | 0 | case ValueIndex::kParsedRepeatedField: | 616 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedRepeatedFieldValue>()); | 617 | 2.14k | case ValueIndex::kCustomList: | 618 | 2.14k | return std::forward<Visitor>(visitor)(Get<CustomListValue>()); | 619 | 1 | case ValueIndex::kLegacyMap: | 620 | 1 | return std::forward<Visitor>(visitor)(Get<LegacyMapValue>()); | 621 | 0 | case ValueIndex::kParsedJsonMap: | 622 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedJsonMapValue>()); | 623 | 0 | case ValueIndex::kParsedMapField: | 624 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedMapFieldValue>()); | 625 | 527 | case ValueIndex::kCustomMap: | 626 | 527 | return std::forward<Visitor>(visitor)(Get<CustomMapValue>()); | 627 | 1 | case ValueIndex::kLegacyStruct: | 628 | 1 | return std::forward<Visitor>(visitor)(Get<LegacyStructValue>()); | 629 | 0 | case ValueIndex::kParsedMessage: | 630 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedMessageValue>()); | 631 | 0 | case ValueIndex::kCustomStruct: | 632 | 0 | return std::forward<Visitor>(visitor)(Get<CustomStructValue>()); | 633 | 0 | case ValueIndex::kOpaque: | 634 | 0 | return std::forward<Visitor>(visitor)(Get<OpaqueValue>()); | 635 | 2.68k | case ValueIndex::kBytes: | 636 | 2.68k | return std::forward<Visitor>(visitor)(Get<BytesValue>()); | 637 | 1.55k | case ValueIndex::kString: | 638 | 1.55k | return std::forward<Visitor>(visitor)(Get<StringValue>()); | 639 | 0 | case ValueIndex::kError: | 640 | 0 | return std::forward<Visitor>(visitor)(Get<ErrorValue>()); | 641 | 0 | case ValueIndex::kUnknown: | 642 | 0 | return std::forward<Visitor>(visitor)(Get<UnknownValue>()); | 643 | 104k | } | 644 | 104k | } |
Unexecuted instantiation: value.cc:decltype(auto) cel::common_internal::ValueVariant::Visit<cel::Value::GetTypeName() const::$_0>(cel::Value::GetTypeName() const::$_0&&) const & value.cc:decltype(auto) cel::common_internal::ValueVariant::Visit<cel::Value::DebugString() const::$_0>(cel::Value::DebugString() const::$_0&&) const & Line | Count | Source | 593 | 5.55k | decltype(auto) Visit(Visitor&& visitor) const& { | 594 | 5.55k | switch (index_) { | 595 | 0 | case ValueIndex::kNull: | 596 | 0 | return std::forward<Visitor>(visitor)(Get<NullValue>()); | 597 | 91 | case ValueIndex::kBool: | 598 | 91 | return std::forward<Visitor>(visitor)(Get<BoolValue>()); | 599 | 380 | case ValueIndex::kInt: | 600 | 380 | return std::forward<Visitor>(visitor)(Get<IntValue>()); | 601 | 459 | case ValueIndex::kUint: | 602 | 459 | return std::forward<Visitor>(visitor)(Get<UintValue>()); | 603 | 2.32k | case ValueIndex::kDouble: | 604 | 2.32k | return std::forward<Visitor>(visitor)(Get<DoubleValue>()); | 605 | 0 | case ValueIndex::kDuration: | 606 | 0 | return std::forward<Visitor>(visitor)(Get<DurationValue>()); | 607 | 0 | case ValueIndex::kTimestamp: | 608 | 0 | return std::forward<Visitor>(visitor)(Get<TimestampValue>()); | 609 | 0 | case ValueIndex::kType: | 610 | 0 | return std::forward<Visitor>(visitor)(Get<TypeValue>()); | 611 | 0 | case ValueIndex::kLegacyList: | 612 | 0 | return std::forward<Visitor>(visitor)(Get<LegacyListValue>()); | 613 | 0 | case ValueIndex::kParsedJsonList: | 614 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedJsonListValue>()); | 615 | 0 | case ValueIndex::kParsedRepeatedField: | 616 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedRepeatedFieldValue>()); | 617 | 0 | case ValueIndex::kCustomList: | 618 | 0 | return std::forward<Visitor>(visitor)(Get<CustomListValue>()); | 619 | 0 | case ValueIndex::kLegacyMap: | 620 | 0 | return std::forward<Visitor>(visitor)(Get<LegacyMapValue>()); | 621 | 0 | case ValueIndex::kParsedJsonMap: | 622 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedJsonMapValue>()); | 623 | 0 | case ValueIndex::kParsedMapField: | 624 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedMapFieldValue>()); | 625 | 0 | case ValueIndex::kCustomMap: | 626 | 0 | return std::forward<Visitor>(visitor)(Get<CustomMapValue>()); | 627 | 0 | case ValueIndex::kLegacyStruct: | 628 | 0 | return std::forward<Visitor>(visitor)(Get<LegacyStructValue>()); | 629 | 0 | case ValueIndex::kParsedMessage: | 630 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedMessageValue>()); | 631 | 0 | case ValueIndex::kCustomStruct: | 632 | 0 | return std::forward<Visitor>(visitor)(Get<CustomStructValue>()); | 633 | 0 | case ValueIndex::kOpaque: | 634 | 0 | return std::forward<Visitor>(visitor)(Get<OpaqueValue>()); | 635 | 0 | case ValueIndex::kBytes: | 636 | 0 | return std::forward<Visitor>(visitor)(Get<BytesValue>()); | 637 | 2.30k | case ValueIndex::kString: | 638 | 2.30k | return std::forward<Visitor>(visitor)(Get<StringValue>()); | 639 | 0 | case ValueIndex::kError: | 640 | 0 | return std::forward<Visitor>(visitor)(Get<ErrorValue>()); | 641 | 0 | case ValueIndex::kUnknown: | 642 | 0 | return std::forward<Visitor>(visitor)(Get<UnknownValue>()); | 643 | 5.55k | } | 644 | 5.55k | } |
Unexecuted instantiation: value.cc:decltype(auto) cel::common_internal::ValueVariant::Visit<cel::Value::SerializeTo(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::io::ZeroCopyOutputStream*) const::$_0>(cel::Value::SerializeTo(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::io::ZeroCopyOutputStream*) const::$_0&&) const & Unexecuted instantiation: value.cc:decltype(auto) cel::common_internal::ValueVariant::Visit<cel::Value::ConvertToJson(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_0>(cel::Value::ConvertToJson(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_0&&) const & Unexecuted instantiation: value.cc:decltype(auto) cel::common_internal::ValueVariant::Visit<absl::lts_20260107::Overload<cel::Value::ConvertToJsonArray(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_0, cel::Value::ConvertToJsonArray(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_1, cel::Value::ConvertToJsonArray(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_2, cel::Value::ConvertToJsonArray(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_3, cel::Value::ConvertToJsonArray(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_4, cel::Value::ConvertToJsonArray(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_5> >(absl::lts_20260107::Overload<cel::Value::ConvertToJsonArray(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_0, cel::Value::ConvertToJsonArray(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_1, cel::Value::ConvertToJsonArray(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_2, cel::Value::ConvertToJsonArray(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_3, cel::Value::ConvertToJsonArray(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_4, cel::Value::ConvertToJsonArray(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_5>&&) const & Unexecuted instantiation: value.cc:decltype(auto) cel::common_internal::ValueVariant::Visit<absl::lts_20260107::Overload<cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_0, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_1, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_2, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_3, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_4, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_5, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_6, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_7, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_8> >(absl::lts_20260107::Overload<cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_0, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_1, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_2, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_3, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_4, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_5, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_6, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_7, cel::Value::ConvertToJsonObject(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_8>&&) const & value.cc:decltype(auto) cel::common_internal::ValueVariant::Visit<cel::Value::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0>(cel::Value::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0&&) const & Line | Count | Source | 593 | 11.4k | decltype(auto) Visit(Visitor&& visitor) const& { | 594 | 11.4k | switch (index_) { | 595 | 7 | case ValueIndex::kNull: | 596 | 7 | return std::forward<Visitor>(visitor)(Get<NullValue>()); | 597 | 1.13k | case ValueIndex::kBool: | 598 | 1.13k | return std::forward<Visitor>(visitor)(Get<BoolValue>()); | 599 | 6.04k | case ValueIndex::kInt: | 600 | 6.04k | return std::forward<Visitor>(visitor)(Get<IntValue>()); | 601 | 1.74k | case ValueIndex::kUint: | 602 | 1.74k | return std::forward<Visitor>(visitor)(Get<UintValue>()); | 603 | 1.14k | case ValueIndex::kDouble: | 604 | 1.14k | return std::forward<Visitor>(visitor)(Get<DoubleValue>()); | 605 | 0 | case ValueIndex::kDuration: | 606 | 0 | return std::forward<Visitor>(visitor)(Get<DurationValue>()); | 607 | 0 | case ValueIndex::kTimestamp: | 608 | 0 | return std::forward<Visitor>(visitor)(Get<TimestampValue>()); | 609 | 79 | case ValueIndex::kType: | 610 | 79 | return std::forward<Visitor>(visitor)(Get<TypeValue>()); | 611 | 26 | case ValueIndex::kLegacyList: | 612 | 26 | return std::forward<Visitor>(visitor)(Get<LegacyListValue>()); | 613 | 0 | case ValueIndex::kParsedJsonList: | 614 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedJsonListValue>()); | 615 | 0 | case ValueIndex::kParsedRepeatedField: | 616 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedRepeatedFieldValue>()); | 617 | 276 | case ValueIndex::kCustomList: | 618 | 276 | return std::forward<Visitor>(visitor)(Get<CustomListValue>()); | 619 | 0 | case ValueIndex::kLegacyMap: | 620 | 0 | return std::forward<Visitor>(visitor)(Get<LegacyMapValue>()); | 621 | 0 | case ValueIndex::kParsedJsonMap: | 622 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedJsonMapValue>()); | 623 | 0 | case ValueIndex::kParsedMapField: | 624 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedMapFieldValue>()); | 625 | 46 | case ValueIndex::kCustomMap: | 626 | 46 | return std::forward<Visitor>(visitor)(Get<CustomMapValue>()); | 627 | 1 | case ValueIndex::kLegacyStruct: | 628 | 1 | return std::forward<Visitor>(visitor)(Get<LegacyStructValue>()); | 629 | 0 | case ValueIndex::kParsedMessage: | 630 | 0 | return std::forward<Visitor>(visitor)(Get<ParsedMessageValue>()); | 631 | 0 | case ValueIndex::kCustomStruct: | 632 | 0 | return std::forward<Visitor>(visitor)(Get<CustomStructValue>()); | 633 | 0 | case ValueIndex::kOpaque: | 634 | 0 | return std::forward<Visitor>(visitor)(Get<OpaqueValue>()); | 635 | 333 | case ValueIndex::kBytes: | 636 | 333 | return std::forward<Visitor>(visitor)(Get<BytesValue>()); | 637 | 619 | case ValueIndex::kString: | 638 | 619 | return std::forward<Visitor>(visitor)(Get<StringValue>()); | 639 | 0 | case ValueIndex::kError: | 640 | 0 | return std::forward<Visitor>(visitor)(Get<ErrorValue>()); | 641 | 0 | case ValueIndex::kUnknown: | 642 | 0 | return std::forward<Visitor>(visitor)(Get<UnknownValue>()); | 643 | 11.4k | } | 644 | 11.4k | } |
Unexecuted instantiation: value.cc:decltype(auto) cel::common_internal::ValueVariant::Visit<cel::Value::IsZeroValue() const::$_0>(cel::Value::IsZeroValue() const::$_0&&) const & Unexecuted instantiation: value.cc:decltype(auto) cel::common_internal::ValueVariant::Visit<cel::Value::Clone(google::protobuf::Arena*) const::$_0>(cel::Value::Clone(google::protobuf::Arena*) const::$_0&&) const & Unexecuted instantiation: value.cc:decltype(auto) cel::common_internal::ValueVariant::Visit<cel::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, cel::Value const&)::$_0>(cel::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, cel::Value const&)::$_0&&) const & |
645 | | |
646 | | template <typename Visitor> |
647 | | decltype(auto) Visit(Visitor&& visitor) && { |
648 | | switch (index_) { |
649 | | case ValueIndex::kNull: |
650 | | return std::forward<Visitor>(visitor)( |
651 | | std::move(*this).Get<NullValue>()); |
652 | | case ValueIndex::kBool: |
653 | | return std::forward<Visitor>(visitor)( |
654 | | std::move(*this).Get<BoolValue>()); |
655 | | case ValueIndex::kInt: |
656 | | return std::forward<Visitor>(visitor)(std::move(*this).Get<IntValue>()); |
657 | | case ValueIndex::kUint: |
658 | | return std::forward<Visitor>(visitor)( |
659 | | std::move(*this).Get<UintValue>()); |
660 | | case ValueIndex::kDouble: |
661 | | return std::forward<Visitor>(visitor)( |
662 | | std::move(*this).Get<DoubleValue>()); |
663 | | case ValueIndex::kDuration: |
664 | | return std::forward<Visitor>(visitor)( |
665 | | std::move(*this).Get<DurationValue>()); |
666 | | case ValueIndex::kTimestamp: |
667 | | return std::forward<Visitor>(visitor)( |
668 | | std::move(*this).Get<TimestampValue>()); |
669 | | case ValueIndex::kType: |
670 | | return std::forward<Visitor>(visitor)( |
671 | | std::move(*this).Get<TypeValue>()); |
672 | | case ValueIndex::kLegacyList: |
673 | | return std::forward<Visitor>(visitor)( |
674 | | std::move(*this).Get<LegacyListValue>()); |
675 | | case ValueIndex::kParsedJsonList: |
676 | | return std::forward<Visitor>(visitor)( |
677 | | std::move(*this).Get<ParsedJsonListValue>()); |
678 | | case ValueIndex::kParsedRepeatedField: |
679 | | return std::forward<Visitor>(visitor)( |
680 | | std::move(*this).Get<ParsedRepeatedFieldValue>()); |
681 | | case ValueIndex::kCustomList: |
682 | | return std::forward<Visitor>(visitor)( |
683 | | std::move(*this).Get<CustomListValue>()); |
684 | | case ValueIndex::kLegacyMap: |
685 | | return std::forward<Visitor>(visitor)( |
686 | | std::move(*this).Get<LegacyMapValue>()); |
687 | | case ValueIndex::kParsedJsonMap: |
688 | | return std::forward<Visitor>(visitor)( |
689 | | std::move(*this).Get<ParsedJsonMapValue>()); |
690 | | case ValueIndex::kParsedMapField: |
691 | | return std::forward<Visitor>(visitor)( |
692 | | std::move(*this).Get<ParsedMapFieldValue>()); |
693 | | case ValueIndex::kCustomMap: |
694 | | return std::forward<Visitor>(visitor)( |
695 | | std::move(*this).Get<CustomMapValue>()); |
696 | | case ValueIndex::kLegacyStruct: |
697 | | return std::forward<Visitor>(visitor)( |
698 | | std::move(*this).Get<LegacyStructValue>()); |
699 | | case ValueIndex::kParsedMessage: |
700 | | return std::forward<Visitor>(visitor)( |
701 | | std::move(*this).Get<ParsedMessageValue>()); |
702 | | case ValueIndex::kCustomStruct: |
703 | | return std::forward<Visitor>(visitor)( |
704 | | std::move(*this).Get<CustomStructValue>()); |
705 | | case ValueIndex::kOpaque: |
706 | | return std::forward<Visitor>(visitor)( |
707 | | std::move(*this).Get<OpaqueValue>()); |
708 | | case ValueIndex::kBytes: |
709 | | return std::forward<Visitor>(visitor)( |
710 | | std::move(*this).Get<BytesValue>()); |
711 | | case ValueIndex::kString: |
712 | | return std::forward<Visitor>(visitor)( |
713 | | std::move(*this).Get<StringValue>()); |
714 | | case ValueIndex::kError: |
715 | | return std::forward<Visitor>(visitor)( |
716 | | std::move(*this).Get<ErrorValue>()); |
717 | | case ValueIndex::kUnknown: |
718 | | return std::forward<Visitor>(visitor)( |
719 | | std::move(*this).Get<UnknownValue>()); |
720 | | } |
721 | | } |
722 | | |
723 | | template <typename Visitor> |
724 | | ABSL_ATTRIBUTE_ALWAYS_INLINE decltype(auto) Visit(Visitor&& visitor) const&& { |
725 | | return Visit(std::forward<Visitor>(visitor)); |
726 | | } |
727 | | |
728 | 0 | friend void swap(ValueVariant& lhs, ValueVariant& rhs) noexcept { |
729 | 0 | if (&lhs != &rhs) { |
730 | 0 | const bool lhs_trivial = |
731 | 0 | (lhs.flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone; |
732 | 0 | const bool rhs_trivial = |
733 | 0 | (rhs.flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone; |
734 | 0 | if (lhs_trivial && rhs_trivial) { |
735 | | // We validated the instances can be copied byte-wise at runtime, but compilers |
736 | | // warn since this is not safe in the general case. |
737 | | #if defined(__GNUC__) && !defined(__clang__) |
738 | | #pragma GCC diagnostic push |
739 | | #pragma GCC diagnostic ignored "-Wclass-memaccess" |
740 | | #elif defined(__clang__) && __clang_major__ >= 20 |
741 | | #pragma clang diagnostic push |
742 | 0 | #pragma clang diagnostic ignored "-Wnontrivial-memcall" |
743 | 0 | #endif |
744 | 0 | alignas(ValueVariant) std::byte tmp[sizeof(ValueVariant)]; |
745 | | // NOLINTNEXTLINE(bugprone-undefined-memory-manipulation) |
746 | 0 | std::memcpy(tmp, std::addressof(lhs), sizeof(ValueVariant)); |
747 | | // NOLINTNEXTLINE(bugprone-undefined-memory-manipulation) |
748 | 0 | std::memcpy(std::addressof(lhs), std::addressof(rhs), |
749 | 0 | sizeof(ValueVariant)); |
750 | | // NOLINTNEXTLINE(bugprone-undefined-memory-manipulation) |
751 | 0 | std::memcpy(std::addressof(rhs), tmp, sizeof(ValueVariant)); |
752 | | #if defined(__GNUC__) && !defined(__clang__) |
753 | | #pragma GCC diagnostic pop |
754 | | #elif defined(__clang__) && __clang_major__ >= 20 |
755 | | #pragma clang diagnostic pop |
756 | 0 | #endif |
757 | 0 | } else { |
758 | 0 | SlowSwap(lhs, rhs, lhs_trivial, rhs_trivial); |
759 | 0 | } |
760 | 0 | } |
761 | 0 | } |
762 | | |
763 | | private: |
764 | | friend struct cel::ArenaTraits<ValueVariant>; |
765 | | |
766 | | template <typename T> |
767 | | ABSL_ATTRIBUTE_ALWAYS_INLINE T* absl_nonnull At() |
768 | 1.10M | ABSL_ATTRIBUTE_LIFETIME_BOUND { |
769 | 1.10M | static_assert(alignof(T) <= kValueVariantAlign); |
770 | 1.10M | static_assert(sizeof(T) <= kValueVariantSize); |
771 | | |
772 | 1.10M | return std::launder(reinterpret_cast<T*>(&raw_[0])); |
773 | 1.10M | } cel::ErrorValue* cel::common_internal::ValueVariant::At<cel::ErrorValue>() Line | Count | Source | 768 | 1.00M | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 769 | 1.00M | static_assert(alignof(T) <= kValueVariantAlign); | 770 | 1.00M | static_assert(sizeof(T) <= kValueVariantSize); | 771 | | | 772 | 1.00M | return std::launder(reinterpret_cast<T*>(&raw_[0])); | 773 | 1.00M | } |
Unexecuted instantiation: cel::UnknownValue* cel::common_internal::ValueVariant::At<cel::UnknownValue>() cel::StringValue* cel::common_internal::ValueVariant::At<cel::StringValue>() Line | Count | Source | 768 | 49.7k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 769 | 49.7k | static_assert(alignof(T) <= kValueVariantAlign); | 770 | 49.7k | static_assert(sizeof(T) <= kValueVariantSize); | 771 | | | 772 | 49.7k | return std::launder(reinterpret_cast<T*>(&raw_[0])); | 773 | 49.7k | } |
cel::BytesValue* cel::common_internal::ValueVariant::At<cel::BytesValue>() Line | Count | Source | 768 | 51.9k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 769 | 51.9k | static_assert(alignof(T) <= kValueVariantAlign); | 770 | 51.9k | static_assert(sizeof(T) <= kValueVariantSize); | 771 | | | 772 | 51.9k | return std::launder(reinterpret_cast<T*>(&raw_[0])); | 773 | 51.9k | } |
Unexecuted instantiation: cel::common_internal::LegacyListValue* cel::common_internal::ValueVariant::At<cel::common_internal::LegacyListValue>() Unexecuted instantiation: cel::CustomListValue* cel::common_internal::ValueVariant::At<cel::CustomListValue>() Unexecuted instantiation: cel::ParsedRepeatedFieldValue* cel::common_internal::ValueVariant::At<cel::ParsedRepeatedFieldValue>() Unexecuted instantiation: cel::ParsedJsonListValue* cel::common_internal::ValueVariant::At<cel::ParsedJsonListValue>() Unexecuted instantiation: cel::common_internal::LegacyMapValue* cel::common_internal::ValueVariant::At<cel::common_internal::LegacyMapValue>() Unexecuted instantiation: cel::CustomMapValue* cel::common_internal::ValueVariant::At<cel::CustomMapValue>() Unexecuted instantiation: cel::ParsedMapFieldValue* cel::common_internal::ValueVariant::At<cel::ParsedMapFieldValue>() Unexecuted instantiation: cel::ParsedJsonMapValue* cel::common_internal::ValueVariant::At<cel::ParsedJsonMapValue>() Unexecuted instantiation: cel::ParsedMessageValue* cel::common_internal::ValueVariant::At<cel::ParsedMessageValue>() Unexecuted instantiation: cel::OpaqueValue* cel::common_internal::ValueVariant::At<cel::OpaqueValue>() Unexecuted instantiation: cel::CustomStructValue* cel::common_internal::ValueVariant::At<cel::CustomStructValue>() Unexecuted instantiation: cel::common_internal::LegacyStructValue* cel::common_internal::ValueVariant::At<cel::common_internal::LegacyStructValue>() Unexecuted instantiation: cel::TypeValue* cel::common_internal::ValueVariant::At<cel::TypeValue>() |
774 | | |
775 | | template <typename T> |
776 | | ABSL_ATTRIBUTE_ALWAYS_INLINE const T* absl_nonnull At() const |
777 | 363k | ABSL_ATTRIBUTE_LIFETIME_BOUND { |
778 | 363k | static_assert(alignof(T) <= kValueVariantAlign); |
779 | 363k | static_assert(sizeof(T) <= kValueVariantSize); |
780 | | |
781 | 363k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); |
782 | 363k | } Unexecuted instantiation: cel::OpaqueValue const* cel::common_internal::ValueVariant::At<cel::OpaqueValue>() const cel::BoolValue const* cel::common_internal::ValueVariant::At<cel::BoolValue>() const Line | Count | Source | 777 | 29.5k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 29.5k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 29.5k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 29.5k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 29.5k | } |
cel::NullValue const* cel::common_internal::ValueVariant::At<cel::NullValue>() const Line | Count | Source | 777 | 112 | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 112 | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 112 | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 112 | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 112 | } |
cel::IntValue const* cel::common_internal::ValueVariant::At<cel::IntValue>() const Line | Count | Source | 777 | 125k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 125k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 125k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 125k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 125k | } |
cel::UintValue const* cel::common_internal::ValueVariant::At<cel::UintValue>() const Line | Count | Source | 777 | 20.3k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 20.3k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 20.3k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 20.3k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 20.3k | } |
cel::DoubleValue const* cel::common_internal::ValueVariant::At<cel::DoubleValue>() const Line | Count | Source | 777 | 24.7k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 24.7k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 24.7k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 24.7k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 24.7k | } |
cel::DurationValue const* cel::common_internal::ValueVariant::At<cel::DurationValue>() const Line | Count | Source | 777 | 7 | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 7 | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 7 | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 7 | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 7 | } |
cel::TimestampValue const* cel::common_internal::ValueVariant::At<cel::TimestampValue>() const Line | Count | Source | 777 | 2 | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 2 | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 2 | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 2 | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 2 | } |
cel::TypeValue const* cel::common_internal::ValueVariant::At<cel::TypeValue>() const Line | Count | Source | 777 | 2.01k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 2.01k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 2.01k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 2.01k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 2.01k | } |
cel::common_internal::LegacyListValue const* cel::common_internal::ValueVariant::At<cel::common_internal::LegacyListValue>() const Line | Count | Source | 777 | 182 | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 182 | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 182 | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 182 | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 182 | } |
Unexecuted instantiation: cel::ParsedJsonListValue const* cel::common_internal::ValueVariant::At<cel::ParsedJsonListValue>() const Unexecuted instantiation: cel::ParsedRepeatedFieldValue const* cel::common_internal::ValueVariant::At<cel::ParsedRepeatedFieldValue>() const cel::CustomListValue const* cel::common_internal::ValueVariant::At<cel::CustomListValue>() const Line | Count | Source | 777 | 12.2k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 12.2k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 12.2k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 12.2k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 12.2k | } |
cel::common_internal::LegacyMapValue const* cel::common_internal::ValueVariant::At<cel::common_internal::LegacyMapValue>() const Line | Count | Source | 777 | 668 | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 668 | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 668 | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 668 | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 668 | } |
Unexecuted instantiation: cel::ParsedJsonMapValue const* cel::common_internal::ValueVariant::At<cel::ParsedJsonMapValue>() const Unexecuted instantiation: cel::ParsedMapFieldValue const* cel::common_internal::ValueVariant::At<cel::ParsedMapFieldValue>() const cel::CustomMapValue const* cel::common_internal::ValueVariant::At<cel::CustomMapValue>() const Line | Count | Source | 777 | 6.33k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 6.33k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 6.33k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 6.33k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 6.33k | } |
cel::common_internal::LegacyStructValue const* cel::common_internal::ValueVariant::At<cel::common_internal::LegacyStructValue>() const Line | Count | Source | 777 | 287 | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 287 | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 287 | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 287 | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 287 | } |
Unexecuted instantiation: cel::ParsedMessageValue const* cel::common_internal::ValueVariant::At<cel::ParsedMessageValue>() const Unexecuted instantiation: cel::CustomStructValue const* cel::common_internal::ValueVariant::At<cel::CustomStructValue>() const cel::BytesValue const* cel::common_internal::ValueVariant::At<cel::BytesValue>() const Line | Count | Source | 777 | 10.2k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 10.2k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 10.2k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 10.2k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 10.2k | } |
cel::StringValue const* cel::common_internal::ValueVariant::At<cel::StringValue>() const Line | Count | Source | 777 | 22.3k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 22.3k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 22.3k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 22.3k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 22.3k | } |
cel::ErrorValue const* cel::common_internal::ValueVariant::At<cel::ErrorValue>() const Line | Count | Source | 777 | 108k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 108k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 108k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 108k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 108k | } |
Unexecuted instantiation: cel::UnknownValue const* cel::common_internal::ValueVariant::At<cel::UnknownValue>() const |
783 | | |
784 | | ABSL_ATTRIBUTE_ALWAYS_INLINE void FastCopyAssign( |
785 | 164k | const ValueVariant& other) noexcept { |
786 | 164k | index_ = other.index_; |
787 | 164k | kind_ = other.kind_; |
788 | 164k | flags_ = other.flags_; |
789 | 164k | std::memcpy(raw_, other.raw_, sizeof(raw_)); |
790 | 164k | } |
791 | | |
792 | | ABSL_ATTRIBUTE_ALWAYS_INLINE void FastMoveAssign( |
793 | 55.4k | ValueVariant& other) noexcept { |
794 | 55.4k | FastCopyAssign(other); |
795 | 55.4k | } |
796 | | |
797 | | void SlowCopyConstruct(const ValueVariant& other) noexcept; |
798 | | |
799 | | void SlowMoveConstruct(ValueVariant& other) noexcept; |
800 | | |
801 | | void SlowDestruct() noexcept; |
802 | | |
803 | | void SlowCopyAssign(const ValueVariant& other, bool trivial, |
804 | | bool other_trivial) noexcept; |
805 | | |
806 | | void SlowMoveAssign(ValueVariant& other, bool ntrivial, |
807 | | bool other_trivial) noexcept; |
808 | | |
809 | | static void SlowSwap(ValueVariant& lhs, ValueVariant& rhs, bool lhs_trivial, |
810 | | bool rhs_trivial) noexcept; |
811 | | |
812 | | ValueIndex index_ = ValueIndex::kNull; |
813 | | ValueKind kind_ = ValueKind::kNull; |
814 | | ValueFlags flags_ = ValueFlags::kNone; |
815 | | alignas(kValueVariantAlign) std::byte raw_[kValueVariantSize]; |
816 | | }; |
817 | | |
818 | | } // namespace common_internal |
819 | | |
820 | | template <> |
821 | | struct ArenaTraits<common_internal::ValueVariant> { |
822 | | static bool trivially_destructible( |
823 | 0 | const common_internal::ValueVariant& value) { |
824 | 0 | return (value.flags_ & common_internal::ValueFlags::kNonTrivial) == |
825 | 0 | common_internal::ValueFlags::kNone; |
826 | 0 | } |
827 | | }; |
828 | | |
829 | | } // namespace cel |
830 | | |
831 | | #endif // THIRD_PARTY_CEL_CPP_COMMON_VALUES_VALUE_VARIANT_H_ |