Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
grpc_core::DualRefCounted< Child > Class Template Reference

#include <dual_ref_counted.h>

Inheritance diagram for grpc_core::DualRefCounted< Child >:
Inheritance graph
[legend]

Public Member Functions

 DualRefCounted (const DualRefCounted &)=delete
 
DualRefCountedoperator= (const DualRefCounted &)=delete
 
RefCountedPtr< Child > Ref () GRPC_MUST_USE_RESULT
 
RefCountedPtr< Child > Ref (const DebugLocation &location, const char *reason) GRPC_MUST_USE_RESULT
 
RefCountedPtr< Child > RefIfNonZero () GRPC_MUST_USE_RESULT
 
RefCountedPtr< Child > RefIfNonZero (const DebugLocation &location, const char *reason) GRPC_MUST_USE_RESULT
 
void Unref ()
 
void Unref (const DebugLocation &location, const char *reason)
 
WeakRefCountedPtr< Child > WeakRef () GRPC_MUST_USE_RESULT
 
WeakRefCountedPtr< Child > WeakRef (const DebugLocation &location, const char *reason) GRPC_MUST_USE_RESULT
 
void WeakUnref ()
 
void WeakUnref (const DebugLocation &location, const char *reason)
 
 ~DualRefCounted () override=default
 
- Public Member Functions inherited from grpc_core::Orphanable
Orphanableoperator= (const Orphanable &)=delete
 
virtual void Orphan ()=0
 
 Orphanable (const Orphanable &)=delete
 

Protected Member Functions

 DualRefCounted (const char *trace=nullptr, int32_t initial_refcount=1)
 
- Protected Member Functions inherited from grpc_core::Orphanable
 Orphanable ()
 
virtual ~Orphanable ()
 

Private Member Functions

void IncrementRefCount ()
 
void IncrementRefCount (const DebugLocation &location, const char *reason)
 
void IncrementWeakRefCount ()
 
void IncrementWeakRefCount (const DebugLocation &location, const char *reason)
 

Static Private Member Functions

static uint32_t GetStrongRefs (uint64_t ref_pair)
 
static uint32_t GetWeakRefs (uint64_t ref_pair)
 
static uint64_t MakeRefPair (uint32_t strong, uint32_t weak)
 

Private Attributes

std::atomic< uint64_trefs_ {0}
 
const char * trace_
 

Friends

template<typename T >
class RefCountedPtr
 
template<typename T >
class WeakRefCountedPtr
 

Detailed Description

template<typename Child>
class grpc_core::DualRefCounted< Child >

Definition at line 48 of file dual_ref_counted.h.

Constructor & Destructor Documentation

◆ ~DualRefCounted()

template<typename Child >
grpc_core::DualRefCounted< Child >::~DualRefCounted ( )
overridedefault

◆ DualRefCounted() [1/2]

template<typename Child >
grpc_core::DualRefCounted< Child >::DualRefCounted ( const DualRefCounted< Child > &  )
delete

◆ DualRefCounted() [2/2]

template<typename Child >
grpc_core::DualRefCounted< Child >::DualRefCounted ( const char *  trace = nullptr,
int32_t  initial_refcount = 1 
)
inlineexplicitprotected

Definition at line 216 of file dual_ref_counted.h.

Member Function Documentation

◆ GetStrongRefs()

template<typename Child >
static uint32_t grpc_core::DualRefCounted< Child >::GetStrongRefs ( uint64_t  ref_pair)
inlinestaticprivate

Definition at line 243 of file dual_ref_counted.h.

◆ GetWeakRefs()

template<typename Child >
static uint32_t grpc_core::DualRefCounted< Child >::GetWeakRefs ( uint64_t  ref_pair)
inlinestaticprivate

Definition at line 246 of file dual_ref_counted.h.

◆ IncrementRefCount() [1/2]

template<typename Child >
void grpc_core::DualRefCounted< Child >::IncrementRefCount ( )
inlineprivate

Definition at line 250 of file dual_ref_counted.h.

◆ IncrementRefCount() [2/2]

template<typename Child >
void grpc_core::DualRefCounted< Child >::IncrementRefCount ( const DebugLocation location,
const char *  reason 
)
inlineprivate

