LLVM 24.0.0git
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 >:
[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 174 of file IntrusiveRefCntPtr.h.

Member Typedef Documentation

◆ element_type

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

Definition at line 178 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 181 of file IntrusiveRefCntPtr.h.

◆ IntrusiveRefCntPtr() [3/6]

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

Definition at line 182 of file IntrusiveRefCntPtr.h.

◆ IntrusiveRefCntPtr() [4/6]

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

Definition at line 183 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 187 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 193 of file IntrusiveRefCntPtr.h.

◆ ~IntrusiveRefCntPtr()

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

Definition at line 197 of file IntrusiveRefCntPtr.h.

Member Function Documentation

◆ get()

◆ operator bool()

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

Definition at line 207 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>
T * llvm::IntrusiveRefCntPtr< T >::operator-> ( ) const
inline

Definition at line 205 of file IntrusiveRefCntPtr.h.

◆ operator=()

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

Definition at line 199 of file IntrusiveRefCntPtr.h.

◆ reset()

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

Definition at line 215 of file IntrusiveRefCntPtr.h.

◆ resetWithoutRelease()

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

Definition at line 220 of file IntrusiveRefCntPtr.h.

◆ swap()

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

Definition at line 209 of file IntrusiveRefCntPtr.h.

◆ useCount()

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

Definition at line 222 of file IntrusiveRefCntPtr.h.

◆ IntrusiveRefCntPtr

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

Definition at line 237 of file IntrusiveRefCntPtr.h.


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