Coverage Report

Created: 2026-07-16 06:29

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/proc/self/cwd/internal/manual.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_INTERNAL_MANUAL_H_
16
#define THIRD_PARTY_CEL_CPP_INTERNAL_MANUAL_H_
17
18
#include <new>
19
#include <type_traits>
20
21
#include "absl/base/attributes.h"
22
#include "absl/base/nullability.h"
23
24
namespace cel::internal {
25
26
template <typename T>
27
class Manual final {
28
 public:
29
  static_assert(!std::is_reference_v<T>, "T must not be a reference");
30
  static_assert(!std::is_array_v<T>, "T must not be an array");
31
  static_assert(!std::is_const_v<T>, "T must not be const qualified");
32
  static_assert(!std::is_volatile_v<T>, "T must not be volatile qualified");
33
34
  using element_type = T;
35
36
  Manual() = default;
37
38
  Manual(const Manual&) = delete;
39
  Manual(Manual&&) = delete;
40
41
  ~Manual() = default;
42
43
  Manual& operator=(const Manual&) = delete;
44
  Manual& operator=(Manual&&) = delete;
45
46
9.85M
  constexpr T* absl_nonnull get() ABSL_ATTRIBUTE_LIFETIME_BOUND {
47
9.85M
    return std::launder(reinterpret_cast<T*>(&storage_[0]));
48
9.85M
  }
cel::internal::Manual<std::__1::vector<cel::Value, cel::ArenaAllocator<cel::Value> > >::get()
Line
Count
Source
46
9.27M
  constexpr T* absl_nonnull get() ABSL_ATTRIBUTE_LIFETIME_BOUND {
47
9.27M
    return std::launder(reinterpret_cast<T*>(&storage_[0]));
48
9.27M
  }
value_builder.cc:cel::internal::Manual<absl::lts_20260526::flat_hash_map<cel::Value, cel::Value, cel::common_internal::(anonymous namespace)::ValueHasher, cel::common_internal::(anonymous namespace)::ValueEqualer, cel::ArenaAllocator<std::__1::pair<cel::Value const, cel::Value> > > >::get()
Line
Count
Source
46
586k
  constexpr T* absl_nonnull get() ABSL_ATTRIBUTE_LIFETIME_BOUND {
47
586k
    return std::launder(reinterpret_cast<T*>(&storage_[0]));
48
586k
  }
49
50
0
  constexpr const T* absl_nonnull get() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
51
0
    return std::launder(reinterpret_cast<const T*>(&storage_[0]));
52
0
  }
Unexecuted instantiation: cel::internal::Manual<std::__1::vector<cel::Value, cel::ArenaAllocator<cel::Value> > >::get() const
Unexecuted instantiation: value_builder.cc:cel::internal::Manual<absl::lts_20260526::flat_hash_map<cel::Value, cel::Value, cel::common_internal::(anonymous namespace)::ValueHasher, cel::common_internal::(anonymous namespace)::ValueEqualer, cel::ArenaAllocator<std::__1::pair<cel::Value const, cel::Value> > > >::get() const
53
54
476k
  constexpr T& operator*() ABSL_ATTRIBUTE_LIFETIME_BOUND { return *get(); }
cel::internal::Manual<std::__1::vector<cel::Value, cel::ArenaAllocator<cel::Value> > >::operator*()
Line
Count
Source
54
444k
  constexpr T& operator*() ABSL_ATTRIBUTE_LIFETIME_BOUND { return *get(); }
value_builder.cc:cel::internal::Manual<absl::lts_20260526::flat_hash_map<cel::Value, cel::Value, cel::common_internal::(anonymous namespace)::ValueHasher, cel::common_internal::(anonymous namespace)::ValueEqualer, cel::ArenaAllocator<std::__1::pair<cel::Value const, cel::Value> > > >::operator*()
Line
Count
Source
54
32.1k
  constexpr T& operator*() ABSL_ATTRIBUTE_LIFETIME_BOUND { return *get(); }
55
56
  constexpr const T& operator*() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
57
    return *get();
58
  }
59
60
9.37M
  constexpr T* absl_nonnull operator->() ABSL_ATTRIBUTE_LIFETIME_BOUND {
61
9.37M
    return get();
62
9.37M
  }
cel::internal::Manual<std::__1::vector<cel::Value, cel::ArenaAllocator<cel::Value> > >::operator->()
Line
Count
Source
60
8.82M
  constexpr T* absl_nonnull operator->() ABSL_ATTRIBUTE_LIFETIME_BOUND {
61
8.82M
    return get();
62
8.82M
  }