Definition at line 265 of file dual_ref_counted.h.

◆ IncrementWeakRefCount() [1/2]

template<typename Child >
void grpc_core::DualRefCounted< Child >::IncrementWeakRefCount ( )
inlineprivate

Definition at line 285 of file dual_ref_counted.h.

◆ IncrementWeakRefCount() [2/2]

template<typename Child >
void grpc_core::DualRefCounted< Child >::IncrementWeakRefCount ( const DebugLocation location,
const char *  reason 
)
inlineprivate

Definition at line 299 of file dual_ref_counted.h.

◆ MakeRefPair()

template<typename Child >
static uint64_t grpc_core::DualRefCounted< Child >::MakeRefPair ( uint32_t  strong,
uint32_t  weak 
)
inlinestaticprivate

Definition at line 240 of file dual_ref_counted.h.

◆ operator=()

template<typename Child >
DualRefCounted& grpc_core::DualRefCounted< Child >::operator= ( const DualRefCounted< Child > &  )
delete

◆ Ref() [1/2]

template<typename Child >
RefCountedPtr<Child> grpc_core::DualRefCounted< Child >::Ref ( )
inline

Definition at line 52 of file dual_ref_counted.h.

◆ Ref() [2/2]

template<typename Child >
RefCountedPtr<Child> grpc_core::DualRefCounted< Child >::Ref ( const DebugLocation location,
const char *  reason 
)
inline

Definition at line 57 of file dual_ref_counted.h.

◆ RefIfNonZero() [1/2]

template<typename Child >
RefCountedPtr<Child> grpc_core::DualRefCounted< Child >::RefIfNonZero ( )
inline

Definition at line 106 of file dual_ref_counted.h.

◆ RefIfNonZero() [2/2]

template<typename Child >
RefCountedPtr<Child> grpc_core::DualRefCounted< Child >::RefIfNonZero ( const DebugLocation location,
const char *  reason 
)
inline

Definition at line 124 of file dual_ref_counted.h.

◆ Unref() [1/2]

template<typename Child >
void grpc_core::DualRefCounted< Child >::Unref ( )
inline

Definition at line 63 of file dual_ref_counted.h.

◆ Unref() [2/2]

template<typename Child >
void grpc_core::DualRefCounted< Child >::Unref ( const DebugLocation location,
const char *  reason 
)
inline

Definition at line 82 of file dual_ref_counted.h.

◆ WeakRef() [1/2]

template<typename Child >
WeakRefCountedPtr<Child> grpc_core::DualRefCounted< Child >::WeakRef ( )
inline

Definition at line 149 of file dual_ref_counted.h.

◆ WeakRef() [2/2]

template<typename Child >
WeakRefCountedPtr<Child> grpc_core::DualRefCounted< Child >::WeakRef ( const DebugLocation location,
const char *  reason 
)
inline

Definition at line 154 of file dual_ref_counted.h.

◆ WeakUnref() [1/2]

template<typename Child >
void grpc_core::DualRefCounted< Child >::WeakUnref ( )
inline

Definition at line 160 of file dual_ref_counted.h.

◆ WeakUnref() [2/2]

template<typename Child >
void grpc_core::DualRefCounted< Child >::WeakUnref ( const DebugLocation location,
const char *  reason 
)
inline

Definition at line 182 of file dual_ref_counted.h.

Friends And Related Function Documentation

◆ RefCountedPtr

template<typename Child >
template<typename T >
friend class RefCountedPtr
friend

Definition at line 234 of file dual_ref_counted.h.

◆ WeakRefCountedPtr

template<typename Child >
template<typename T >
friend class WeakRefCountedPtr
friend

Definition at line 237 of file dual_ref_counted.h.

Member Data Documentation

◆ refs_

template<typename Child >
std::atomic<uint64_t> grpc_core::DualRefCounted< Child >::refs_ {0}
private

Definition at line 322 of file dual_ref_counted.h.

◆ trace_

template<typename Child >
const char* grpc_core::DualRefCounted< Child >::trace_
private

Definition at line 320 of file dual_ref_counted.h.


The documentation for this class was generated from the following file:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:36