Go to the documentation of this file.
19 #ifndef GRPC_CORE_LIB_GPRPP_REF_COUNTED_PTR_H
20 #define GRPC_CORE_LIB_GPRPP_REF_COUNTED_PTR_H
25 #include <type_traits>
48 other.value_ =
nullptr;
53 value_ =
static_cast<T*
>(other.value_);
54 other.value_ =
nullptr;
60 other.value_ =
nullptr;
66 other.value_ =
nullptr;
72 if (other.
value_ !=
nullptr) other.
value_->IncrementRefCount();
79 "T does not have a virtual dtor");
80 if (other.
value_ !=
nullptr) other.
value_->IncrementRefCount();
89 if (other.
value_ !=
nullptr) other.
value_->IncrementRefCount();
96 "T does not have a virtual dtor");
99 if (other.
value_ !=
nullptr) other.
value_->IncrementRefCount();
120 template <
typename Y>
123 "T does not have a virtual dtor");
127 template <
typename Y>
129 Y*
value =
nullptr) {
131 "T does not have a virtual dtor");
151 template <
typename Y>
156 template <
typename Y>
163 template <
typename Y>
168 template <
typename Y>
176 template <
typename Y>
184 template <
typename T>
192 template <
typename Y>
200 other.value_ =
nullptr;
202 template <
typename Y>
205 value_ =
static_cast<T*
>(other.value_);
206 other.value_ =
nullptr;
212 other.value_ =
nullptr;
215 template <
typename Y>
218 other.value_ =
nullptr;
224 if (other.
value_ !=
nullptr) other.
value_->IncrementWeakRefCount();
227 template <
typename Y>
231 "T does not have a virtual dtor");
232 if (other.
value_ !=
nullptr) other.
value_->IncrementWeakRefCount();
241 if (other.
value_ !=
nullptr) other.
value_->IncrementWeakRefCount();
245 template <
typename Y>
248 "T does not have a virtual dtor");
251 if (other.
value_ !=
nullptr) other.
value_->IncrementWeakRefCount();
269 if (
value_ !=
nullptr)
value_->WeakUnref(location, reason);
272 template <
typename Y>
275 "T does not have a virtual dtor");
279 template <
typename Y>
281 Y*
value =
nullptr) {
283 "T does not have a virtual dtor");
284 if (
value_ !=
nullptr)
value_->WeakUnref(location, reason);
303 template <
typename Y>
308 template <
typename Y>
315 template <
typename Y>
320 template <
typename Y>
328 template <
typename Y>
334 template <
typename T,
typename...
Args>
339 template <
typename T>
341 return p1.
get() < p2.
get();
344 template <
typename T>
346 return p1.
get() < p2.
get();
void swap(WeakRefCountedPtr &other)
RefCountedPtr< T > MakeRefCounted(Args &&... args)
bool operator!=(const Y *other) const
bool operator!=(std::nullptr_t) const
void swap(RefCountedPtr &other)
void reset(T *value=nullptr)
WeakRefCountedPtr(WeakRefCountedPtr< Y > &&other) noexcept
bool operator==(const RefCountedPtr< Y > &other) const
WeakRefCountedPtr & operator=(WeakRefCountedPtr< Y > &&other) noexcept
bool operator!=(const Y *other) const
void reset(Y *value=nullptr)
bool operator!=(const WeakRefCountedPtr< Y > &other) const
void reset(Y *value=nullptr)
RefCountedPtr & operator=(const RefCountedPtr< Y > &other)
#define T(upbtypeconst, upbtype, ctype, default_value)
bool operator==(std::nullptr_t) const
RefCountedPtr(std::nullptr_t)
WeakRefCountedPtr & operator=(const WeakRefCountedPtr &other)
WeakRefCountedPtr & operator=(WeakRefCountedPtr &&other) noexcept
WeakRefCountedPtr(Y *value)
bool operator!=(std::nullptr_t) const
WeakRefCountedPtr & operator=(const WeakRefCountedPtr< Y > &other)
bool operator!=(const RefCountedPtr< Y > &other) const
RefCountedPtr & operator=(const RefCountedPtr &other)
RefCountedPtr(RefCountedPtr< Y > &&other) noexcept
bool operator<(const RefCountedPtr< T > &p1, const RefCountedPtr< T > &p2)
void swap(Json::Value &a, Json::Value &b)
Specialize std::swap() for Json::Value.
WeakRefCountedPtr(const WeakRefCountedPtr &other)
RefCountedPtr & operator=(RefCountedPtr< Y > &&other) noexcept
WeakRefCountedPtr(WeakRefCountedPtr &&other) noexcept
WeakRefCountedPtr(std::nullptr_t)
RefCountedPtr(RefCountedPtr &&other) noexcept
void reset(const DebugLocation &location, const char *reason, T *value=nullptr)
void reset(const DebugLocation &location, const char *reason, T *value=nullptr)
bool operator==(const Y *other) const
RefCountedPtr(const RefCountedPtr &other)
bool operator==(std::nullptr_t) const
RefCountedPtr(const RefCountedPtr< Y > &other)
void reset(const DebugLocation &location, const char *reason, Y *value=nullptr)
bool operator==(const WeakRefCountedPtr< Y > &other) const
RefCountedPtr & operator=(RefCountedPtr &&other) noexcept
void reset(const DebugLocation &location, const char *reason, Y *value=nullptr)
void reset(T *value=nullptr)
bool operator==(const Y *other) const
WeakRefCountedPtr(const WeakRefCountedPtr< Y > &other)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:07