Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
73 lines (62 loc) · 2.63 KB

File metadata and controls

73 lines (62 loc) · 2.63 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef THIRD_PARTY_CEL_CPP_RUNTIME_ACTIVATION_INTERFACE_H_
#define THIRD_PARTY_CEL_CPP_RUNTIME_ACTIVATION_INTERFACE_H_
#include <vector>
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "absl/types/span.h"
#include "base/attribute.h"
#include "base/value.h"
#include "runtime/function_overload_reference.h"
namespace cel {
// Interface for providing runtime with variable lookups.
//
// Clients should prefer to use one of the concrete implementations provided by
// the CEL library rather than implementing this interface directly.
// TODO(issues/5): After finalizing, make this public and add instructions
// for clients to migrate.
class ActivationInterface {
public:
virtual ~ActivationInterface() = default;
// Find value for a string (possibly qualified) variable name.
virtual absl::StatusOr<absl::optional<Handle<Value>>> FindVariable(
ValueFactory& factory, absl::string_view name) const = 0;
// Find a set of context function overloads by name.
virtual std::vector<FunctionOverloadReference> FindFunctionOverloads(
absl::string_view name) const = 0;
// Return a list of unknown attribute patterns.
//
// If an attribute (select path) encountered during evaluation matches any of
// the patterns, the value will be treated as unknown and propagated in an
// unknown set.
//
// The returned span must remain valid for the duration of any evaluation
// using this this activation.
virtual absl::Span<const cel::AttributePattern> GetUnknownAttributes()
const = 0;
// Return a list of missing attribute patterns.
//
// If an attribute (select path) encountered during evaluation matches any of
// the patterns, the value will be treated as missing and propagated as an
// error.
//
// The returned span must remain valid for the duration of any evaluation
// using this activation.
virtual absl::Span<const cel::AttributePattern> GetMissingAttributes()
const = 0;
};
} // namespace cel
#endif // THIRD_PARTY_CEL_CPP_RUNTIME_ACTIVATION_INTERFACE_H_
Morty Proxy This is a proxified and sanitized view of the page, visit original site.