Coverage Report

Created: 2026-05-27 07:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/proc/self/cwd/eval/public/cel_value.h
Line
Count
Source
1
#ifndef THIRD_PARTY_CEL_CPP_EVAL_PUBLIC_CEL_VALUE_H_
2
#define THIRD_PARTY_CEL_CPP_EVAL_PUBLIC_CEL_VALUE_H_
3
4
// CelValue is a holder, capable of storing all kinds of data
5
// supported by CEL.
6
// CelValue defines explicitly typed/named getters/setters.
7
// When storing pointers to objects, CelValue does not accept ownership
8
// to them and does not control their lifecycle. Instead objects are expected
9
// to be either external to expression evaluation, and controlled beyond the
10
// scope or to be allocated and associated with some allocation/ownership
11
// controller (Arena).
12
// Usage examples:
13
// (a) For primitive types:
14
//    CelValue value = CelValue::CreateInt64(1);
15
// (b) For string:
16
//    string* msg = google::protobuf::Arena::Create<string>(arena,"test");
17
//    CelValue value = CelValue::CreateString(msg);
18
// (c) For messages:
19
//    const MyMessage * msg = google::protobuf::Arena::Create<MyMessage>(arena);
20
//    CelValue value = CelProtoWrapper::CreateMessage(msg, &arena);
21
22
#include <cstdint>
23
24
#include "absl/base/attributes.h"
25
#include "absl/base/macros.h"
26
#include "absl/base/optimization.h"
27
#include "absl/log/absl_log.h"
28
#include "absl/status/status.h"
29
#include "absl/status/statusor.h"
30
#include "absl/strings/str_cat.h"
31
#include "absl/strings/string_view.h"
32
#include "absl/time/time.h"
33
#include "absl/types/optional.h"
34
#include "absl/types/variant.h"
35
#include "common/kind.h"
36
#include "common/memory.h"
37
#include "common/native_type.h"
38
#include "eval/public/cel_value_internal.h"
39
#include "eval/public/message_wrapper.h"
40
#include "eval/public/unknown_set.h"
41
#include "internal/casts.h"
42
#include "internal/status_macros.h"
43
#include "internal/utf8.h"
44
#include "google/protobuf/message.h"
45
46
namespace cel::interop_internal {
47
struct CelListAccess;
48
struct CelMapAccess;
49
}  // namespace cel::interop_internal
50
51
namespace google::api::expr::runtime {
52
53
using CelError = absl::Status;
54
55
// Break cyclic dependencies for container types.
56
class CelList;
57
class CelMap;
58
class LegacyTypeAdapter;
59
60
class CelValue {
61
 public:
62
  // This class is a container to hold strings/bytes.
63
  // Template parameter N is an artificial discriminator, used to create
64
  // distinct types for String and Bytes (we need distinct types for Oneof).
65
  template <int N>
66
  class StringHolderBase {
67
   public:
68
711
    StringHolderBase() : value_(absl::string_view()) {}
google::api::expr::runtime::CelValue::StringHolderBase<0>::StringHolderBase()
Line
Count
Source
68
711
    StringHolderBase() : value_(absl::string_view()) {}
Unexecuted instantiation: google::api::expr::runtime::CelValue::StringHolderBase<1>::StringHolderBase()
69
70
    StringHolderBase(const StringHolderBase&) = default;
71
    StringHolderBase& operator=(const StringHolderBase&) = default;
72
73
    // string parameter is passed through pointer to ensure string_view is not
74
    // initialized with string rvalue. Also, according to Google style guide,
75
    // passing pointers conveys the message that the reference to string is kept
76
    // in the constructed holder object.
77
140
    explicit StringHolderBase(const std::string* str) : value_(*str) {}
google::api::expr::runtime::CelValue::StringHolderBase<2>::StringHolderBase(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*)
Line
Count
Source
77
12
    explicit StringHolderBase(const std::string* str) : value_(*str) {}
google::api::expr::runtime::CelValue::StringHolderBase<0>::StringHolderBase(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*)
Line
Count
Source
77
26
    explicit StringHolderBase(const std::string* str) : value_(*str) {}
google::api::expr::runtime::CelValue::StringHolderBase<1>::StringHolderBase(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*)
Line
Count
Source
77
102
    explicit StringHolderBase(const std::string* str) : value_(*str) {}
78
79
576
    absl::string_view value() const { return value_; }
google::api::expr::runtime::CelValue::StringHolderBase<0>::value() const
Line
Count
Source
79
474
    absl::string_view value() const { return value_; }
google::api::expr::runtime::CelValue::StringHolderBase<1>::value() const
Line
Count
Source
79
102
    absl::string_view value() const { return value_; }
Unexecuted instantiation: google::api::expr::runtime::CelValue::StringHolderBase<2>::value() const
80
81
    // Group of comparison operations.
82
0
    friend bool operator==(StringHolderBase value1, StringHolderBase value2) {
83
0
      return value1.value_ == value2.value_;
84
0
    }
Unexecuted instantiation: google::api::expr::runtime::operator==(google::api::expr::runtime::CelValue::StringHolderBase<0>, google::api::expr::runtime::CelValue::StringHolderBase<0>)
Unexecuted instantiation: google::api::expr::runtime::operator==(google::api::expr::runtime::CelValue::StringHolderBase<1>, google::api::expr::runtime::CelValue::StringHolderBase<1>)
Unexecuted instantiation: google::api::expr::runtime::operator==(google::api::expr::runtime::CelValue::StringHolderBase<2>, google::api::expr::runtime::CelValue::StringHolderBase<2>)
85
86
    friend bool operator!=(StringHolderBase value1, StringHolderBase value2) {
87
      return value1.value_ != value2.value_;
88
    }
89
90
    friend bool operator<(StringHolderBase value1, StringHolderBase value2) {
91
      return value1.value_ < value2.value_;
92
    }
93
94
    friend bool operator<=(StringHolderBase value1, StringHolderBase value2) {
95
      return value1.value_ <= value2.value_;
96
    }
97
98
    friend bool operator>(StringHolderBase value1, StringHolderBase value2) {
99
      return value1.value_ > value2.value_;
100
    }
101
102
    friend bool operator>=(StringHolderBase value1, StringHolderBase value2) {
103
      return value1.value_ >= value2.value_;
104
    }
105
106
    friend class CelValue;
107
108
   private:
109
718
    explicit StringHolderBase(absl::string_view other) : value_(other) {}
google::api::expr::runtime::CelValue::StringHolderBase<0>::StringHolderBase(std::__1::basic_string_view<char, std::__1::char_traits<char> >)
Line
Count
Source
109
651
    explicit StringHolderBase(absl::string_view other) : value_(other) {}
google::api::expr::runtime::CelValue::StringHolderBase<1>::StringHolderBase(std::__1::basic_string_view<char, std::__1::char_traits<char> >)
Line
Count
Source
109
67
    explicit StringHolderBase(absl::string_view other) : value_(other) {}
Unexecuted instantiation: google::api::expr::runtime::CelValue::StringHolderBase<2>::StringHolderBase(std::__1::basic_string_view<char, std::__1::char_traits<char> >)
110
111
    absl::string_view value_;
112
  };
113
114
  // Helper structure for String datatype.
115
  using StringHolder = StringHolderBase<0>;
116
117
  // Helper structure for Bytes datatype.
118
  using BytesHolder = StringHolderBase<1>;
119
120
  // Helper structure for CelType datatype.
121
  using CelTypeHolder = StringHolderBase<2>;
122
123
  // Type for CEL Null values. Implemented as a monostate to behave well in
124
  // absl::variant.
125
  using NullType = absl::monostate;
126
127
  // GCC: fully qualified to avoid change of meaning error.
128
  using MessageWrapper = google::api::expr::runtime::MessageWrapper;
129
130
 private:
131
  // CelError MUST BE the last in the declaration - it is a ceiling for Type
132
  // enum
133
  using ValueHolder = internal::ValueHolder<
134
      NullType, bool, int64_t, uint64_t, double, StringHolder, BytesHolder,
135
      MessageWrapper, absl::Duration, absl::Time, const CelList*, const CelMap*,
136
      const UnknownSet*, CelTypeHolder, const CelError*>;
137
138
 public:
139
  // Metafunction providing positions corresponding to specific
140
  // types. If type is not supported, compile-time error will occur.
141
  template <class T>
142
  using IndexOf = ValueHolder::IndexOf<T>;
143
144
  // Enum for types supported.
145
  // This is not recommended for use in exhaustive switches in client code.
146
  // Types may be updated over time.
147
  using Type = ::cel::Kind;
148
149
  // Legacy enumeration that is here for testing purposes. Do not use.
150
  enum class LegacyType {
151
    kNullType = IndexOf<NullType>::value,
152
    kBool = IndexOf<bool>::value,
153
    kInt64 = IndexOf<int64_t>::value,
154
    kUint64 = IndexOf<uint64_t>::value,
155
    kDouble = IndexOf<double>::value,
156
    kString = IndexOf<StringHolder>::value,
157
    kBytes = IndexOf<BytesHolder>::value,
158
    kMessage = IndexOf<MessageWrapper>::value,
159
    kDuration = IndexOf<absl::Duration>::value,
160
    kTimestamp = IndexOf<absl::Time>::value,
161
    kList = IndexOf<const CelList*>::value,
162
    kMap = IndexOf<const CelMap*>::value,
163
    kUnknownSet = IndexOf<const UnknownSet*>::value,
164
    kCelType = IndexOf<CelTypeHolder>::value,
165
    kError = IndexOf<const CelError*>::value,
166
    kAny  // Special value. Used in function descriptors.
167
  };
168
169
  // Default constructor.
170
  // Creates CelValue with null data type.
171
0
  CelValue() : CelValue(NullType()) {}
172
173
  // Returns Type that describes the type of value stored.
174
2.36k
  Type type() const { return static_cast<Type>(value_.index()); }
175
176
  // Returns debug string describing a value
177
  const std::string DebugString() const;
178
179
  // We will use factory methods instead of public constructors
180
  // The reason for this is the high risk of implicit type conversions
181
  // between bool/int/pointer types.
182
  // We rely on copy elision to avoid extra copying.
183
44
  static CelValue CreateNull() { return CelValue(NullType()); }
184
185
  // Transitional factory for migrating to null types.
186
0
  static CelValue CreateNullTypedValue() { return CelValue(NullType()); }
187
188
3.36k
  static CelValue CreateBool(bool value) { return CelValue(value); }
189
190
643
  static CelValue CreateInt64(int64_t value) { return CelValue(value); }
191
192
351
  static CelValue CreateUint64(uint64_t value) { return CelValue(value); }
193
194
446
  static CelValue CreateDouble(double value) { return CelValue(value); }
195
196
0
  static CelValue CreateString(StringHolder holder) {
197
0
    ABSL_ASSERT(::cel::internal::Utf8IsValid(holder.value()));
198
0
    return CelValue(holder);
199
0
  }
200
201
  // Returns a string value from a string_view. Warning: the caller is
202
  // responsible for the lifecycle of the backing string. Prefer CreateString
203
  // instead.
204
651
  static CelValue CreateStringView(absl::string_view value) {
205
651
    return CelValue(StringHolder(value));
206
651
  }
207
208
26
  static CelValue CreateString(const std::string* str) {
209
26
    return CelValue(StringHolder(str));
210
26
  }
211
212
0
  static CelValue CreateBytes(BytesHolder holder) { return CelValue(holder); }
213
214
67
  static CelValue CreateBytesView(absl::string_view value) {
215
67
    return CelValue(BytesHolder(value));
216
67
  }
217
218
102
  static CelValue CreateBytes(const std::string* str) {
219
102
    return CelValue(BytesHolder(str));
220
102
  }
221
222
  static CelValue CreateDuration(absl::Duration value);
223
224
7
  static CelValue CreateUncheckedDuration(absl::Duration value) {
225
7
    return CelValue(value);
226
7
  }
227
228
49
  static CelValue CreateTimestamp(absl::Time value) { return CelValue(value); }
229
230
361
  static CelValue CreateList(const CelList* value) {
231
361
    CheckNullPointer(value, Type::kList);
232
361
    return CelValue(value);
233
361
  }
234
235
  // Creates a CelValue backed by an empty immutable list.
236
  static CelValue CreateList();
237
238
721
  static CelValue CreateMap(const CelMap* value) {
239
721
    CheckNullPointer(value, Type::kMap);
240
721
    return CelValue(value);
241
721
  }
242
243
  // Creates a CelValue backed by an empty immutable map.
244
  static CelValue CreateMap();
245
246
0
  static CelValue CreateUnknownSet(const UnknownSet* value) {
247
0
    CheckNullPointer(value, Type::kUnknownSet);
248
0
    return CelValue(value);
249
0
  }
250
251
12
  static CelValue CreateCelType(CelTypeHolder holder) {
252
12
    return CelValue(holder);
253
12
  }
254
255
0
  static CelValue CreateCelTypeView(absl::string_view value) {
256
    // This factory method is used for dealing with string references which
257
    // come from protobuf objects or other containers which promise pointer
258
    // stability. In general, this is a risky method to use and should not
259
    // be invoked outside the core CEL library.
260
0
    return CelValue(CelTypeHolder(value));
261
0
  }
262
263
5.58k
  static CelValue CreateError(const CelError* value) {
264
5.58k
    CheckNullPointer(value, Type::kError);
265
5.58k
    return CelValue(value);
266
5.58k
  }
267
268
  // Returns an absl::OkStatus() when the key is a valid protobuf map type,
269
  // meaning it is a scalar value that is neither floating point nor bytes.
270
  static absl::Status CheckMapKeyType(const CelValue& key);
271
272
  // Obtain the CelType of the value.
273
  CelValue ObtainCelType() const;
274
275
  // Methods for accessing values of specific type
276
  // They have the common usage pattern - prior to accessing the
277
  // value, the caller should check that the value of this type is indeed
278
  // stored in CelValue, using type() or Is...() methods.
279
280
  // Returns stored boolean value.
281
  // Fails if stored value type is not boolean.
282
1
  bool BoolOrDie() const { return GetValueOrDie<bool>(Type::kBool); }
283
284
  // Returns stored int64 value.
285
  // Fails if stored value type is not int64.
286
76
  int64_t Int64OrDie() const { return GetValueOrDie<int64_t>(Type::kInt64); }
287
288
  // Returns stored uint64 value.
289
  // Fails if stored value type is not uint64.
290
104
  uint64_t Uint64OrDie() const {
291
104
    return GetValueOrDie<uint64_t>(Type::kUint64);
292
104
  }
293
294
  // Returns stored double value.
295
  // Fails if stored value type is not double.
296
117
  double DoubleOrDie() const { return GetValueOrDie<double>(Type::kDouble); }
297
298
  // Returns stored const string* value.
299
  // Fails if stored value type is not const string*.
300
26
  StringHolder StringOrDie() const {
301
26
    return GetValueOrDie<StringHolder>(Type::kString);
302
26
  }
303
304
102
  BytesHolder BytesOrDie() const {
305
102
    return GetValueOrDie<BytesHolder>(Type::kBytes);
306
102
  }
307
308
  // Returns stored const Message* value.
309
  // Fails if stored value type is not const Message*.
310
0
  const google::protobuf::Message* MessageOrDie() const {
311
0
    MessageWrapper wrapped = MessageWrapperOrDie();
312
0
    ABSL_ASSERT(wrapped.HasFullProto());
313
0
    return static_cast<const google::protobuf::Message*>(wrapped.message_ptr());
314
0
  }
315
316
  ABSL_DEPRECATED("Use MessageOrDie")
317
289
  MessageWrapper MessageWrapperOrDie() const {
318
289
    return GetValueOrDie<MessageWrapper>(Type::kMessage);
319
289
  }
320
321
  // Returns stored duration value.
322
  // Fails if stored value type is not duration.
323
6
  const absl::Duration DurationOrDie() const {
324
6
    return GetValueOrDie<absl::Duration>(Type::kDuration);
325
6
  }
326
327
  // Returns stored timestamp value.
328
  // Fails if stored value type is not timestamp.
329
48
  const absl::Time TimestampOrDie() const {
330
48
    return GetValueOrDie<absl::Time>(Type::kTimestamp);
331
48
  }
332
333
  // Returns stored const CelList* value.
334
  // Fails if stored value type is not const CelList*.
335
87
  const CelList* ListOrDie() const {
336
87
    return GetValueOrDie<const CelList*>(Type::kList);
337
87
  }
338
339
  // Returns stored const CelMap * value.
340
  // Fails if stored value type is not const CelMap *.
341
677
  const CelMap* MapOrDie() const {
342
677
    return GetValueOrDie<const CelMap*>(Type::kMap);
343
677
  }
344
345
  // Returns stored const CelTypeHolder value.
346
  // Fails if stored value type is not CelTypeHolder.
347
0
  CelTypeHolder CelTypeOrDie() const {
348
0
    return GetValueOrDie<CelTypeHolder>(Type::kCelType);
349
0
  }
350
351
  // Returns stored const UnknownAttributeSet * value.
352
  // Fails if stored value type is not const UnknownAttributeSet *.
353
0
  const UnknownSet* UnknownSetOrDie() const {
354
0
    return GetValueOrDie<const UnknownSet*>(Type::kUnknownSet);
355
0
  }
356
357
  // Returns stored const CelError * value.
358
  // Fails if stored value type is not const CelError *.
359
528
  const CelError* ErrorOrDie() const {
360
528
    return GetValueOrDie<const CelError*>(Type::kError);
361
528
  }
362
363
0
  bool IsNull() const { return value_.template Visit<bool>(NullCheckOp()); }
364
365
0
  bool IsBool() const { return value_.is<bool>(); }
366
367
0
  bool IsInt64() const { return value_.is<int64_t>(); }
368
369
0
  bool IsUint64() const { return value_.is<uint64_t>(); }
370
371
0
  bool IsDouble() const { return value_.is<double>(); }
372
373
0
  bool IsString() const { return value_.is<StringHolder>(); }
374
375
0
  bool IsBytes() const { return value_.is<BytesHolder>(); }
376
377
0
  bool IsMessage() const { return value_.is<MessageWrapper>(); }
378
379
0
  bool IsDuration() const { return value_.is<absl::Duration>(); }
380
381
0
  bool IsTimestamp() const { return value_.is<absl::Time>(); }
382
383
0
  bool IsList() const { return value_.is<const CelList*>(); }
384
385
0
  bool IsMap() const { return value_.is<const CelMap*>(); }
386
387
0
  bool IsUnknownSet() const { return value_.is<const UnknownSet*>(); }
388
389
0
  bool IsCelType() const { return value_.is<CelTypeHolder>(); }
390
391
0
  bool IsError() const { return value_.is<const CelError*>(); }
392
393
  // Invokes op() with the active value, and returns the result.
394
  // All overloads of op() must have the same return type.
395
  // Note: this depends on the internals of CelValue, so use with caution.
396
  template <class ReturnType, class Op>
397
711
  ReturnType InternalVisit(Op&& op) const {
398
711
    return value_.template Visit<ReturnType>(std::forward<Op>(op));
399
711
  }
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::InternalVisit<bool, google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void> >(google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>&&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::InternalVisit<bool, google::api::expr::runtime::CelValue::AssignerOp<long, void> >(google::api::expr::runtime::CelValue::AssignerOp<long, void>&&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::InternalVisit<bool, google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void> >(google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>&&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::InternalVisit<bool, google::api::expr::runtime::CelValue::AssignerOp<double, void> >(google::api::expr::runtime::CelValue::AssignerOp<double, void>&&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::InternalVisit<bool, google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void> >(google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>&&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::InternalVisit<bool, google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void> >(google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>&&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::InternalVisit<bool, google::api::expr::runtime::CelValue::AssignerOp<bool, void> >(google::api::expr::runtime::CelValue::AssignerOp<bool, void>&&) const
bool google::api::expr::runtime::CelValue::InternalVisit<bool, google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void> >(google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>&&) const
Line
Count
Source
397
711
  ReturnType InternalVisit(Op&& op) const {
398
711
    return value_.template Visit<ReturnType>(std::forward<Op>(op));
399
711
  }
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::InternalVisit<bool, google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void> >(google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>&&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::InternalVisit<bool, google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void> >(google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>&&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::InternalVisit<bool, google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void> >(google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>&&) const
Unexecuted instantiation: cel_value.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > google::api::expr::runtime::CelValue::InternalVisit<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::api::expr::runtime::(anonymous namespace)::DebugStringVisitor>(google::api::expr::runtime::(anonymous namespace)::DebugStringVisitor&&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::InternalVisit<bool, google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void> >(google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>&&) const
400
401
  // Invokes op() with the active value, and returns the result.
402
  // All overloads of op() must have the same return type.
403
  // TODO(uncreated-issue/2): Move to CelProtoWrapper to retain the assumed
404
  // google::protobuf::Message variant version behavior for client code.
405
  template <class ReturnType, class Op>
406
  ReturnType Visit(Op&& op) const {
407
    return value_.template Visit<ReturnType>(
408
        internal::MessageVisitAdapter<Op, ReturnType>(std::forward<Op>(op)));
409
  }
410
411
  // Template-style getter.
412
  // Returns true, if assignment successful
413
  template <typename Arg>
414
711
  bool GetValue(Arg* value) const {
415
711
    return this->template InternalVisit<bool>(AssignerOp<Arg>(value));
416
711
  }
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::GetValue<google::api::expr::runtime::MessageWrapper>(google::api::expr::runtime::MessageWrapper*) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::GetValue<long>(long*) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::GetValue<unsigned long>(unsigned long*) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::GetValue<double>(double*) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::GetValue<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const**) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::GetValue<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const**) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::GetValue<bool>(bool*) const
bool google::api::expr::runtime::CelValue::GetValue<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0>*) const
Line
Count
Source
414
711
  bool GetValue(Arg* value) const {
415
711
    return this->template InternalVisit<bool>(AssignerOp<Arg>(value));
416
711
  }
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::GetValue<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1>*) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::GetValue<absl::lts_20260107::Duration>(absl::lts_20260107::Duration*) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::GetValue<absl::lts_20260107::Time>(absl::lts_20260107::Time*) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::GetValue<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const**) const
417
418
  // Provides type names for internal logging.
419
  static std::string TypeName(Type value_type);
420
421
  // Factory for message wrapper. This should only be used by internal
422
  // libraries.
423
  // TODO(uncreated-issue/2): exposed for testing while wiring adapter APIs. Should
424
  // make private visibility after refactors are done.
425
  ABSL_DEPRECATED("Use CelProtoWrapper::CreateMessage")
426
290
  static CelValue CreateMessageWrapper(MessageWrapper value) {
427
290
    CheckNullPointer(value.message_ptr(), Type::kMessage);
428
290
    CheckNullPointer(value.legacy_type_info(), Type::kMessage);
429
290
    return CelValue(value);
430
290
  }
431
432
 private:
433
  ValueHolder value_;
434
435
  template <typename T, class = void>
436
  struct AssignerOp {
437
711
    explicit AssignerOp(T* val) : value(val) {}
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::AssignerOp(google::api::expr::runtime::MessageWrapper*)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<long, void>::AssignerOp(long*)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::AssignerOp(unsigned long*)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<double, void>::AssignerOp(double*)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::AssignerOp(google::api::expr::runtime::CelMap const**)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::AssignerOp(google::api::expr::runtime::CelList const**)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<bool, void>::AssignerOp(bool*)
google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::AssignerOp(google::api::expr::runtime::CelValue::StringHolderBase<0>*)
Line
Count
Source
437
711
    explicit AssignerOp(T* val) : value(val) {}
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::AssignerOp(google::api::expr::runtime::CelValue::StringHolderBase<1>*)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::AssignerOp(absl::lts_20260107::Duration*)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::AssignerOp(absl::lts_20260107::Time*)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::AssignerOp(absl::lts_20260107::Status const**)
438
439
    template <typename U>
440
263
    bool operator()(const U&) {
441
263
      return false;
442
263
    }
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<std::__1::monostate>(std::__1::monostate const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<bool>(bool const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<long>(long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<unsigned long>(unsigned long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<double>(double const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<absl::lts_20260107::Duration>(absl::lts_20260107::Duration const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<absl::lts_20260107::Time>(absl::lts_20260107::Time const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<std::__1::monostate>(std::__1::monostate const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<bool>(bool const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<unsigned long>(unsigned long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<double>(double const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<google::api::expr::runtime::MessageWrapper>(google::api::expr::runtime::MessageWrapper const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<absl::lts_20260107::Duration>(absl::lts_20260107::Duration const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<absl::lts_20260107::Time>(absl::lts_20260107::Time const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<std::__1::monostate>(std::__1::monostate const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<bool>(bool const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<long>(long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<double>(double const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<google::api::expr::runtime::MessageWrapper>(google::api::expr::runtime::MessageWrapper const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<absl::lts_20260107::Duration>(absl::lts_20260107::Duration const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<absl::lts_20260107::Time>(absl::lts_20260107::Time const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<std::__1::monostate>(std::__1::monostate const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<bool>(bool const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<long>(long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<unsigned long>(unsigned long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<google::api::expr::runtime::MessageWrapper>(google::api::expr::runtime::MessageWrapper const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<absl::lts_20260107::Duration>(absl::lts_20260107::Duration const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<absl::lts_20260107::Time>(absl::lts_20260107::Time const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<std::__1::monostate>(std::__1::monostate const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<bool>(bool const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<long>(long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<unsigned long>(unsigned long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<double>(double const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<google::api::expr::runtime::MessageWrapper>(google::api::expr::runtime::MessageWrapper const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<absl::lts_20260107::Duration>(absl::lts_20260107::Duration const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<absl::lts_20260107::Time>(absl::lts_20260107::Time const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<std::__1::monostate>(std::__1::monostate const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<bool>(bool const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<long>(long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<unsigned long>(unsigned long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<double>(double const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<google::api::expr::runtime::MessageWrapper>(google::api::expr::runtime::MessageWrapper const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<absl::lts_20260107::Duration>(absl::lts_20260107::Duration const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<absl::lts_20260107::Time>(absl::lts_20260107::Time const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<std::__1::monostate>(std::__1::monostate const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<long>(long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<unsigned long>(unsigned long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<double>(double const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<google::api::expr::runtime::MessageWrapper>(google::api::expr::runtime::MessageWrapper const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<absl::lts_20260107::Duration>(absl::lts_20260107::Duration const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<absl::lts_20260107::Time>(absl::lts_20260107::Time const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<std::__1::monostate>(std::__1::monostate const&)
bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<bool>(bool const&)
Line
Count
Source
440
13
    bool operator()(const U&) {
441
13
      return false;
442
13
    }
bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<long>(long const&)
Line
Count
Source
440
146
    bool operator()(const U&) {
441
146
      return false;
442
146
    }
bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<unsigned long>(unsigned long const&)
Line
Count
Source
440
104
    bool operator()(const U&) {
441
104
      return false;
442
104
    }
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<double>(double const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<google::api::expr::runtime::MessageWrapper>(google::api::expr::runtime::MessageWrapper const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<absl::lts_20260107::Duration>(absl::lts_20260107::Duration const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<absl::lts_20260107::Time>(absl::lts_20260107::Time const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<std::__1::monostate>(std::__1::monostate const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<bool>(bool const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<long>(long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<unsigned long>(unsigned long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<double>(double const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<google::api::expr::runtime::MessageWrapper>(google::api::expr::runtime::MessageWrapper const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<absl::lts_20260107::Duration>(absl::lts_20260107::Duration const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<absl::lts_20260107::Time>(absl::lts_20260107::Time const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<std::__1::monostate>(std::__1::monostate const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<bool>(bool const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<long>(long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<unsigned long>(unsigned long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<double>(double const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<google::api::expr::runtime::MessageWrapper>(google::api::expr::runtime::MessageWrapper const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<absl::lts_20260107::Time>(absl::lts_20260107::Time const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<std::__1::monostate>(std::__1::monostate const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<bool>(bool const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<long>(long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<unsigned long>(unsigned long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<double>(double const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<google::api::expr::runtime::MessageWrapper>(google::api::expr::runtime::MessageWrapper const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<absl::lts_20260107::Duration>(absl::lts_20260107::Duration const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<std::__1::monostate>(std::__1::monostate const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<bool>(bool const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<long>(long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<unsigned long>(unsigned long const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<double>(double const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1> const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<google::api::expr::runtime::MessageWrapper>(google::api::expr::runtime::MessageWrapper const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<absl::lts_20260107::Duration>(absl::lts_20260107::Duration const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<absl::lts_20260107::Time>(absl::lts_20260107::Time const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const* const&)
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2> const&)
443
444
448
    bool operator()(const T& arg) {
445
448
      *value = arg;
446
448
      return true;
447
448
    }
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::MessageWrapper, void>::operator()(google::api::expr::runtime::MessageWrapper const&)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<long, void>::operator()(long const&)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<unsigned long, void>::operator()(unsigned long const&)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<double, void>::operator()(double const&)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelMap const*, void>::operator()(google::api::expr::runtime::CelMap const* const&)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelList const*, void>::operator()(google::api::expr::runtime::CelList const* const&)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<bool, void>::operator()(bool const&)
google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<0>, void>::operator()(google::api::expr::runtime::CelValue::StringHolderBase<0> const&)
Line
Count
Source
444
448
    bool operator()(const T& arg) {
445
448
      *value = arg;
446
448
      return true;
447
448
    }
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<google::api::expr::runtime::CelValue::StringHolderBase<1>, void>::operator()(google::api::expr::runtime::CelValue::StringHolderBase<1> const&)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Duration, void>::operator()(absl::lts_20260107::Duration const&)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Time, void>::operator()(absl::lts_20260107::Time const&)
Unexecuted instantiation: google::api::expr::runtime::CelValue::AssignerOp<absl::lts_20260107::Status const*, void>::operator()(absl::lts_20260107::Status const* const&)
448
449
    T* value;
450
  };
451
452
  // Specialization for MessageWrapper to support legacy behavior while
453
  // migrating off hard dependency on google::protobuf::Message.
454
  // TODO(uncreated-issue/2): Move to CelProtoWrapper.
455
  template <typename T>
456
  struct AssignerOp<
457
      T, std::enable_if_t<std::is_same_v<T, const google::protobuf::Message*>>> {
458
    explicit AssignerOp(const google::protobuf::Message** val) : value(val) {}
459
460
    template <typename U>
461
    bool operator()(const U&) {
462
      return false;
463
    }
464
465
    bool operator()(const MessageWrapper& held_value) {
466
      if (!held_value.HasFullProto()) {
467
        return false;
468
      }
469
470
      *value = static_cast<const google::protobuf::Message*>(held_value.message_ptr());
471
      return true;
472
    }
473
474
    const google::protobuf::Message** value;
475
  };
476
477
  struct NullCheckOp {
478
    template <typename T>
479
0
    bool operator()(const T&) const {
480
0
      return false;
481
0
    }
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::NullCheckOp::operator()<bool>(bool const&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::NullCheckOp::operator()<long>(long const&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::NullCheckOp::operator()<unsigned long>(unsigned long const&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::NullCheckOp::operator()<double>(double const&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::NullCheckOp::operator()<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0> const&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::NullCheckOp::operator()<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1> const&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::NullCheckOp::operator()<absl::lts_20260107::Duration>(absl::lts_20260107::Duration const&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::NullCheckOp::operator()<absl::lts_20260107::Time>(absl::lts_20260107::Time const&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::NullCheckOp::operator()<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const* const&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::NullCheckOp::operator()<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const* const&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::NullCheckOp::operator()<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const* const&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::NullCheckOp::operator()<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2> const&) const
Unexecuted instantiation: bool google::api::expr::runtime::CelValue::NullCheckOp::operator()<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const* const&) const
482
483
0
    bool operator()(NullType) const { return true; }
484
    // Note: this is not typically possible, but is supported for allowing
485
    // function resolution for null ptrs as Messages.
486
0
    bool operator()(const MessageWrapper& arg) const {
487
0
      return arg.message_ptr() == nullptr;
488
0
    }
489
  };
490
491
  // Constructs CelValue wrapping value supplied as argument.
492
  // Value type T should be supported by specification of ValueHolder.
493
  template <class T>
494
12.7k
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<absl::lts_20260107::Status const*>(absl::lts_20260107::Status const*)
Line
Count
Source
494
5.58k
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<std::__1::monostate>(std::__1::monostate)
Line
Count
Source
494
44
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<bool>(bool)
Line
Count
Source
494
3.36k
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<long>(long)
Line
Count
Source
494
643
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<unsigned long>(unsigned long)
Line
Count
Source
494
351
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<double>(double)
Line
Count
Source
494
446
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<google::api::expr::runtime::CelValue::StringHolderBase<0> >(google::api::expr::runtime::CelValue::StringHolderBase<0>)
Line
Count
Source
494
677
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<google::api::expr::runtime::CelValue::StringHolderBase<1> >(google::api::expr::runtime::CelValue::StringHolderBase<1>)
Line
Count
Source
494
169
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<google::api::expr::runtime::MessageWrapper>(google::api::expr::runtime::MessageWrapper)
Line
Count
Source
494
290
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<absl::lts_20260107::Time>(absl::lts_20260107::Time)
Line
Count
Source
494
49
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<google::api::expr::runtime::CelValue::StringHolderBase<2> >(google::api::expr::runtime::CelValue::StringHolderBase<2>)
Line
Count
Source
494
12
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<google::api::expr::runtime::CelList const*>(google::api::expr::runtime::CelList const*)
Line
Count
Source
494
361
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<google::api::expr::runtime::CelMap const*>(google::api::expr::runtime::CelMap const*)
Line
Count
Source
494
721
  explicit CelValue(T value) : value_(value) {}
google::api::expr::runtime::CelValue::CelValue<absl::lts_20260107::Duration>(absl::lts_20260107::Duration)
Line
Count
Source
494
7
  explicit CelValue(T value) : value_(value) {}
Unexecuted instantiation: google::api::expr::runtime::CelValue::CelValue<cel::base_internal::UnknownSet const*>(cel::base_internal::UnknownSet const*)
495
496
  // Crashes with a null pointer error.
497
0
  static void CrashNullPointer(Type type) ABSL_ATTRIBUTE_COLD {
498
0
    ABSL_LOG(FATAL) << "Null pointer supplied for "
499
0
                    << TypeName(type);  // Crash ok
500
0
  }
501
502
  // Null pointer checker for pointer-based types.
503
7.24k
  static void CheckNullPointer(const void* ptr, Type type) {
504
7.24k
    if (ABSL_PREDICT_FALSE(ptr == nullptr)) {
505
0
      CrashNullPointer(type);
506
0
    }
507
7.24k
  }
508
509
  // Crashes with a type mismatch error.
510
  static void CrashTypeMismatch(Type requested_type,
511
0
                                Type actual_type) ABSL_ATTRIBUTE_COLD {
512
0
    ABSL_LOG(FATAL) << "Type mismatch"                             // Crash ok
513
0
                    << ": expected " << TypeName(requested_type)   // Crash ok
514
0
                    << ", encountered " << TypeName(actual_type);  // Crash ok
515
0
  }
516
517
  // Gets value of type specified
518
  template <class T>
519
2.06k
  T GetValueOrDie(Type requested_type) const {
520
2.06k
    auto value_ptr = value_.get<T>();
521
2.06k
    if (ABSL_PREDICT_FALSE(value_ptr == nullptr)) {
522
0
      CrashTypeMismatch(requested_type, type());
523
0
    }
524
2.06k
    return *value_ptr;
525
2.06k
  }
bool google::api::expr::runtime::CelValue::GetValueOrDie<bool>(cel::Kind) const
Line
Count
Source
519
1
  T GetValueOrDie(Type requested_type) const {
520
1
    auto value_ptr = value_.get<T>();
521
1
    if (ABSL_PREDICT_FALSE(value_ptr == nullptr)) {
522
0
      CrashTypeMismatch(requested_type, type());
523
0
    }
524
1
    return *value_ptr;
525
1
  }
long google::api::expr::runtime::CelValue::GetValueOrDie<long>(cel::Kind) const
Line
Count
Source
519
76
  T GetValueOrDie(Type requested_type) const {
520
76
    auto value_ptr = value_.get<T>();
521
76
    if (ABSL_PREDICT_FALSE(value_ptr == nullptr)) {
522
0
      CrashTypeMismatch(requested_type, type());
523
0
    }
524
76
    return *value_ptr;
525
76
  }
unsigned long google::api::expr::runtime::CelValue::GetValueOrDie<unsigned long>(cel::Kind) const
Line
Count
Source
519
104
  T GetValueOrDie(Type requested_type) const {
520
104
    auto value_ptr = value_.get<T>();
521
104
    if (ABSL_PREDICT_FALSE(value_ptr == nullptr)) {
522
0
      CrashTypeMismatch(requested_type, type());
523
0
    }
524
104
    return *value_ptr;
525
104
  }
double google::api::expr::runtime::CelValue::GetValueOrDie<double>(cel::Kind) const
Line
Count
Source
519
117
  T GetValueOrDie(Type requested_type) const {
520
117
    auto value_ptr = value_.get<T>();
521
117
    if (ABSL_PREDICT_FALSE(value_ptr == nullptr)) {
522
0
      CrashTypeMismatch(requested_type, type());
523
0
    }
524
117
    return *value_ptr;
525
117
  }
google::api::expr::runtime::CelValue::StringHolderBase<0> google::api::expr::runtime::CelValue::GetValueOrDie<google::api::expr::runtime::CelValue::StringHolderBase<0> >(cel::Kind) const
Line
Count
Source
519
26
  T GetValueOrDie(Type requested_type) const {
520
26
    auto value_ptr = value_.get<T>();
521
26
    if (ABSL_PREDICT_FALSE(value_ptr == nullptr)) {
522
0
      CrashTypeMismatch(requested_type, type());
523
0
    }
524
26
    return *value_ptr;
525
26
  }
google::api::expr::runtime::CelValue::StringHolderBase<1> google::api::expr::runtime::CelValue::GetValueOrDie<google::api::expr::runtime::CelValue::StringHolderBase<1> >(cel::Kind) const
Line
Count
Source
519
102
  T GetValueOrDie(Type requested_type) const {
520
102
    auto value_ptr = value_.get<T>();
521
102
    if (ABSL_PREDICT_FALSE(value_ptr == nullptr)) {
522
0
      CrashTypeMismatch(requested_type, type());
523
0
    }
524
102
    return *value_ptr;
525
102
  }
google::api::expr::runtime::MessageWrapper google::api::expr::runtime::CelValue::GetValueOrDie<google::api::expr::runtime::MessageWrapper>(cel::Kind) const
Line
Count
Source
519
289
  T GetValueOrDie(Type requested_type) const {
520
289
    auto value_ptr = value_.get<T>();
521
289
    if (ABSL_PREDICT_FALSE(value_ptr == nullptr)) {
522
0
      CrashTypeMismatch(requested_type, type());
523
0
    }
524
289
    return *value_ptr;
525
289
  }
absl::lts_20260107::Duration google::api::expr::runtime::CelValue::GetValueOrDie<absl::lts_20260107::Duration>(cel::Kind) const
Line
Count
Source
519
6
  T GetValueOrDie(Type requested_type) const {
520
6
    auto value_ptr = value_.get<T>();
521
6
    if (ABSL_PREDICT_FALSE(value_ptr == nullptr)) {
522
0
      CrashTypeMismatch(requested_type, type());
523
0
    }
524
6
    return *value_ptr;
525
6
  }
absl::lts_20260107::Time google::api::expr::runtime::CelValue::GetValueOrDie<absl::lts_20260107::Time>(cel::Kind) const
Line
Count
Source
519
48
  T GetValueOrDie(Type requested_type) const {
520
48
    auto value_ptr = value_.get<T>();
521
48
    if (ABSL_PREDICT_FALSE(value_ptr == nullptr)) {
522
0
      CrashTypeMismatch(requested_type, type());
523
0
    }
524
48
    return *value_ptr;
525
48
  }
google::api::expr::runtime::CelList const* google::api::expr::runtime::CelValue::GetValueOrDie<google::api::expr::runtime::CelList const*>(cel::Kind) const
Line
Count
Source
519
87
  T GetValueOrDie(Type requested_type) const {
520
87
    auto value_ptr = value_.get<T>();
521
87
    if (ABSL_PREDICT_FALSE(value_ptr == nullptr)) {
522
0
      CrashTypeMismatch(requested_type, type());
523
0
    }
524
87
    return *value_ptr;
525
87
  }
google::api::expr::runtime::CelMap const* google::api::expr::runtime::CelValue::GetValueOrDie<google::api::expr::runtime::CelMap const*>(cel::Kind) const
Line
Count
Source
519
677
  T GetValueOrDie(Type requested_type) const {
520
677
    auto value_ptr = value_.get<T>();
521
677
    if (ABSL_PREDICT_FALSE(value_ptr == nullptr)) {
522
0
      CrashTypeMismatch(requested_type, type());
523
0
    }
524
677
    return *value_ptr;
525
677
  }
Unexecuted instantiation: google::api::expr::runtime::CelValue::StringHolderBase<2> google::api::expr::runtime::CelValue::GetValueOrDie<google::api::expr::runtime::CelValue::StringHolderBase<2> >(cel::Kind) const
Unexecuted instantiation: cel::base_internal::UnknownSet const* google::api::expr::runtime::CelValue::GetValueOrDie<cel::base_internal::UnknownSet const*>(cel::Kind) const
absl::lts_20260107::Status const* google::api::expr::runtime::CelValue::GetValueOrDie<absl::lts_20260107::Status const*>(cel::Kind) const
Line
Count
Source
519
528
  T GetValueOrDie(Type requested_type) const {
520
528
    auto value_ptr = value_.get<T>();
521
528
    if (ABSL_PREDICT_FALSE(value_ptr == nullptr)) {
522
0
      CrashTypeMismatch(requested_type, type());
523
0
    }
524
528
    return *value_ptr;
525
528
  }
526
527
  friend class CelProtoWrapper;
528
  friend class ProtoMessageTypeAdapter;
529
  friend class EvaluatorStack;
530
  friend class TestOnly_FactoryAccessor;
531
};
532
533
static_assert(absl::is_trivially_destructible<CelValue>::value,
534
              "Non-trivially-destructible CelValue impacts "
535
              "performance");
536
537
// CelList is a base class for list adapting classes.
538
class CelList {
539
 public:
540
  ABSL_DEPRECATED(
541
      "Unless you are sure of the underlying CelList implementation, call Get "
542
      "and pass an arena instead")
543
  virtual CelValue operator[](int index) const = 0;
544
545
  // Like `operator[](int)` above, but also accepts an arena. Prefer calling
546
  // this variant if the arena is known.
547
0
  virtual CelValue Get(google::protobuf::Arena* arena, int index) const {
548
0
    static_cast<void>(arena);
549
0
    return (*this)[index];
550
0
  }
551
552
  // List size
553
  virtual int size() const = 0;
554
  // Default empty check. Can be overridden in subclass for performance.
555
0
  virtual bool empty() const { return size() == 0; }
556
557
2.42k
  virtual ~CelList() {}
558
559
 private:
560
  friend struct cel::interop_internal::CelListAccess;
561
  friend struct cel::NativeTypeTraits<CelList>;
562
563
0
  virtual cel::NativeTypeId GetNativeTypeId() const {
564
0
    return cel::NativeTypeId();
565
0
  }
566
};
567
568
// CelMap is a base class for map accessors.
569
class CelMap {
570
 public:
571
  // Map lookup. If value found, returns CelValue in return type.
572
  //
573
  // Per the protobuf specification, acceptable key types are bool, int64,
574
  // uint64, string. Any key type that is not supported should result in valued
575
  // response containing an absl::StatusCode::kInvalidArgument wrapped as a
576
  // CelError.
577
  //
578
  // Type specializations are permitted since CEL supports such distinctions
579
  // at type-check time. For example, the expression `1 in map_str` where the
580
  // variable `map_str` is of type map(string, string) will yield a type-check
581
  // error. To be consistent, the runtime should also yield an invalid argument
582
  // error if the type does not agree with the expected key types held by the
583
  // container.
584
  // TODO(issues/122): Make this method const correct.
585
  ABSL_DEPRECATED(
586
      "Unless you are sure of the underlying CelMap implementation, call Get "
587
      "and pass an arena instead")
588
  virtual absl::optional<CelValue> operator[](CelValue key) const = 0;
589
590
  // Like `operator[](CelValue)` above, but also accepts an arena. Prefer
591
  // calling this variant if the arena is known.
592
  virtual absl::optional<CelValue> Get(google::protobuf::Arena* arena,
593
591
                                       CelValue key) const {
594
591
    static_cast<void>(arena);
595
591
    return (*this)[key];
596
591
  }
597
598
  // Return whether the key is present within the map.
599
  //
600
  // Typically, key resolution will be a simple boolean result; however, there
601
  // are scenarios where the conversion of the input key to the underlying
602
  // key-type will produce an absl::StatusCode::kInvalidArgument.
603
  //
604
  // Evaluators are responsible for handling non-OK results by propagating the
605
  // error, as appropriate, up the evaluation stack either as a `StatusOr` or
606
  // as a `CelError` value, depending on the context.
607
0
  virtual absl::StatusOr<bool> Has(const CelValue& key) const {
608
    // This check safeguards against issues with invalid key types such as NaN.
609
0
    CEL_RETURN_IF_ERROR(CelValue::CheckMapKeyType(key));
610
0
    google::protobuf::Arena arena;
611
0
    auto value = (*this).Get(&arena, key);
612
0
    if (!value.has_value()) {
613
0
      return false;
614
0
    }
615
    // This protects from issues that may occur when looking up a key value,
616
    // such as a failure to convert an int64 to an int32 map key.
617
0
    if (value->IsError()) {
618
0
      return *value->ErrorOrDie();
619
0
    }
620
0
    return true;
621
0
  }
622
623
  // Map size
624
  virtual int size() const = 0;
625
  // Default empty check. Can be overridden in subclass for performance.
626
0
  virtual bool empty() const { return size() == 0; }
627
628
  // Return list of keys. CelList is owned by Arena, so no
629
  // ownership is passed.
630
  ABSL_DEPRECATED(
631
      "Unless you are sure of the underlying CelMap implementation, call "
632
      "ListKeys and pass an arena instead")
633
  virtual absl::StatusOr<const CelList*> ListKeys() const = 0;
634
635
  // Like `ListKeys()` above, but also accepts an arena. Prefer calling this
636
  // variant if the arena is known.
637
0
  virtual absl::StatusOr<const CelList*> ListKeys(google::protobuf::Arena* arena) const {
638
0
    static_cast<void>(arena);
639
0
    return ListKeys();
640
0
  }
641
642
960
  virtual ~CelMap() {}
643
644
 private:
645
  friend struct cel::interop_internal::CelMapAccess;
646
  friend struct cel::NativeTypeTraits<CelMap>;
647
648
0
  virtual cel::NativeTypeId GetNativeTypeId() const {
649
0
    return cel::NativeTypeId();
650
0
  }
651
};
652
653
// Utility method that generates CelValue containing CelError.
654
// message an error message
655
// error_code error code
656
CelValue CreateErrorValue(
657
    cel::MemoryManagerRef manager ABSL_ATTRIBUTE_LIFETIME_BOUND,
658
    absl::string_view message,
659
    absl::StatusCode error_code = absl::StatusCode::kUnknown);
660
CelValue CreateErrorValue(
661
    google::protobuf::Arena* arena, absl::string_view message,
662
    absl::StatusCode error_code = absl::StatusCode::kUnknown);
663
664
// Utility method for generating a CelValue from an absl::Status.
665
CelValue CreateErrorValue(cel::MemoryManagerRef manager
666
                              ABSL_ATTRIBUTE_LIFETIME_BOUND,
667
                          const absl::Status& status);
668
669
// Utility method for generating a CelValue from an absl::Status.
670
CelValue CreateErrorValue(google::protobuf::Arena* arena, const absl::Status& status);
671
672
// Create an error for failed overload resolution, optionally including the name
673
// of the function.
674
CelValue CreateNoMatchingOverloadError(cel::MemoryManagerRef manager
675
                                           ABSL_ATTRIBUTE_LIFETIME_BOUND,
676
                                       absl::string_view fn = "");
677
ABSL_DEPRECATED("Prefer using the generic MemoryManager overload")
678
CelValue CreateNoMatchingOverloadError(google::protobuf::Arena* arena,
679
                                       absl::string_view fn = "");
680
bool CheckNoMatchingOverloadError(CelValue value);
681
682
CelValue CreateNoSuchFieldError(cel::MemoryManagerRef manager
683
                                    ABSL_ATTRIBUTE_LIFETIME_BOUND,
684
                                absl::string_view field = "");
685
ABSL_DEPRECATED("Prefer using the generic MemoryManager overload")
686
CelValue CreateNoSuchFieldError(google::protobuf::Arena* arena,
687
                                absl::string_view field = "");
688
689
CelValue CreateNoSuchKeyError(cel::MemoryManagerRef manager
690
                                  ABSL_ATTRIBUTE_LIFETIME_BOUND,
691
                              absl::string_view key);
692
ABSL_DEPRECATED("Prefer using the generic MemoryManager overload")
693
CelValue CreateNoSuchKeyError(google::protobuf::Arena* arena, absl::string_view key);
694
695
bool CheckNoSuchKeyError(CelValue value);
696
697
// Returns an error indicating that evaluation has accessed an attribute whose
698
// value is undefined. For example, this may represent a field in a proto
699
// message bound to the activation whose value can't be determined by the
700
// hosting application.
701
CelValue CreateMissingAttributeError(cel::MemoryManagerRef manager
702
                                         ABSL_ATTRIBUTE_LIFETIME_BOUND,
703
                                     absl::string_view missing_attribute_path);
704
ABSL_DEPRECATED("Prefer using the generic MemoryManager overload")
705
CelValue CreateMissingAttributeError(google::protobuf::Arena* arena,
706
                                     absl::string_view missing_attribute_path);
707
708
ABSL_CONST_INIT extern const absl::string_view kPayloadUrlMissingAttributePath;
709
bool IsMissingAttributeError(const CelValue& value);
710
711
// Returns error indicating the result of the function is unknown. This is used
712
// as a signal to create an unknown set if unknown function handling is opted
713
// into.
714
CelValue CreateUnknownFunctionResultError(cel::MemoryManagerRef manager
715
                                              ABSL_ATTRIBUTE_LIFETIME_BOUND,
716
                                          absl::string_view help_message);
717
ABSL_DEPRECATED("Prefer using the generic MemoryManager overload")
718
CelValue CreateUnknownFunctionResultError(google::protobuf::Arena* arena,
719
                                          absl::string_view help_message);
720
721
// Returns true if this is unknown value error indicating that evaluation
722
// called an extension function whose value is unknown for the given args.
723
// This is used as a signal to convert to an UnknownSet if the behavior is opted
724
// into.
725
bool IsUnknownFunctionResult(const CelValue& value);
726
727
}  // namespace google::api::expr::runtime
728
729
namespace cel {
730
731
template <>
732
struct NativeTypeTraits<google::api::expr::runtime::CelList> final {
733
0
  static NativeTypeId Id(const google::api::expr::runtime::CelList& cel_list) {
734
0
    return cel_list.GetNativeTypeId();
735
0
  }
736
};
737
738
template <typename T>
739
struct NativeTypeTraits<
740
    T,
741
    std::enable_if_t<std::conjunction_v<
742
        std::is_base_of<google::api::expr::runtime::CelList, T>,
743
        std::negation<std::is_same<T, google::api::expr::runtime::CelList>>>>>
744
    final {
745
  static NativeTypeId Id(const google::api::expr::runtime::CelList& cel_list) {
746
    return NativeTypeTraits<google::api::expr::runtime::CelList>::Id(cel_list);
747
  }
748
};
749
750
template <>
751
struct NativeTypeTraits<google::api::expr::runtime::CelMap> final {
752
0
  static NativeTypeId Id(const google::api::expr::runtime::CelMap& cel_map) {
753
0
    return cel_map.GetNativeTypeId();
754
0
  }
755
};
756
757
template <typename T>
758
struct NativeTypeTraits<
759
    T, std::enable_if_t<std::conjunction_v<
760
           std::is_base_of<google::api::expr::runtime::CelMap, T>,
761
           std::negation<std::is_same<T, google::api::expr::runtime::CelMap>>>>>
762
    final {
763
  static NativeTypeId Id(const google::api::expr::runtime::CelMap& cel_map) {
764
    return NativeTypeTraits<google::api::expr::runtime::CelMap>::Id(cel_map);
765
  }
766
};
767
768
}  // namespace cel
769
770
#endif  // THIRD_PARTY_CEL_CPP_EVAL_PUBLIC_CEL_VALUE_H_