llvm::OwningPtr< T > Class Template Reference

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(). More...

#include <OwningPtr.h>

List of all members.

Public Member Functions

 OwningPtr (T *P=0)
 ~OwningPtr ()
void reset (T *P=0)
 reset - Change the current pointee to the specified pointer.
T * take ()
 take - Reset the owning pointer to null and return its pointer.
T & operator* () const
T * operator-> () const
T * get () const
 operator bool () const
bool operator! () const
void swap (OwningPtr &RHS)

Private Member Functions

 OwningPtr (OwningPtr const &)
OwningPtroperator= (OwningPtr const &)

Private Attributes

T * Ptr

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.


Constructor & Destructor Documentation

template<class T>
llvm::OwningPtr< T >::OwningPtr ( OwningPtr< T > const &   )  [private]
template<class T>
llvm::OwningPtr< T >::OwningPtr ( T *  P = 0  )  [inline, explicit]
template<class T>
llvm::OwningPtr< T >::~OwningPtr (  )  [inline]

Member Function Documentation

template<class T>
T* llvm::OwningPtr< T >::get (  )  const [inline]
template<class T>
llvm::OwningPtr< T >::operator bool (  )  const [inline]
template<class T>
bool llvm::OwningPtr< T >::operator! (  )  const [inline]
template<class T>
T& llvm::OwningPtr< T >::operator* (  )  const [inline]
template<class T>
T* llvm::OwningPtr< T >::operator-> (  )  const [inline]
template<class T>
OwningPtr& llvm::OwningPtr< T >::operator= ( OwningPtr< T > const &   )  [private]
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.

template<class T>
void llvm::OwningPtr< T >::swap ( OwningPtr< T > &  RHS  )  [inline]
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.


Member Data Documentation

template<class T>
T* llvm::OwningPtr< T >::Ptr [private]

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

Generated on 2 Nov 2013 for Galois by  doxygen 1.6.1