value_builder.cc:cel::internal::Manual<absl::lts_20260526::flat_hash_map<cel::Value, cel::Value, cel::common_internal::(anonymous namespace)::ValueHasher, cel::common_internal::(anonymous namespace)::ValueEqualer, cel::ArenaAllocator<std::__1::pair<cel::Value const, cel::Value> > > >::operator->()
Line
Count
Source
60
553k
  constexpr T* absl_nonnull operator->() ABSL_ATTRIBUTE_LIFETIME_BOUND {
61
553k
    return get();
62
553k
  }
63
64
  constexpr const T* absl_nonnull operator->() const
65
0
      ABSL_ATTRIBUTE_LIFETIME_BOUND {
66
0
    return get();
67
0
  }
Unexecuted instantiation: cel::internal::Manual<std::__1::vector<cel::Value, cel::ArenaAllocator<cel::Value> > >::operator->() const
Unexecuted instantiation: value_builder.cc:cel::internal::Manual<absl::lts_20260526::flat_hash_map<cel::Value, cel::Value, cel::common_internal::(anonymous namespace)::ValueHasher, cel::common_internal::(anonymous namespace)::ValueEqualer, cel::ArenaAllocator<std::__1::pair<cel::Value const, cel::Value> > > >::operator->() const
68
69
  template <typename... Args>
70
737k
  T* absl_nonnull Construct(Args&&... args) ABSL_ATTRIBUTE_LIFETIME_BOUND {
71
737k
    return ::new (static_cast<void*>(&storage_[0]))
72
737k
        T(std::forward<Args>(args)...);
73
737k
  }
std::__1::vector<cel::Value, cel::ArenaAllocator<cel::Value> >* cel::internal::Manual<std::__1::vector<cel::Value, cel::ArenaAllocator<cel::Value> > >::Construct<google::protobuf::Arena*&>(google::protobuf::Arena*&)
Line
Count
Source
70
584k
  T* absl_nonnull Construct(Args&&... args) ABSL_ATTRIBUTE_LIFETIME_BOUND {
71
584k
    return ::new (static_cast<void*>(&storage_[0]))
72
584k
        T(std::forward<Args>(args)...);
73
584k
  }
value_builder.cc:absl::lts_20260526::flat_hash_map<cel::Value, cel::Value, cel::common_internal::(anonymous namespace)::ValueHasher, cel::common_internal::(anonymous namespace)::ValueEqualer, cel::ArenaAllocator<std::__1::pair<cel::Value const, cel::Value> > >* cel::internal::Manual<absl::lts_20260526::flat_hash_map<cel::Value, cel::Value, cel::common_internal::(anonymous namespace)::ValueHasher, cel::common_internal::(anonymous namespace)::ValueEqualer, cel::ArenaAllocator<std::__1::pair<cel::Value const, cel::Value> > > >::Construct<google::protobuf::Arena* const&>(google::protobuf::Arena* const&)
Line
Count
Source
70
153k
  T* absl_nonnull Construct(Args&&... args) ABSL_ATTRIBUTE_LIFETIME_BOUND {
71
153k
    return ::new (static_cast<void*>(&storage_[0]))
72
153k
        T(std::forward<Args>(args)...);
73
153k
  }
74
75
  T* absl_nonnull DefaultConstruct() {
76
    return ::new (static_cast<void*>(&storage_[0])) T;
77
  }
78
79
  T* absl_nonnull ValueConstruct() {
80
    return ::new (static_cast<void*>(&storage_[0])) T();
81
  }
82
83
102
  void Destruct() { get()->~T(); }
Unexecuted instantiation: cel::internal::Manual<std::__1::vector<cel::Value, cel::ArenaAllocator<cel::Value> > >::Destruct()
value_builder.cc:cel::internal::Manual<absl::lts_20260526::flat_hash_map<cel::Value, cel::Value, cel::common_internal::(anonymous namespace)::ValueHasher, cel::common_internal::(anonymous namespace)::ValueEqualer, cel::ArenaAllocator<std::__1::pair<cel::Value const, cel::Value> > > >::Destruct()
Line
Count
Source
83
102
  void Destruct() { get()->~T(); }
84
85
 private:
86
  alignas(T) char storage_[sizeof(T)];
87
};
88
89
}  // namespace cel::internal
90
91
#endif  // THIRD_PARTY_CEL_CPP_INTERNAL_MANUAL_H_