/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 | 89.8M | ValueFlags lhs, ValueFlags rhs) { |
105 | 89.8M | return static_cast<ValueFlags>( |
106 | 89.8M | static_cast<std::underlying_type_t<ValueFlags>>(lhs) & |
107 | 89.8M | static_cast<std::underlying_type_t<ValueFlags>>(rhs)); |
108 | 89.8M | } |
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 | 696k | static constexpr ValueFlags Flags(const NullValue* absl_nonnull) { |
137 | 696k | return ValueFlags::kNone; |
138 | 696k | } |
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 | 604k | static constexpr ValueFlags Flags(const BoolValue* absl_nonnull) { |
148 | 604k | return ValueFlags::kNone; |
149 | 604k | } |
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 | 610k | static constexpr ValueFlags Flags(const IntValue* absl_nonnull) { |
159 | 610k | return ValueFlags::kNone; |
160 | 610k | } |
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 | 28.8k | static constexpr ValueFlags Flags(const UintValue* absl_nonnull) { |
170 | 28.8k | return ValueFlags::kNone; |
171 | 28.8k | } |
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 | 60.1k | static constexpr ValueFlags Flags(const DoubleValue* absl_nonnull) { |
181 | 60.1k | return ValueFlags::kNone; |
182 | 60.1k | } |
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 | 2.95k | static constexpr ValueFlags Flags(const DurationValue* absl_nonnull) { |
192 | 2.95k | return ValueFlags::kNone; |
193 | 2.95k | } |
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 | 387 | static constexpr ValueFlags Flags(const TimestampValue* absl_nonnull) { |
203 | 387 | return ValueFlags::kNone; |
204 | 387 | } |
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 | 9.65k | static constexpr ValueFlags Flags(const TypeValue* absl_nonnull) { |
214 | 9.65k | return ValueFlags::kNone; |
215 | 9.65k | } |
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 | 2.27k | static constexpr ValueFlags Flags(const LegacyListValue* absl_nonnull) { |
225 | 2.27k | return ValueFlags::kNone; |
226 | 2.27k | } |
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 | 200k | static constexpr ValueFlags Flags(const CustomListValue* absl_nonnull) { |
259 | 200k | return ValueFlags::kNone; |
260 | 200k | } |
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 | 207k | static constexpr ValueFlags Flags(const LegacyMapValue* absl_nonnull) { |
270 | 207k | return ValueFlags::kNone; |
271 | 207k | } |
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 | 62.6k | static constexpr ValueFlags Flags(const CustomMapValue* absl_nonnull) { |
303 | 62.6k | return ValueFlags::kNone; |
304 | 62.6k | } |
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 | 26.4k | static constexpr ValueFlags Flags(const LegacyStructValue* absl_nonnull) { |
314 | 26.4k | return ValueFlags::kNone; |
315 | 26.4k | } |
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 | 97.3k | static ValueFlags Flags(const BytesValue* absl_nonnull alternative) { |
358 | 97.3k | return ArenaTraits<BytesValue>::trivially_destructible(*alternative) |
359 | 97.3k | ? ValueFlags::kNone |
360 | 97.3k | : ValueFlags::kNonTrivial; |
361 | 97.3k | } |
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 | 140k | static ValueFlags Flags(const StringValue* absl_nonnull alternative) { |
371 | 140k | return ArenaTraits<StringValue>::trivially_destructible(*alternative) |
372 | 140k | ? ValueFlags::kNone |
373 | 140k | : ValueFlags::kNonTrivial; |
374 | 140k | } |
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 | 2.82M | static ValueFlags Flags(const ErrorValue* absl_nonnull alternative) { |
384 | 2.82M | return ArenaTraits<ErrorValue>::trivially_destructible(*alternative) |
385 | 2.82M | ? ValueFlags::kNone |
386 | 2.82M | : ValueFlags::kNonTrivial; |
387 | 2.82M | } |
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 | 3.84M | ValueVariant() = default; |
431 | | |
432 | | ValueVariant(const ValueVariant& other) noexcept |
433 | 11.2M | : index_(other.index_), kind_(other.kind_), flags_(other.flags_) { |
434 | 11.2M | if ((flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone) { |
435 | 6.86M | std::memcpy(raw_, other.raw_, sizeof(raw_)); |
436 | 6.86M | } else { |
437 | 4.42M | SlowCopyConstruct(other); |
438 | 4.42M | } |
439 | 11.2M | } |
440 | | |
441 | | ValueVariant(ValueVariant&& other) noexcept |
442 | 19.7M | : index_(other.index_), kind_(other.kind_), flags_(other.flags_) { |
443 | 19.7M | if ((flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone) { |
444 | 8.74M | std::memcpy(raw_, other.raw_, sizeof(raw_)); |
445 | 11.0M | } else { |
446 | 11.0M | SlowMoveConstruct(other); |
447 | 11.0M | } |
448 | 19.7M | } |
449 | | |
450 | 36.6M | ~ValueVariant() { |
451 | 36.6M | if ((flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNonTrivial) { |
452 | 20.6M | SlowDestruct(); |
453 | 20.6M | } |
454 | 36.6M | } |
455 | | |
456 | 1.62M | ValueVariant& operator=(const ValueVariant& other) noexcept { |
457 | 1.62M | if (this != &other) { |
458 | 1.62M | const bool trivial = |
459 | 1.62M | (flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone; |
460 | 1.62M | const bool other_trivial = |
461 | 1.62M | (other.flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone; |
462 | 1.62M | if (trivial && other_trivial) { |
463 | 769k | FastCopyAssign(other); |
464 | 855k | } else { |
465 | 855k | SlowCopyAssign(other, trivial, other_trivial); |
466 | 855k | } |
467 | 1.62M | } |
468 | 1.62M | return *this; |
469 | 1.62M | } |
470 | | |
471 | 7.83M | ValueVariant& operator=(ValueVariant&& other) noexcept { |
472 | 7.83M | if (this != &other) { |
473 | 7.83M | const bool trivial = |
474 | 7.83M | (flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone; |
475 | 7.83M | const bool other_trivial = |
476 | 7.83M | (other.flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone; |
477 | 7.83M | if (trivial && other_trivial) { |
478 | 1.77M | FastMoveAssign(other); |
479 | 6.06M | } else { |
480 | 6.06M | SlowMoveAssign(other, trivial, other_trivial); |
481 | 6.06M | } |
482 | 7.83M | } |
483 | 7.83M | return *this; |
484 | 7.83M | } |
485 | | |
486 | | template <typename T, typename... Args> |
487 | | explicit ValueVariant(absl::in_place_type_t<T>, Args&&... args) |
488 | 2.40M | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { |
489 | 2.40M | static_assert(alignof(T) <= kValueVariantAlign); |
490 | 2.40M | static_assert(sizeof(T) <= kValueVariantSize); |
491 | | |
492 | 2.40M | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) |
493 | 2.40M | T(std::forward<Args>(args)...)); |
494 | 2.40M | } cel::common_internal::ValueVariant::ValueVariant<cel::BoolValue, cel::BoolValue>(std::__1::in_place_type_t<cel::BoolValue>, cel::BoolValue&&) Line | Count | Source | 488 | 555k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 555k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 555k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 555k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 555k | T(std::forward<Args>(args)...)); | 494 | 555k | } |
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 | 452k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 452k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 452k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 452k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 452k | T(std::forward<Args>(args)...)); | 494 | 452k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::IntValue, cel::IntValue>(std::__1::in_place_type_t<cel::IntValue>, cel::IntValue&&) Line | Count | Source | 488 | 599k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 599k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 599k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 599k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 599k | T(std::forward<Args>(args)...)); | 494 | 599k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::UintValue, cel::UintValue>(std::__1::in_place_type_t<cel::UintValue>, cel::UintValue&&) Line | Count | Source | 488 | 28.0k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 28.0k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 28.0k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 28.0k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 28.0k | T(std::forward<Args>(args)...)); | 494 | 28.0k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::StringValue, cel::StringValue>(std::__1::in_place_type_t<cel::StringValue>, cel::StringValue&&) Line | Count | Source | 488 | 17.4k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 17.4k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 17.4k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 17.4k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 17.4k | T(std::forward<Args>(args)...)); | 494 | 17.4k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::TypeValue, cel::TypeValue>(std::__1::in_place_type_t<cel::TypeValue>, cel::TypeValue&&) Line | Count | Source | 488 | 9.65k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 9.65k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 9.65k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 9.65k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 9.65k | T(std::forward<Args>(args)...)); | 494 | 9.65k | } |
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 | 120k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 120k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 120k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 120k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 120k | T(std::forward<Args>(args)...)); | 494 | 120k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::NullValue, cel::NullValue>(std::__1::in_place_type_t<cel::NullValue>, cel::NullValue&&) Line | Count | Source | 488 | 476 | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 476 | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 476 | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 476 | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 476 | T(std::forward<Args>(args)...)); | 494 | 476 | } |
cel::common_internal::ValueVariant::ValueVariant<cel::DoubleValue, cel::DoubleValue>(std::__1::in_place_type_t<cel::DoubleValue>, cel::DoubleValue&&) Line | Count | Source | 488 | 60.0k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 60.0k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 60.0k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 60.0k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 60.0k | T(std::forward<Args>(args)...)); | 494 | 60.0k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::BytesValue, cel::BytesValue>(std::__1::in_place_type_t<cel::BytesValue>, cel::BytesValue&&) Line | Count | Source | 488 | 87.7k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 87.7k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 87.7k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 87.7k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 87.7k | T(std::forward<Args>(args)...)); | 494 | 87.7k | } |
cel::common_internal::ValueVariant::ValueVariant<cel::DurationValue, cel::DurationValue>(std::__1::in_place_type_t<cel::DurationValue>, cel::DurationValue&&) Line | Count | Source | 488 | 2.93k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 2.93k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 2.93k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 2.93k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 2.93k | T(std::forward<Args>(args)...)); | 494 | 2.93k | } |
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 | 200k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 200k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 200k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 200k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 200k | T(std::forward<Args>(args)...)); | 494 | 200k | } |
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 | 2.27k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 2.27k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 2.27k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 2.27k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 2.27k | T(std::forward<Args>(args)...)); | 494 | 2.27k | } |
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 | 62.6k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 62.6k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 62.6k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 62.6k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 62.6k | T(std::forward<Args>(args)...)); | 494 | 62.6k | } |
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 | 207k | : index_(ValueAlternative<T>::kIndex), kind_(ValueAlternative<T>::kKind) { | 489 | 207k | static_assert(alignof(T) <= kValueVariantAlign); | 490 | 207k | static_assert(sizeof(T) <= kValueVariantSize); | 491 | | | 492 | 207k | flags_ = ValueAlternative<T>::Flags(::new (static_cast<void*>(&raw_[0])) | 493 | 207k | T(std::forward<Args>(args)...)); | 494 | 207k | } |
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 | 473k | : ValueVariant(absl::in_place_type<absl::remove_cvref_t<T>>, |
500 | 473k | 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 | 200k | : ValueVariant(absl::in_place_type<absl::remove_cvref_t<T>>, | 500 | 200k | 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 | 2.27k | : ValueVariant(absl::in_place_type<absl::remove_cvref_t<T>>, | 500 | 2.27k | 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 | 62.6k | : ValueVariant(absl::in_place_type<absl::remove_cvref_t<T>>, | 500 | 62.6k | 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 | 207k | : ValueVariant(absl::in_place_type<absl::remove_cvref_t<T>>, | 500 | 207k | 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 | 37.6M | ValueKind kind() const { return kind_; } |
503 | | |
504 | | template <typename T> |
505 | 3.17M | void Assign(T&& value) { |
506 | 3.17M | using U = absl::remove_cvref_t<T>; |
507 | | |
508 | 3.17M | static_assert(alignof(U) <= kValueVariantAlign); |
509 | 3.17M | static_assert(sizeof(U) <= kValueVariantSize); |
510 | | |
511 | 3.17M | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { |
512 | 783k | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { |
513 | 60.1k | SlowDestruct(); |
514 | 60.1k | } |
515 | 783k | index_ = ValueAlternative<U>::kIndex; |
516 | 783k | kind_ = ValueAlternative<U>::kKind; |
517 | 783k | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) |
518 | 783k | U(std::forward<T>(value))); |
519 | 2.38M | } 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 | 2.38M | if (index_ == ValueAlternative<U>::kIndex) { |
524 | 214 | *At<U>() = std::forward<T>(value); |
525 | 214 | flags_ = ValueAlternative<U>::Flags(At<U>()); |
526 | 2.38M | } else { |
527 | 2.38M | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { |
528 | 206 | SlowDestruct(); |
529 | 206 | } |
530 | 2.38M | index_ = ValueAlternative<U>::kIndex; |
531 | 2.38M | kind_ = ValueAlternative<U>::kKind; |
532 | 2.38M | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) |
533 | 2.38M | U(std::forward<T>(value))); |
534 | 2.38M | } |
535 | 2.38M | } |
536 | 3.17M | } 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 | 2.37M | void Assign(T&& value) { | 506 | 2.37M | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 2.37M | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 2.37M | 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 | 2.37M | } 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 | 2.37M | if (index_ == ValueAlternative<U>::kIndex) { | 524 | 214 | *At<U>() = std::forward<T>(value); | 525 | 214 | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | 2.37M | } else { | 527 | 2.37M | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | 206 | SlowDestruct(); | 529 | 206 | } | 530 | 2.37M | index_ = ValueAlternative<U>::kIndex; | 531 | 2.37M | kind_ = ValueAlternative<U>::kKind; | 532 | 2.37M | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | 2.37M | U(std::forward<T>(value))); | 534 | 2.37M | } | 535 | 2.37M | } | 536 | 2.37M | } |
void cel::common_internal::ValueVariant::Assign<cel::NullValue>(cel::NullValue&&) Line | Count | Source | 505 | 696k | void Assign(T&& value) { | 506 | 696k | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 696k | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 696k | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 696k | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 696k | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 59.6k | SlowDestruct(); | 514 | 59.6k | } | 515 | 696k | index_ = ValueAlternative<U>::kIndex; | 516 | 696k | kind_ = ValueAlternative<U>::kKind; | 517 | 696k | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 696k | 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 | 696k | } |
void cel::common_internal::ValueVariant::Assign<cel::BoolValue>(cel::BoolValue&&) Line | Count | Source | 505 | 48.9k | void Assign(T&& value) { | 506 | 48.9k | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 48.9k | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 48.9k | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 48.9k | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 48.9k | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 525 | SlowDestruct(); | 514 | 525 | } | 515 | 48.9k | index_ = ValueAlternative<U>::kIndex; | 516 | 48.9k | kind_ = ValueAlternative<U>::kKind; | 517 | 48.9k | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 48.9k | 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.9k | } |
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.8k | void Assign(T&& value) { | 506 | 10.8k | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 10.8k | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 10.8k | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 10.8k | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 10.8k | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 0 | SlowDestruct(); | 514 | 0 | } | 515 | 10.8k | index_ = ValueAlternative<U>::kIndex; | 516 | 10.8k | kind_ = ValueAlternative<U>::kKind; | 517 | 10.8k | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 10.8k | 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.8k | } |
void cel::common_internal::ValueVariant::Assign<cel::UintValue>(cel::UintValue&&) Line | Count | Source | 505 | 788 | void Assign(T&& value) { | 506 | 788 | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 788 | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 788 | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 788 | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 788 | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 0 | SlowDestruct(); | 514 | 0 | } | 515 | 788 | index_ = ValueAlternative<U>::kIndex; | 516 | 788 | kind_ = ValueAlternative<U>::kKind; | 517 | 788 | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 788 | 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 | 788 | } |
void cel::common_internal::ValueVariant::Assign<cel::DoubleValue>(cel::DoubleValue&&) Line | Count | Source | 505 | 131 | void Assign(T&& value) { | 506 | 131 | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 131 | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 131 | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 131 | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 131 | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 0 | SlowDestruct(); | 514 | 0 | } | 515 | 131 | index_ = ValueAlternative<U>::kIndex; | 516 | 131 | kind_ = ValueAlternative<U>::kKind; | 517 | 131 | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 131 | 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 | 131 | } |
void cel::common_internal::ValueVariant::Assign<cel::DurationValue>(cel::DurationValue&&) Line | Count | Source | 505 | 15 | void Assign(T&& value) { | 506 | 15 | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 15 | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 15 | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 15 | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 15 | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 0 | SlowDestruct(); | 514 | 0 | } | 515 | 15 | index_ = ValueAlternative<U>::kIndex; | 516 | 15 | kind_ = ValueAlternative<U>::kKind; | 517 | 15 | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 15 | 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 | 15 | } |
void cel::common_internal::ValueVariant::Assign<cel::TimestampValue>(cel::TimestampValue&&) Line | Count | Source | 505 | 386 | void Assign(T&& value) { | 506 | 386 | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 386 | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 386 | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 386 | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 386 | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 0 | SlowDestruct(); | 514 | 0 | } | 515 | 386 | index_ = ValueAlternative<U>::kIndex; | 516 | 386 | kind_ = ValueAlternative<U>::kKind; | 517 | 386 | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 386 | 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 | 386 | } |
void cel::common_internal::ValueVariant::Assign<cel::StringValue>(cel::StringValue&&) Line | Count | Source | 505 | 2.95k | void Assign(T&& value) { | 506 | 2.95k | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 2.95k | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 2.95k | 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 | 2.95k | } 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 | 2.95k | if (index_ == ValueAlternative<U>::kIndex) { | 524 | 0 | *At<U>() = std::forward<T>(value); | 525 | 0 | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | 2.95k | } else { | 527 | 2.95k | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | 0 | SlowDestruct(); | 529 | 0 | } | 530 | 2.95k | index_ = ValueAlternative<U>::kIndex; | 531 | 2.95k | kind_ = ValueAlternative<U>::kKind; | 532 | 2.95k | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | 2.95k | U(std::forward<T>(value))); | 534 | 2.95k | } | 535 | 2.95k | } | 536 | 2.95k | } |
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 | 9.62k | void Assign(T&& value) { | 506 | 9.62k | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 9.62k | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 9.62k | 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 | 9.62k | } 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 | 9.62k | if (index_ == ValueAlternative<U>::kIndex) { | 524 | 0 | *At<U>() = std::forward<T>(value); | 525 | 0 | flags_ = ValueAlternative<U>::Flags(At<U>()); | 526 | 9.62k | } else { | 527 | 9.62k | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 528 | 0 | SlowDestruct(); | 529 | 0 | } | 530 | 9.62k | index_ = ValueAlternative<U>::kIndex; | 531 | 9.62k | kind_ = ValueAlternative<U>::kKind; | 532 | 9.62k | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 533 | 9.62k | U(std::forward<T>(value))); | 534 | 9.62k | } | 535 | 9.62k | } | 536 | 9.62k | } |
void cel::common_internal::ValueVariant::Assign<cel::common_internal::LegacyStructValue>(cel::common_internal::LegacyStructValue&&) Line | Count | Source | 505 | 26.4k | void Assign(T&& value) { | 506 | 26.4k | using U = absl::remove_cvref_t<T>; | 507 | | | 508 | 26.4k | static_assert(alignof(U) <= kValueVariantAlign); | 509 | 26.4k | static_assert(sizeof(U) <= kValueVariantSize); | 510 | | | 511 | 26.4k | if constexpr (ValueAlternative<U>::kAlwaysTrivial) { | 512 | 26.4k | if ((flags_ & ValueFlags::kNonTrivial) != ValueFlags::kNone) { | 513 | 0 | SlowDestruct(); | 514 | 0 | } | 515 | 26.4k | index_ = ValueAlternative<U>::kIndex; | 516 | 26.4k | kind_ = ValueAlternative<U>::kKind; | 517 | 26.4k | flags_ = ValueAlternative<U>::Flags(::new (static_cast<void*>(&raw_[0])) | 518 | 26.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 | 26.4k | } |
Unexecuted instantiation: void cel::common_internal::ValueVariant::Assign<cel::TypeValue>(cel::TypeValue&&) |
537 | | |
538 | | template <typename T> |
539 | 22.3M | bool Is() const { |
540 | 22.3M | return index_ == ValueAlternative<T>::kIndex; |
541 | 22.3M | } bool cel::common_internal::ValueVariant::Is<cel::BoolValue>() const Line | Count | Source | 539 | 536k | bool Is() const { | 540 | 536k | return index_ == ValueAlternative<T>::kIndex; | 541 | 536k | } |
bool cel::common_internal::ValueVariant::Is<cel::BytesValue>() const Line | Count | Source | 539 | 175k | bool Is() const { | 540 | 175k | return index_ == ValueAlternative<T>::kIndex; | 541 | 175k | } |
bool cel::common_internal::ValueVariant::Is<cel::DoubleValue>() const Line | Count | Source | 539 | 612k | bool Is() const { | 540 | 612k | return index_ == ValueAlternative<T>::kIndex; | 541 | 612k | } |
bool cel::common_internal::ValueVariant::Is<cel::DurationValue>() const Line | Count | Source | 539 | 1.95k | bool Is() const { | 540 | 1.95k | return index_ == ValueAlternative<T>::kIndex; | 541 | 1.95k | } |
bool cel::common_internal::ValueVariant::Is<cel::ErrorValue>() const Line | Count | Source | 539 | 12.6M | bool Is() const { | 540 | 12.6M | return index_ == ValueAlternative<T>::kIndex; | 541 | 12.6M | } |
bool cel::common_internal::ValueVariant::Is<cel::IntValue>() const Line | Count | Source | 539 | 1.73M | bool Is() const { | 540 | 1.73M | return index_ == ValueAlternative<T>::kIndex; | 541 | 1.73M | } |
bool cel::common_internal::ValueVariant::Is<cel::common_internal::LegacyListValue>() const Line | Count | Source | 539 | 153k | bool Is() const { | 540 | 153k | return index_ == ValueAlternative<T>::kIndex; | 541 | 153k | } |
bool cel::common_internal::ValueVariant::Is<cel::CustomListValue>() const Line | Count | Source | 539 | 150k | bool Is() const { | 540 | 150k | return index_ == ValueAlternative<T>::kIndex; | 541 | 150k | } |
bool cel::common_internal::ValueVariant::Is<cel::ParsedRepeatedFieldValue>() const Line | Count | Source | 539 | 14.4k | bool Is() const { | 540 | 14.4k | return index_ == ValueAlternative<T>::kIndex; | 541 | 14.4k | } |
bool cel::common_internal::ValueVariant::Is<cel::ParsedJsonListValue>() const Line | Count | Source | 539 | 14.4k | bool Is() const { | 540 | 14.4k | return index_ == ValueAlternative<T>::kIndex; | 541 | 14.4k | } |
bool cel::common_internal::ValueVariant::Is<cel::common_internal::LegacyMapValue>() const Line | Count | Source | 539 | 472k | bool Is() const { | 540 | 472k | return index_ == ValueAlternative<T>::kIndex; | 541 | 472k | } |
bool cel::common_internal::ValueVariant::Is<cel::CustomMapValue>() const Line | Count | Source | 539 | 169k | bool Is() const { | 540 | 169k | return index_ == ValueAlternative<T>::kIndex; | 541 | 169k | } |
bool cel::common_internal::ValueVariant::Is<cel::ParsedMapFieldValue>() const Line | Count | Source | 539 | 84.5k | bool Is() const { | 540 | 84.5k | return index_ == ValueAlternative<T>::kIndex; | 541 | 84.5k | } |
bool cel::common_internal::ValueVariant::Is<cel::ParsedJsonMapValue>() const Line | Count | Source | 539 | 84.5k | bool Is() const { | 540 | 84.5k | return index_ == ValueAlternative<T>::kIndex; | 541 | 84.5k | } |
bool cel::common_internal::ValueVariant::Is<cel::ParsedMessageValue>() const Line | Count | Source | 539 | 64.0k | bool Is() const { | 540 | 64.0k | return index_ == ValueAlternative<T>::kIndex; | 541 | 64.0k | } |
bool cel::common_internal::ValueVariant::Is<cel::NullValue>() const Line | Count | Source | 539 | 19 | bool Is() const { | 540 | 19 | return index_ == ValueAlternative<T>::kIndex; | 541 | 19 | } |
Unexecuted instantiation: bool cel::common_internal::ValueVariant::Is<cel::OpaqueValue>() const bool cel::common_internal::ValueVariant::Is<cel::CustomStructValue>() const Line | Count | Source | 539 | 64.0k | bool Is() const { | 540 | 64.0k | return index_ == ValueAlternative<T>::kIndex; | 541 | 64.0k | } |
bool cel::common_internal::ValueVariant::Is<cel::StringValue>() const Line | Count | Source | 539 | 39.5k | bool Is() const { | 540 | 39.5k | return index_ == ValueAlternative<T>::kIndex; | 541 | 39.5k | } |
bool cel::common_internal::ValueVariant::Is<cel::common_internal::LegacyStructValue>() const Line | Count | Source | 539 | 116k | bool Is() const { | 540 | 116k | return index_ == ValueAlternative<T>::kIndex; | 541 | 116k | } |
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 | 11 | bool Is() const { | 540 | 11 | return index_ == ValueAlternative<T>::kIndex; | 541 | 11 | } |
bool cel::common_internal::ValueVariant::Is<cel::UintValue>() const Line | Count | Source | 539 | 602k | bool Is() const { | 540 | 602k | return index_ == ValueAlternative<T>::kIndex; | 541 | 602k | } |
bool cel::common_internal::ValueVariant::Is<cel::UnknownValue>() const Line | Count | Source | 539 | 4.56M | bool Is() const { | 540 | 4.56M | return index_ == ValueAlternative<T>::kIndex; | 541 | 4.56M | } |
|
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 | 4.96M | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { |
552 | 4.96M | ABSL_DCHECK(Is<T>()); |
553 | | |
554 | 4.96M | return *At<T>(); |
555 | 4.96M | } cel::BoolValue const& cel::common_internal::ValueVariant::Get<cel::BoolValue>() const & Line | Count | Source | 551 | 803k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 803k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 803k | return *At<T>(); | 555 | 803k | } |
cel::NullValue const& cel::common_internal::ValueVariant::Get<cel::NullValue>() const & Line | Count | Source | 551 | 116 | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 116 | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 116 | return *At<T>(); | 555 | 116 | } |
cel::IntValue const& cel::common_internal::ValueVariant::Get<cel::IntValue>() const & Line | Count | Source | 551 | 2.63M | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 2.63M | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 2.63M | return *At<T>(); | 555 | 2.63M | } |
cel::UintValue const& cel::common_internal::ValueVariant::Get<cel::UintValue>() const & Line | Count | Source | 551 | 493k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 493k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 493k | return *At<T>(); | 555 | 493k | } |
cel::DoubleValue const& cel::common_internal::ValueVariant::Get<cel::DoubleValue>() const & Line | Count | Source | 551 | 496k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 496k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 496k | return *At<T>(); | 555 | 496k | } |
cel::DurationValue const& cel::common_internal::ValueVariant::Get<cel::DurationValue>() const & Line | Count | Source | 551 | 2.02k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 2.02k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 2.02k | return *At<T>(); | 555 | 2.02k | } |
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 | 8.21k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 8.21k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 8.21k | return *At<T>(); | 555 | 8.21k | } |
cel::common_internal::LegacyListValue const& cel::common_internal::ValueVariant::Get<cel::common_internal::LegacyListValue>() const & Line | Count | Source | 551 | 1.82k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 1.82k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 1.82k | return *At<T>(); | 555 | 1.82k | } |
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 | 3.76k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 3.76k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 3.76k | return *At<T>(); | 555 | 3.76k | } |
cel::common_internal::LegacyMapValue const& cel::common_internal::ValueVariant::Get<cel::common_internal::LegacyMapValue>() const & Line | Count | Source | 551 | 17 | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 17 | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 17 | return *At<T>(); | 555 | 17 | } |
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 | 1.38k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 1.38k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 1.38k | return *At<T>(); | 555 | 1.38k | } |
cel::common_internal::LegacyStructValue const& cel::common_internal::ValueVariant::Get<cel::common_internal::LegacyStructValue>() const & Line | Count | Source | 551 | 26 | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 26 | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 26 | return *At<T>(); | 555 | 26 | } |
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 | 225k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 225k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 225k | return *At<T>(); | 555 | 225k | } |
cel::StringValue const& cel::common_internal::ValueVariant::Get<cel::StringValue>() const & Line | Count | Source | 551 | 289k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 289k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 289k | return *At<T>(); | 555 | 289k | } |
cel::ErrorValue const& cel::common_internal::ValueVariant::Get<cel::ErrorValue>() const & Line | Count | Source | 551 | 5.28k | const T& Get() const& ABSL_ATTRIBUTE_LIFETIME_BOUND { | 552 | 5.28k | ABSL_DCHECK(Is<T>()); | 553 | | | 554 | 5.28k | return *At<T>(); | 555 | 5.28k | } |
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 | 3.42M | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { |
581 | 3.42M | if (Is<T>()) { |
582 | 411k | return At<T>(); |
583 | 411k | } |
584 | 3.01M | return nullptr; |
585 | 3.42M | } 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 | 18.6k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 18.6k | if (Is<T>()) { | 582 | 18.1k | return At<T>(); | 583 | 18.1k | } | 584 | 490 | return nullptr; | 585 | 18.6k | } |
cel::BytesValue const* cel::common_internal::ValueVariant::As<cel::BytesValue>() const Line | Count | Source | 580 | 994 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 994 | if (Is<T>()) { | 582 | 807 | return At<T>(); | 583 | 807 | } | 584 | 187 | return nullptr; | 585 | 994 | } |
cel::DoubleValue const* cel::common_internal::ValueVariant::As<cel::DoubleValue>() const Line | Count | Source | 580 | 13.0k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 13.0k | if (Is<T>()) { | 582 | 4.64k | return At<T>(); | 583 | 4.64k | } | 584 | 8.43k | return nullptr; | 585 | 13.0k | } |
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 | 1.41M | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 1.41M | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 1.41M | return nullptr; | 585 | 1.41M | } |
cel::IntValue const* cel::common_internal::ValueVariant::As<cel::IntValue>() const Line | Count | Source | 580 | 12.5k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 12.5k | if (Is<T>()) { | 582 | 3.27k | return At<T>(); | 583 | 3.27k | } | 584 | 9.31k | return nullptr; | 585 | 12.5k | } |
cel::common_internal::LegacyListValue const* cel::common_internal::ValueVariant::As<cel::common_internal::LegacyListValue>() const Line | Count | Source | 580 | 98.8k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 98.8k | if (Is<T>()) { | 582 | 1.67k | return At<T>(); | 583 | 1.67k | } | 584 | 97.2k | return nullptr; | 585 | 98.8k | } |
cel::CustomListValue const* cel::common_internal::ValueVariant::As<cel::CustomListValue>() const Line | Count | Source | 580 | 97.4k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 97.4k | if (Is<T>()) { | 582 | 97.2k | return At<T>(); | 583 | 97.2k | } | 584 | 141 | return nullptr; | 585 | 97.4k | } |
cel::ParsedRepeatedFieldValue const* cel::common_internal::ValueVariant::As<cel::ParsedRepeatedFieldValue>() const Line | Count | Source | 580 | 141 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 141 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 141 | return nullptr; | 585 | 141 | } |
cel::ParsedJsonListValue const* cel::common_internal::ValueVariant::As<cel::ParsedJsonListValue>() const Line | Count | Source | 580 | 141 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 141 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 141 | return nullptr; | 585 | 141 | } |
cel::common_internal::LegacyMapValue const* cel::common_internal::ValueVariant::As<cel::common_internal::LegacyMapValue>() const Line | Count | Source | 580 | 253k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 253k | if (Is<T>()) { | 582 | 198k | return At<T>(); | 583 | 198k | } | 584 | 54.9k | return nullptr; | 585 | 253k | } |
cel::CustomMapValue const* cel::common_internal::ValueVariant::As<cel::CustomMapValue>() const Line | Count | Source | 580 | 55.0k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 55.0k | if (Is<T>()) { | 582 | 54.8k | return At<T>(); | 583 | 54.8k | } | 584 | 173 | return nullptr; | 585 | 55.0k | } |
cel::ParsedMapFieldValue const* cel::common_internal::ValueVariant::As<cel::ParsedMapFieldValue>() const Line | Count | Source | 580 | 173 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 173 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 173 | return nullptr; | 585 | 173 | } |
cel::ParsedJsonMapValue const* cel::common_internal::ValueVariant::As<cel::ParsedJsonMapValue>() const Line | Count | Source | 580 | 173 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 173 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 173 | return nullptr; | 585 | 173 | } |
cel::ParsedMessageValue const* cel::common_internal::ValueVariant::As<cel::ParsedMessageValue>() const Line | Count | Source | 580 | 12 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 12 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 12 | return nullptr; | 585 | 12 | } |
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 | 12 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 12 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 12 | return nullptr; | 585 | 12 | } |
cel::StringValue const* cel::common_internal::ValueVariant::As<cel::StringValue>() const Line | Count | Source | 580 | 481 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 481 | if (Is<T>()) { | 582 | 389 | return At<T>(); | 583 | 389 | } | 584 | 92 | return nullptr; | 585 | 481 | } |
cel::common_internal::LegacyStructValue const* cel::common_internal::ValueVariant::As<cel::common_internal::LegacyStructValue>() const Line | Count | Source | 580 | 26.4k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 26.4k | if (Is<T>()) { | 582 | 26.4k | return At<T>(); | 583 | 26.4k | } | 584 | 12 | return nullptr; | 585 | 26.4k | } |
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 | 11 | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 11 | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 11 | return nullptr; | 585 | 11 | } |
cel::UintValue const* cel::common_internal::ValueVariant::As<cel::UintValue>() const Line | Count | Source | 580 | 9.50k | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 9.50k | if (Is<T>()) { | 582 | 5.00k | return At<T>(); | 583 | 5.00k | } | 584 | 4.49k | return nullptr; | 585 | 9.50k | } |
cel::UnknownValue const* cel::common_internal::ValueVariant::As<cel::UnknownValue>() const Line | Count | Source | 580 | 1.41M | const T* absl_nullable As() const ABSL_ATTRIBUTE_LIFETIME_BOUND { | 581 | 1.41M | if (Is<T>()) { | 582 | 0 | return At<T>(); | 583 | 0 | } | 584 | 1.41M | return nullptr; | 585 | 1.41M | } |
|
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 | 1.46M | decltype(auto) Visit(Visitor&& visitor) const& { |
594 | 1.46M | switch (index_) { |
595 | 116 | case ValueIndex::kNull: |
596 | 116 | return std::forward<Visitor>(visitor)(Get<NullValue>()); |
597 | 105k | case ValueIndex::kBool: |
598 | 105k | return std::forward<Visitor>(visitor)(Get<BoolValue>()); |
599 | 1.04M | case ValueIndex::kInt: |
600 | 1.04M | return std::forward<Visitor>(visitor)(Get<IntValue>()); |
601 | 21.0k | case ValueIndex::kUint: |
602 | 21.0k | return std::forward<Visitor>(visitor)(Get<UintValue>()); |
603 | 97.7k | case ValueIndex::kDouble: |
604 | 97.7k | 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 | 8.08k | case ValueIndex::kType: |
610 | 8.08k | return std::forward<Visitor>(visitor)(Get<TypeValue>()); |
611 | 1.82k | case ValueIndex::kLegacyList: |
612 | 1.82k | 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 | 3.76k | case ValueIndex::kCustomList: |
618 | 3.76k | return std::forward<Visitor>(visitor)(Get<CustomListValue>()); |
619 | 16 | case ValueIndex::kLegacyMap: |
620 | 16 | 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 | 1.38k | case ValueIndex::kCustomMap: |
626 | 1.38k | return std::forward<Visitor>(visitor)(Get<CustomMapValue>()); |
627 | 24 | case ValueIndex::kLegacyStruct: |
628 | 24 | 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 | 47.5k | case ValueIndex::kBytes: |
636 | 47.5k | return std::forward<Visitor>(visitor)(Get<BytesValue>()); |
637 | 126k | case ValueIndex::kString: |
638 | 126k | 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 | 1.46M | } |
644 | 1.46M | } 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 | 1.30M | decltype(auto) Visit(Visitor&& visitor) const& { | 594 | 1.30M | switch (index_) { | 595 | 97 | case ValueIndex::kNull: | 596 | 97 | return std::forward<Visitor>(visitor)(Get<NullValue>()); | 597 | 103k | case ValueIndex::kBool: | 598 | 103k | return std::forward<Visitor>(visitor)(Get<BoolValue>()); | 599 | 1.03M | case ValueIndex::kInt: | 600 | 1.03M | return std::forward<Visitor>(visitor)(Get<IntValue>()); | 601 | 17.1k | case ValueIndex::kUint: | 602 | 17.1k | return std::forward<Visitor>(visitor)(Get<UintValue>()); | 603 | 83.7k | case ValueIndex::kDouble: | 604 | 83.7k | 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 | 8.06k | case ValueIndex::kType: | 610 | 8.06k | return std::forward<Visitor>(visitor)(Get<TypeValue>()); | 611 | 1.80k | case ValueIndex::kLegacyList: | 612 | 1.80k | 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 | 3.01k | case ValueIndex::kCustomList: | 618 | 3.01k | return std::forward<Visitor>(visitor)(Get<CustomListValue>()); | 619 | 9 | case ValueIndex::kLegacyMap: | 620 | 9 | 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 | 1.10k | case ValueIndex::kCustomMap: | 626 | 1.10k | return std::forward<Visitor>(visitor)(Get<CustomMapValue>()); | 627 | 12 | case ValueIndex::kLegacyStruct: | 628 | 12 | 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 | 46.5k | case ValueIndex::kBytes: | 636 | 46.5k | return std::forward<Visitor>(visitor)(Get<BytesValue>()); | 637 | 4.64k | case ValueIndex::kString: | 638 | 4.64k | 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 | 1.30M | } | 644 | 1.30M | } |
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 | 137k | decltype(auto) Visit(Visitor&& visitor) const& { | 594 | 137k | switch (index_) { | 595 | 0 | case ValueIndex::kNull: | 596 | 0 | return std::forward<Visitor>(visitor)(Get<NullValue>()); | 597 | 202 | case ValueIndex::kBool: | 598 | 202 | return std::forward<Visitor>(visitor)(Get<BoolValue>()); | 599 | 3.78k | case ValueIndex::kInt: | 600 | 3.78k | return std::forward<Visitor>(visitor)(Get<IntValue>()); | 601 | 398 | case ValueIndex::kUint: | 602 | 398 | return std::forward<Visitor>(visitor)(Get<UintValue>()); | 603 | 11.3k | case ValueIndex::kDouble: | 604 | 11.3k | 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 | 121k | case ValueIndex::kString: | 638 | 121k | 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 | 137k | } | 644 | 137k | } |
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_20260526::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_20260526::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_20260526::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_20260526::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 | 17.9k | decltype(auto) Visit(Visitor&& visitor) const& { | 594 | 17.9k | switch (index_) { | 595 | 19 | case ValueIndex::kNull: | 596 | 19 | return std::forward<Visitor>(visitor)(Get<NullValue>()); | 597 | 1.10k | case ValueIndex::kBool: | 598 | 1.10k | return std::forward<Visitor>(visitor)(Get<BoolValue>()); | 599 | 8.22k | case ValueIndex::kInt: | 600 | 8.22k | return std::forward<Visitor>(visitor)(Get<IntValue>()); | 601 | 3.45k | case ValueIndex::kUint: | 602 | 3.45k | return std::forward<Visitor>(visitor)(Get<UintValue>()); | 603 | 2.63k | case ValueIndex::kDouble: | 604 | 2.63k | 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 | 11 | case ValueIndex::kType: | 610 | 11 | return std::forward<Visitor>(visitor)(Get<TypeValue>()); | 611 | 14 | case ValueIndex::kLegacyList: | 612 | 14 | 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 | 756 | case ValueIndex::kCustomList: | 618 | 756 | return std::forward<Visitor>(visitor)(Get<CustomListValue>()); | 619 | 7 | case ValueIndex::kLegacyMap: | 620 | 7 | 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 | 281 | case ValueIndex::kCustomMap: | 626 | 281 | return std::forward<Visitor>(visitor)(Get<CustomMapValue>()); | 627 | 12 | case ValueIndex::kLegacyStruct: | 628 | 12 | 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 | 994 | case ValueIndex::kBytes: | 636 | 994 | return std::forward<Visitor>(visitor)(Get<BytesValue>()); | 637 | 481 | case ValueIndex::kString: | 638 | 481 | 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 | 17.9k | } | 644 | 17.9k | } |
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 | 53.7k | friend void swap(ValueVariant& lhs, ValueVariant& rhs) noexcept { |
729 | 53.7k | if (&lhs != &rhs) { |
730 | 53.7k | const bool lhs_trivial = |
731 | 53.7k | (lhs.flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone; |
732 | 53.7k | const bool rhs_trivial = |
733 | 53.7k | (rhs.flags_ & ValueFlags::kNonTrivial) == ValueFlags::kNone; |
734 | 53.7k | 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 | 1.88k | #pragma clang diagnostic ignored "-Wnontrivial-memcall" |
743 | 1.88k | #endif |
744 | 1.88k | alignas(ValueVariant) std::byte tmp[sizeof(ValueVariant)]; |
745 | | // NOLINTNEXTLINE(bugprone-undefined-memory-manipulation) |
746 | 1.88k | std::memcpy(tmp, std::addressof(lhs), sizeof(ValueVariant)); |
747 | | // NOLINTNEXTLINE(bugprone-undefined-memory-manipulation) |
748 | 1.88k | std::memcpy(std::addressof(lhs), std::addressof(rhs), |
749 | 1.88k | sizeof(ValueVariant)); |
750 | | // NOLINTNEXTLINE(bugprone-undefined-memory-manipulation) |
751 | 1.88k | 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 | 1.88k | #endif |
757 | 51.9k | } else { |
758 | 51.9k | SlowSwap(lhs, rhs, lhs_trivial, rhs_trivial); |
759 | 51.9k | } |
760 | 53.7k | } |
761 | 53.7k | } |
762 | | |
763 | | private: |
764 | | friend struct cel::ArenaTraits<ValueVariant>; |
765 | | |
766 | | template <typename T> |
767 | | ABSL_ATTRIBUTE_ALWAYS_INLINE T* absl_nonnull At() |
768 | 42.4M | ABSL_ATTRIBUTE_LIFETIME_BOUND { |
769 | 42.4M | static_assert(alignof(T) <= kValueVariantAlign); |
770 | 42.4M | static_assert(sizeof(T) <= kValueVariantSize); |
771 | | |
772 | 42.4M | return std::launder(reinterpret_cast<T*>(&raw_[0])); |
773 | 42.4M | } cel::ErrorValue* cel::common_internal::ValueVariant::At<cel::ErrorValue>() Line | Count | Source | 768 | 41.3M | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 769 | 41.3M | static_assert(alignof(T) <= kValueVariantAlign); | 770 | 41.3M | static_assert(sizeof(T) <= kValueVariantSize); | 771 | | | 772 | 41.3M | return std::launder(reinterpret_cast<T*>(&raw_[0])); | 773 | 41.3M | } |
Unexecuted instantiation: cel::UnknownValue* cel::common_internal::ValueVariant::At<cel::UnknownValue>() cel::StringValue* cel::common_internal::ValueVariant::At<cel::StringValue>() Line | Count | Source | 768 | 111k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 769 | 111k | static_assert(alignof(T) <= kValueVariantAlign); | 770 | 111k | static_assert(sizeof(T) <= kValueVariantSize); | 771 | | | 772 | 111k | return std::launder(reinterpret_cast<T*>(&raw_[0])); | 773 | 111k | } |
cel::BytesValue* cel::common_internal::ValueVariant::At<cel::BytesValue>() Line | Count | Source | 768 | 1.02M | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 769 | 1.02M | static_assert(alignof(T) <= kValueVariantAlign); | 770 | 1.02M | static_assert(sizeof(T) <= kValueVariantSize); | 771 | | | 772 | 1.02M | return std::launder(reinterpret_cast<T*>(&raw_[0])); | 773 | 1.02M | } |
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 | 10.6M | ABSL_ATTRIBUTE_LIFETIME_BOUND { |
778 | 10.6M | static_assert(alignof(T) <= kValueVariantAlign); |
779 | 10.6M | static_assert(sizeof(T) <= kValueVariantSize); |
780 | | |
781 | 10.6M | return std::launder(reinterpret_cast<const T*>(&raw_[0])); |
782 | 10.6M | } 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 | 822k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 822k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 822k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 822k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 822k | } |
cel::NullValue const* cel::common_internal::ValueVariant::At<cel::NullValue>() const Line | Count | Source | 777 | 116 | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 116 | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 116 | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 116 | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 116 | } |
cel::IntValue const* cel::common_internal::ValueVariant::At<cel::IntValue>() const Line | Count | Source | 777 | 2.63M | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 2.63M | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 2.63M | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 2.63M | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 2.63M | } |
cel::UintValue const* cel::common_internal::ValueVariant::At<cel::UintValue>() const Line | Count | Source | 777 | 498k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 498k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 498k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 498k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 498k | } |
cel::DoubleValue const* cel::common_internal::ValueVariant::At<cel::DoubleValue>() const Line | Count | Source | 777 | 500k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 500k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 500k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 500k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 500k | } |
cel::DurationValue const* cel::common_internal::ValueVariant::At<cel::DurationValue>() const Line | Count | Source | 777 | 2.02k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 2.02k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 2.02k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 2.02k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 2.02k | } |
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 | 8.21k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 8.21k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 8.21k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 8.21k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 8.21k | } |
cel::common_internal::LegacyListValue const* cel::common_internal::ValueVariant::At<cel::common_internal::LegacyListValue>() const Line | Count | Source | 777 | 3.50k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 3.50k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 3.50k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 3.50k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 3.50k | } |
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 | 101k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 101k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 101k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 101k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 101k | } |
cel::common_internal::LegacyMapValue const* cel::common_internal::ValueVariant::At<cel::common_internal::LegacyMapValue>() const Line | Count | Source | 777 | 198k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 198k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 198k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 198k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 198k | } |
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 | 56.2k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 56.2k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 56.2k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 56.2k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 56.2k | } |
cel::common_internal::LegacyStructValue const* cel::common_internal::ValueVariant::At<cel::common_internal::LegacyStructValue>() const Line | Count | Source | 777 | 26.4k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 26.4k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 26.4k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 26.4k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 26.4k | } |
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 | 344k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 344k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 344k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 344k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 344k | } |
cel::StringValue const* cel::common_internal::ValueVariant::At<cel::StringValue>() const Line | Count | Source | 777 | 311k | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 311k | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 311k | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 311k | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 311k | } |
cel::ErrorValue const* cel::common_internal::ValueVariant::At<cel::ErrorValue>() const Line | Count | Source | 777 | 5.15M | ABSL_ATTRIBUTE_LIFETIME_BOUND { | 778 | 5.15M | static_assert(alignof(T) <= kValueVariantAlign); | 779 | 5.15M | static_assert(sizeof(T) <= kValueVariantSize); | 780 | | | 781 | 5.15M | return std::launder(reinterpret_cast<const T*>(&raw_[0])); | 782 | 5.15M | } |
Unexecuted instantiation: cel::UnknownValue const* cel::common_internal::ValueVariant::At<cel::UnknownValue>() const |
783 | | |
784 | | ABSL_ATTRIBUTE_ALWAYS_INLINE void FastCopyAssign( |
785 | 2.55M | const ValueVariant& other) noexcept { |
786 | 2.55M | index_ = other.index_; |
787 | 2.55M | kind_ = other.kind_; |
788 | 2.55M | flags_ = other.flags_; |
789 | 2.55M | std::memcpy(raw_, other.raw_, sizeof(raw_)); |
790 | 2.55M | } |
791 | | |
792 | | ABSL_ATTRIBUTE_ALWAYS_INLINE void FastMoveAssign( |
793 | 1.78M | ValueVariant& other) noexcept { |
794 | 1.78M | FastCopyAssign(other); |
795 | 1.78M | } |
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_ |