19 #ifndef GRPC_CORE_LIB_GPRPP_ORPHANABLE_H
20 #define GRPC_CORE_LIB_GPRPP_ORPHANABLE_H
66 template <
typename T,
typename Deleter = OrphanableDelete>
69 template <
typename T,
typename... Args>
75 template <
typename Child>
89 intptr_t initial_refcount = 1)
90 : refs_(initial_refcount, trace) {}
99 IncrementRefCount(location, reason);
115 void IncrementRefCount() { refs_.
Ref(); }
116 void IncrementRefCount(
const DebugLocation& location,
const char* reason) {
117 refs_.
Ref(location, reason);
Definition: debug_location.h:31
Definition: orphanable.h:76
void Unref()
Definition: orphanable.h:103
RefCountedPtr< Child > Ref(const DebugLocation &location, const char *reason) GRPC_MUST_USE_RESULT
Definition: orphanable.h:97
void Unref(const DebugLocation &location, const char *reason)
Definition: orphanable.h:108
RefCountedPtr< Child > Ref() GRPC_MUST_USE_RESULT
Definition: orphanable.h:93
InternallyRefCounted(const InternallyRefCounted &)=delete
~InternallyRefCounted() override=default
InternallyRefCounted & operator=(const InternallyRefCounted &)=delete
InternallyRefCounted(const char *trace=nullptr, intptr_t initial_refcount=1)
Definition: orphanable.h:88
Definition: orphanable.h:58
void operator()(T *p)
Definition: orphanable.h:61
Definition: orphanable.h:42
Orphanable & operator=(const Orphanable &)=delete
Orphanable()
Definition: orphanable.h:54
virtual ~Orphanable()
Definition: orphanable.h:55
Orphanable(const Orphanable &)=delete
Definition: ref_counted.h:47
void Ref(Value n=1)
Definition: ref_counted.h:71
bool Unref()
Definition: ref_counted.h:155
Definition: ref_counted_ptr.h:35
Round Robin Policy.
Definition: backend_metric.cc:26
OrphanablePtr< T > MakeOrphanable(Args &&... args)
Definition: orphanable.h:70
std::unique_ptr< T, Deleter > OrphanablePtr
Definition: orphanable.h:67