bloaty/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h
Go to the documentation of this file.
1 // Copyright 2021 The Abseil Authors.
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 ABSL_CLEANUP_INTERNAL_CLEANUP_H_
16 #define ABSL_CLEANUP_INTERNAL_CLEANUP_H_
17 
18 #include <type_traits>
19 #include <utility>
20 
21 #include "absl/base/internal/invoke.h"
22 #include "absl/base/thread_annotations.h"
23 #include "absl/utility/utility.h"
24 
25 namespace absl {
27 
28 namespace cleanup_internal {
29 
30 struct Tag {};
31 
32 template <typename Arg, typename... Args>
33 constexpr bool WasDeduced() {
35  (sizeof...(Args) == 0);
36 }
37 
38 template <typename Callback>
39 constexpr bool ReturnsVoid() {
40  return (std::is_same<base_internal::invoke_result_t<Callback>, void>::value);
41 }
42 
43 template <typename Callback>
44 class Storage {
45  public:
46  Storage() = delete;
47 
48  Storage(Callback callback, bool is_callback_engaged)
50  is_callback_engaged_(is_callback_engaged) {}
51 
52  Storage(Storage&& other)
53  : callback_(std::move(other.callback_)),
56 
57  Storage(const Storage& other) = delete;
58 
59  Storage& operator=(Storage&& other) = delete;
60 
61  Storage& operator=(const Storage& other) = delete;
62 
63  bool IsCallbackEngaged() const { return is_callback_engaged_; }
64 
66 
69  }
70 
71  private:
72  Callback callback_;
74 };
75 
76 } // namespace cleanup_internal
77 
79 } // namespace absl
80 
81 #endif // ABSL_CLEANUP_INTERNAL_CLEANUP_H_
absl::cleanup_internal::Storage::IsCallbackEngaged
bool IsCallbackEngaged() const
Definition: bloaty/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h:63
absl::cleanup_internal::Storage::DisengageCallback
void DisengageCallback()
Definition: bloaty/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h:65
false
#define false
Definition: setup_once.h:323
absl::cleanup_internal::ReturnsVoid
constexpr bool ReturnsVoid()
Definition: abseil-cpp/absl/cleanup/internal/cleanup.h:41
absl::cleanup_internal::WasDeduced
constexpr bool WasDeduced()
Definition: abseil-cpp/absl/cleanup/internal/cleanup.h:35
ABSL_NAMESPACE_END
#define ABSL_NAMESPACE_END
Definition: third_party/abseil-cpp/absl/base/config.h:171
Arg
Arg(64) -> Arg(128) ->Arg(256) ->Arg(512) ->Arg(1024) ->Arg(1536) ->Arg(2048) ->Arg(3072) ->Arg(4096) ->Arg(5120) ->Arg(6144) ->Arg(7168)
ABSL_NAMESPACE_BEGIN
#define ABSL_NAMESPACE_BEGIN
Definition: third_party/abseil-cpp/absl/base/config.h:170
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
hpack_encoder_fixtures::Args
Args({0, 16384})
opencensus.proto.stats.v1.stats_pb2.Tag
Tag
Definition: stats_pb2.py:431
absl::cleanup_internal::Storage::Storage
Storage(Storage &&other)
Definition: bloaty/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h:52
callback
static void callback(void *arg, int status, int timeouts, struct hostent *host)
Definition: acountry.c:224
absl::cleanup_internal::Storage::operator=
Storage & operator=(Storage &&other)=delete
value
const char * value
Definition: hpack_parser_table.cc:165
absl::cleanup_internal::Storage::callback_
Callback callback_
Definition: bloaty/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h:72
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
absl::cleanup_internal::Storage::is_callback_engaged_
bool is_callback_engaged_
Definition: abseil-cpp/absl/cleanup/internal/cleanup.h:91
absl
Definition: abseil-cpp/absl/algorithm/algorithm.h:31
absl::cleanup_internal::Storage::Storage
Storage()=delete
absl::cleanup_internal::Storage::Storage
Storage(Callback callback, bool is_callback_engaged)
Definition: bloaty/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h:48
absl::cleanup_internal::Storage::InvokeCallback
void InvokeCallback() ABSL_NO_THREAD_SAFETY_ANALYSIS
Definition: bloaty/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h:67
absl::cleanup_internal::Storage
Definition: abseil-cpp/absl/cleanup/internal/cleanup.h:46
absl::exchange
T exchange(T &obj, U &&new_value)
Definition: abseil-cpp/absl/utility/utility.h:314
ABSL_NO_THREAD_SAFETY_ANALYSIS
#define ABSL_NO_THREAD_SAFETY_ANALYSIS
Definition: abseil-cpp/absl/base/thread_annotations.h:280


grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:54