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

IntrusiveRefCntPtr - A template class that implements a "smart pointer" that assumes the wrapped object has a reference count associated with it that can be managed via calls to IntrusivePtrAddRef/IntrusivePtrRelease. More...

#include <IntrusiveRefCntPtr.h>

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

Public Types

typedef T element_type
 

Public Member Functions

 IntrusiveRefCntPtr ()
 
 IntrusiveRefCntPtr (T *obj)
 
 IntrusiveRefCntPtr (const IntrusiveRefCntPtr &S)
 
 IntrusiveRefCntPtr (IntrusiveRefCntPtr &&S)
 
template<class X >
 IntrusiveRefCntPtr (IntrusiveRefCntPtr< X > &&S)
 
template<class X >
 IntrusiveRefCntPtr (const IntrusiveRefCntPtr< X > &S)
 
IntrusiveRefCntPtroperator= (IntrusiveRefCntPtr S)
 
 ~IntrusiveRefCntPtr ()
 
Toperator* () const
 
Toperator-> () const
 
Tget () const
 
 operator bool () const
 
void swap (IntrusiveRefCntPtr &other)
 
void reset ()
 
void resetWithoutRelease ()
 

Friends

template<typename X >
class IntrusiveRefCntPtr
 

Detailed Description

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

IntrusiveRefCntPtr - A template class that implements a "smart pointer" that assumes the wrapped object has a reference count associated with it that can be managed via calls to IntrusivePtrAddRef/IntrusivePtrRelease.

The smart pointers manage reference counts via the RAII idiom: upon creation of smart pointer the reference count of the wrapped object is incremented and upon destruction of the smart pointer the reference count is decremented. This class also safely handles wrapping NULL pointers.

Reference counting is implemented via calls to Obj->Retain()/Obj->Release(). Release() is required to destroy the object when the reference count reaches zero. Inheriting from RefCountedBase/RefCountedBaseVPTR takes care of this automatically.

Definition at line 31 of file IntrusiveRefCntPtr.h.

Member Typedef Documentation

template<class T>
typedef T llvm::IntrusiveRefCntPtr< T >::element_type

Definition at line 139 of file IntrusiveRefCntPtr.h.

Constructor & Destructor Documentation

template<class T>
llvm::IntrusiveRefCntPtr< T >::IntrusiveRefCntPtr ( )
inlineexplicit

Definition at line 141 of file IntrusiveRefCntPtr.h.

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

Definition at line 143 of file IntrusiveRefCntPtr.h.

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

Definition at line 147 of file IntrusiveRefCntPtr.h.

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

Definition at line 151 of file IntrusiveRefCntPtr.h.

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

Definition at line 156 of file IntrusiveRefCntPtr.h.

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

Definition at line 161 of file IntrusiveRefCntPtr.h.

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

Definition at line 171 of file IntrusiveRefCntPtr.h.

Member Function Documentation

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

Definition at line 177 of file IntrusiveRefCntPtr.h.

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

Definition at line 179 of file IntrusiveRefCntPtr.h.

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

Definition at line 173 of file IntrusiveRefCntPtr.h.

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

Definition at line 175 of file IntrusiveRefCntPtr.h.

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

Definition at line 166 of file IntrusiveRefCntPtr.h.

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

Definition at line 192 of file IntrusiveRefCntPtr.h.

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

Friends And Related Function Documentation

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

Definition at line 201 of file IntrusiveRefCntPtr.h.


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