LLVM 19.0.0git
Public Member Functions | Protected Member Functions | List of all members
llvm::RefCountedBase< Derived > Class Template Reference

A CRTP mixin class that adds reference counting to a type. More...

#include "llvm/ADT/IntrusiveRefCntPtr.h"

Public Member Functions

unsigned UseCount () const
 
void Retain () const
 
void Release () const
 

Protected Member Functions

 RefCountedBase ()=default
 
 RefCountedBase (const RefCountedBase &)
 
RefCountedBaseoperator= (const RefCountedBase &)=delete
 
 ~RefCountedBase ()
 

Detailed Description

template<class Derived>
class llvm::RefCountedBase< Derived >

A CRTP mixin class that adds reference counting to a type.

The lifetime of an object which inherits from RefCountedBase is managed by calls to Release() and Retain(), which increment and decrement the object's refcount, respectively. When a Release() call decrements the refcount to 0, the object deletes itself.

Definition at line 76 of file IntrusiveRefCntPtr.h.

Constructor & Destructor Documentation

◆ RefCountedBase() [1/2]

template<class Derived >
llvm::RefCountedBase< Derived >::RefCountedBase ( )
protecteddefault

◆ RefCountedBase() [2/2]

template<class Derived >
llvm::RefCountedBase< Derived >::RefCountedBase ( const RefCountedBase< Derived > &  )
inlineprotected

Definition at line 81 of file IntrusiveRefCntPtr.h.

◆ ~RefCountedBase()

template<class Derived >
llvm::RefCountedBase< Derived >::~RefCountedBase ( )
inlineprotected

Definition at line 85 of file IntrusiveRefCntPtr.h.

References assert().

Member Function Documentation

◆ operator=()

template<class Derived >
RefCountedBase & llvm::RefCountedBase< Derived >::operator= ( const RefCountedBase< Derived > &  )
protecteddelete

◆ Release()

template<class Derived >
void llvm::RefCountedBase< Derived >::Release ( ) const
inline

Definition at line 100 of file IntrusiveRefCntPtr.h.

References assert().

◆ Retain()

template<class Derived >
void llvm::RefCountedBase< Derived >::Retain ( ) const
inline

Definition at line 98 of file IntrusiveRefCntPtr.h.

◆ UseCount()

template<class Derived >
unsigned llvm::RefCountedBase< Derived >::UseCount ( ) const
inline

Definition at line 96 of file IntrusiveRefCntPtr.h.


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