LLVM API Documentation

Public Member Functions
llvm::OwningPtr< T > Class Template Reference

#include <OwningPtr.h>

List of all members.

Public Member Functions

 OwningPtr (T *P=0)
 OwningPtr (OwningPtr &&Other)
OwningPtroperator= (OwningPtr &&Other)
 OwningPtr (std::unique_ptr< T > Other)
OwningPtroperator= (std::unique_ptr< T > Other)
 ~OwningPtr ()
void reset (T *P=0)
Ttake ()
Trelease ()
std::unique_ptr< Ttake_unique ()
Toperator* () const
Toperator-> () const
Tget () const
LLVM_EXPLICIT operator bool () const
bool operator! () const
bool isValid () const
void swap (OwningPtr &RHS)

Detailed Description

template<class T>
class llvm::OwningPtr< T >

OwningPtr smart pointer - OwningPtr mimics a built-in pointer except that it guarantees deletion of the object pointed to, either on destruction of the OwningPtr or via an explicit reset(). Once created, ownership of the pointee object can be taken away from OwningPtr by using the take method.

Definition at line 29 of file OwningPtr.h.


Constructor & Destructor Documentation

template<class T>
llvm::OwningPtr< T >::OwningPtr ( T P = 0) [inline, explicit]

Definition at line 34 of file OwningPtr.h.

References P.

template<class T>
llvm::OwningPtr< T >::OwningPtr ( OwningPtr< T > &&  Other) [inline]

Definition at line 36 of file OwningPtr.h.

template<class T>
llvm::OwningPtr< T >::OwningPtr ( std::unique_ptr< T Other) [inline]

Definition at line 43 of file OwningPtr.h.

template<class T>
llvm::OwningPtr< T >::~OwningPtr ( ) [inline]

Definition at line 54 of file OwningPtr.h.


Member Function Documentation

template<class T>
T* llvm::OwningPtr< T >::get ( ) const [inline]

Definition at line 86 of file OwningPtr.h.

template<class T>
bool llvm::OwningPtr< T >::isValid ( ) const [inline]

Definition at line 89 of file OwningPtr.h.

template<class T>
LLVM_EXPLICIT llvm::OwningPtr< T >::operator bool ( ) const [inline]

Definition at line 87 of file OwningPtr.h.

template<class T>
bool llvm::OwningPtr< T >::operator! ( ) const [inline]

Definition at line 88 of file OwningPtr.h.

template<class T>
T& llvm::OwningPtr< T >::operator* ( ) const [inline]

Definition at line 80 of file OwningPtr.h.

template<class T>
T* llvm::OwningPtr< T >::operator-> ( ) const [inline]

Definition at line 85 of file OwningPtr.h.

template<class T>
OwningPtr& llvm::OwningPtr< T >::operator= ( OwningPtr< T > &&  Other) [inline]

Definition at line 38 of file OwningPtr.h.

References llvm::OwningPtr< T >::reset().

template<class T>
OwningPtr& llvm::OwningPtr< T >::operator= ( std::unique_ptr< T Other) [inline]

Definition at line 45 of file OwningPtr.h.

References llvm::OwningPtr< T >::reset().

template<class T>
T* llvm::OwningPtr< T >::release ( ) [inline]

Definition at line 76 of file OwningPtr.h.

References llvm::OwningPtr< T >::take().

template<class T>
void llvm::OwningPtr< T >::reset ( T P = 0) [inline]

reset - Change the current pointee to the specified pointer. Note that calling this with any pointer (including a null pointer) deletes the current pointer.

Definition at line 61 of file OwningPtr.h.

References P.

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

template<class T>
void llvm::OwningPtr< T >::swap ( OwningPtr< T > &  RHS) [inline]

Definition at line 91 of file OwningPtr.h.

Referenced by llvm::swap().

template<class T>
T* llvm::OwningPtr< T >::take ( ) [inline]

take - Reset the owning pointer to null and return its pointer. This does not delete the pointer before returning it.

Definition at line 70 of file OwningPtr.h.

Referenced by llvm::OwningPtr< T >::release(), and llvm::OwningPtr< T >::take_unique().

template<class T>
std::unique_ptr<T> llvm::OwningPtr< T >::take_unique ( ) [inline]

Definition at line 78 of file OwningPtr.h.

References llvm::OwningPtr< T >::take().


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