Coverage Report

Created: 2026-05-27 07:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/proc/self/cwd/runtime/internal/attribute_matcher.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_RUNTIME_INTERNAL_ATTRIBUTE_MATCHER_H_
16
#define THIRD_PARTY_CEL_CPP_RUNTIME_INTERNAL_ATTRIBUTE_MATCHER_H_
17
18
#include "base/attribute.h"
19
20
namespace cel::runtime_internal {
21
22
// Interface for matching unknown and missing attributes against the
23
// observed attribute trail at runtime.
24
class AttributeMatcher {
25
 public:
26
  using MatchResult = cel::AttributePattern::MatchType;
27
28
9.92k
  virtual ~AttributeMatcher() = default;
29
30
  // Checks whether the attribute trail matches any unknown patterns.
31
  // Used to identify and collect referenced unknowns in an UnknownValue.
32
  virtual MatchResult CheckForUnknown(const Attribute& attr
33
0
                                      [[maybe_unused]]) const {
34
0
    return MatchResult::NONE;
35
0
  };
36
37
  // Checks whether the attribute trail matches any missing patterns.
38
  // Used to identify missing attributes, and report an error if referenced
39
  // directly.
40
  virtual MatchResult CheckForMissing(const Attribute& attr
41
0
                                      [[maybe_unused]]) const {
42
0
    return MatchResult::NONE;
43
0
  };
44
};
45
46
}  // namespace cel::runtime_internal
47
48
#endif  // THIRD_PARTY_CEL_CPP_RUNTIME_INTERNAL_ATTRIBUTE_MATCHER_H_