LLVM 20.0.0git
Public Types | Public Member Functions | Friends | List of all members
llvm::IntrusiveRefCntPtr< T > Class Template Reference

A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCountedBase. More...

#include "llvm/ADT/IntrusiveRefCntPtr.h"

Inheritance diagram for llvm::IntrusiveRefCntPtr< T >:
Inheritance graph
[legend]

Public Types

using element_type = T
 

Public Member Functions

 IntrusiveRefCntPtr ()=default
 
 IntrusiveRefCntPtr (T *obj)
 
 IntrusiveRefCntPtr (const IntrusiveRefCntPtr &S)
 
 IntrusiveRefCntPtr (IntrusiveRefCntPtr &&S)
 
template<class X , std::enable_if_t< std::is_convertible< X *, T * >::value, bool > = true>
 IntrusiveRefCntPtr (IntrusiveRefCntPtr< X > S)
 
template<class X , std::enable_if_t< std::is_convertible< X *, T * >::value, bool > = true>
 IntrusiveRefCntPtr (std::unique_ptr< X > S)
 
 ~IntrusiveRefCntPtr ()
 
IntrusiveRefCntPtroperator= (IntrusiveRefCntPtr S)
 
Toperator* () const
 
Toperator-> () const
 
Tget () const
 
 operator bool () const
 
void swap (IntrusiveRefCntPtr &other)
 
void reset ()
 
void resetWithoutRelease ()
 
unsigned useCount () const
 

Friends

template<typename X >
class IntrusiveRefCntPtr
 

Detailed Description

template<typename T>
class llvm::IntrusiveRefCntPtr< T >

A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCountedBase.

This class increments its pointee's reference count when it is created, and decrements its refcount when it's destroyed (or is changed to point to a different object).

Definition at line 173 of file IntrusiveRefCntPtr.h.

Member Typedef Documentation

◆ element_type

template<typename T >
using llvm::IntrusiveRefCntPtr< T >::element_type = T

Definition at line 177 of file IntrusiveRefCntPtr.h.

Constructor & Destructor Documentation

◆ IntrusiveRefCntPtr() [1/6]

template<typename T >
llvm::IntrusiveRefCntPtr< T >::IntrusiveRefCntPtr ( )
explicitdefault

◆ IntrusiveRefCntPtr() [2/6]

template<typename T >
llvm::IntrusiveRefCntPtr< T >::IntrusiveRefCntPtr ( T obj)
inline

Definition at line 180 of file IntrusiveRefCntPtr.h.

◆ IntrusiveRefCntPtr() [3/6]

template<typename T >
llvm::IntrusiveRefCntPtr< T >::IntrusiveRefCntPtr ( const IntrusiveRefCntPtr< T > &  S)
inline

Definition at line 181 of file IntrusiveRefCntPtr.h.

◆ IntrusiveRefCntPtr() [4/6]

template<typename T >
llvm::IntrusiveRefCntPtr< T >::IntrusiveRefCntPtr ( IntrusiveRefCntPtr< T > &&  S)
inline

Definition at line 182 of file IntrusiveRefCntPtr.h.

◆ IntrusiveRefCntPtr() [5/6]

template<typename T >
template<class X , std::enable_if_t< std::is_convertible< X *, T * >::value, bool > = true>
llvm::IntrusiveRefCntPtr< T >::IntrusiveRefCntPtr ( IntrusiveRefCntPtr< X S)
inline

Definition at line 186 of file IntrusiveRefCntPtr.h.

◆ IntrusiveRefCntPtr() [6/6]

template<typename T >
template<class X , std::enable_if_t< std::is_convertible< X *, T * >::value, bool > = true>
llvm::IntrusiveRefCntPtr< T >::IntrusiveRefCntPtr ( std::unique_ptr< X S)
inline

Definition at line 192 of file IntrusiveRefCntPtr.h.

◆ ~IntrusiveRefCntPtr()

template<typename T >
llvm::IntrusiveRefCntPtr< T >::~IntrusiveRefCntPtr ( )
inline

Definition at line 196 of file IntrusiveRefCntPtr.h.

Member Function Documentation

◆ get()

template<typename T >
T * llvm::IntrusiveRefCntPtr< T >::get ( ) const
inline

◆ operator bool()

template<typename T >
llvm::IntrusiveRefCntPtr< T >::operator bool ( ) const
inlineexplicit

Definition at line 206 of file IntrusiveRefCntPtr.h.

◆ operator*()

template<typename T >
T & llvm::IntrusiveRefCntPtr< T >::operator* ( ) const
inline

Definition at line 203 of file IntrusiveRefCntPtr.h.

◆ operator->()

template<typename T >
T * llvm::IntrusiveRefCntPtr< T >::operator-> ( ) const
inline

Definition at line 204 of file IntrusiveRefCntPtr.h.

◆ operator=()

template<typename T >
IntrusiveRefCntPtr & llvm::IntrusiveRefCntPtr< T >::operator= ( IntrusiveRefCntPtr< T S)
inline

Definition at line 198 of file IntrusiveRefCntPtr.h.

References llvm::IntrusiveRefCntPtr< T >::swap().

◆ reset()

template<typename T >
void llvm::IntrusiveRefCntPtr< T >::reset ( )
inline

Definition at line 214 of file IntrusiveRefCntPtr.h.

◆ resetWithoutRelease()

template<typename T >
void llvm::IntrusiveRefCntPtr< T >::resetWithoutRelease ( )
inline

Definition at line 219 of file IntrusiveRefCntPtr.h.

◆ swap()

template<typename T >
void llvm::IntrusiveRefCntPtr< T >::swap ( IntrusiveRefCntPtr< T > &  other)
inline

Definition at line 208 of file IntrusiveRefCntPtr.h.

Referenced by llvm::IntrusiveRefCntPtr< T >::operator=().

◆ useCount()

template<typename T >
unsigned llvm::IntrusiveRefCntPtr< T >::useCount ( ) const
inline

Friends And Related Function Documentation

◆ IntrusiveRefCntPtr

template<typename T >
template<typename X >
friend class IntrusiveRefCntPtr
friend

Definition at line 236 of file IntrusiveRefCntPtr.h.


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