19 #ifndef GRPC_CORE_LIB_GPRPP_ORPHANABLE_H
20 #define GRPC_CORE_LIB_GPRPP_ORPHANABLE_H
67 template <
typename T,
typename Deleter = OrphanableDelete>
70 template <
typename T,
typename... Args>
76 template <
typename Child>
91 template <
typename TraceFlagT = TraceFlag>
93 intptr_t initial_refcount = 1)
94 : refs_(initial_refcount, trace_flag) {}
103 IncrementRefCount(location, reason);
119 void IncrementRefCount() { refs_.
Ref(); }
120 void IncrementRefCount(
const DebugLocation& location,
const char* reason) {
121 refs_.
Ref(location, reason);
Definition: debug_location.h:31
Definition: orphanable.h:77
void Unref()
Definition: orphanable.h:107
InternallyRefCounted(TraceFlagT *trace_flag=nullptr, intptr_t initial_refcount=1)
Definition: orphanable.h:92
RefCountedPtr< Child > Ref(const DebugLocation &location, const char *reason) GRPC_MUST_USE_RESULT
Definition: orphanable.h:101
void Unref(const DebugLocation &location, const char *reason)
Definition: orphanable.h:112
virtual ~InternallyRefCounted()=default
RefCountedPtr< Child > Ref() GRPC_MUST_USE_RESULT
Definition: orphanable.h:97
InternallyRefCounted(const InternallyRefCounted &)=delete
InternallyRefCounted & operator=(const InternallyRefCounted &)=delete
Definition: orphanable.h:59
void operator()(T *p)
Definition: orphanable.h:62
Definition: orphanable.h:43
Orphanable & operator=(const Orphanable &)=delete
Orphanable()
Definition: orphanable.h:55
virtual ~Orphanable()
Definition: orphanable.h:56
Orphanable(const Orphanable &)=delete
Definition: ref_counted.h:62
void Ref(Value n=1)
Definition: ref_counted.h:88
bool Unref()
Definition: ref_counted.h:174
Definition: ref_counted_ptr.h:35
Internal thread interface.
Definition: backoff.h:26
OrphanablePtr< T > MakeOrphanable(Args &&... args)
Definition: orphanable.h:71
std::unique_ptr< T, Deleter > OrphanablePtr
Definition: orphanable.h:68