LLVM API Documentation

llvm::OwningPtr< T > Class Template Reference

#include <OwningPtr.h>

Inheritance diagram for llvm::OwningPtr< T >:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 OwningPtr (T *P=0)
 ~OwningPtr ()
void reset (T *P=0)
Ttake ()
Toperator* () const
Toperator-> () const
Tget () const
 operator bool () const
bool operator! () 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 27 of file OwningPtr.h.


Constructor & Destructor Documentation

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

Definition at line 32 of file OwningPtr.h.

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

Definition at line 34 of file OwningPtr.h.


Member Function Documentation

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 41 of file OwningPtr.h.

Referenced by llvm::MemoryBuffer::getFile().

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 50 of file OwningPtr.h.

Referenced by llvm::MemoryBuffer::getFile(), llvm::ParseAssemblyFile(), and llvm::ParseAssemblyString().

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

Definition at line 56 of file OwningPtr.h.

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

Definition at line 61 of file OwningPtr.h.

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

Definition at line 62 of file OwningPtr.h.

Referenced by llvm::ParseAssemblyFile(), and llvm::ParseAssemblyString().

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

Definition at line 63 of file OwningPtr.h.

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

Definition at line 64 of file OwningPtr.h.

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

Definition at line 66 of file OwningPtr.h.

Referenced by llvm::swap().


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



This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.