/proc/self/cwd/common/internal/value_arena_ptr.h
Line | Count | Source |
1 | | // Copyright 2026 Google LLC |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | | // you may not use this file except in compliance with the License. |
5 | | // You may obtain a copy of the License at |
6 | | // |
7 | | // https://www.apache.org/licenses/LICENSE-2.0 |
8 | | // |
9 | | // Unless required by applicable law or agreed to in writing, software |
10 | | // distributed under the License is distributed on an "AS IS" BASIS, |
11 | | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | | // See the License for the specific language governing permissions and |
13 | | // limitations under the License. |
14 | | |
15 | | #ifndef THIRD_PARTY_CEL_CPP_COMMON_INTERNAL_VALUE_ARENA_PTR_H_ |
16 | | #define THIRD_PARTY_CEL_CPP_COMMON_INTERNAL_VALUE_ARENA_PTR_H_ |
17 | | |
18 | | #include "absl/base/nullability.h" |
19 | | #include "common/internal/value_arena_ptr_tag.h" |
20 | | #include "internal/tagged_arena_ptr.h" |
21 | | #include "google/protobuf/arena.h" |
22 | | |
23 | | namespace cel::internal { |
24 | | |
25 | | template <> |
26 | | struct TaggedArenaPtrTagTraits<common_internal::ValueArenaPtrTag> { |
27 | | [[nodiscard]] |
28 | | static bool CheckTag(google::protobuf::Arena* absl_nullable arena, |
29 | 0 | common_internal::ValueArenaPtrTag tag) { |
30 | 0 | return common_internal::CheckValueArenaPtrTag(arena, tag); |
31 | 0 | } |
32 | | }; |
33 | | |
34 | | } // namespace cel::internal |
35 | | |
36 | | namespace cel::common_internal { |
37 | | |
38 | | // Tagged arena pointer whose tag conveys additional information about the |
39 | | // lifetime of the underlying data contained in the same value. This is meant to |
40 | | // be stored inside Value implementations. |
41 | | using ValueArenaPtr = internal::TaggedArenaPtr<ValueArenaPtrTag>; |
42 | | |
43 | | } // namespace cel::common_internal |
44 | | |
45 | | #endif // THIRD_PARTY_CEL_CPP_COMMON_INTERNAL_VALUE_ARENA_PTR_H_ |