All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SmartPtr< T > Class Template Reference

#include <hashfn.h>

Public Member Functions

 SmartPtr ()
 
 SmartPtr (T *ptr)
 
 ~SmartPtr ()
 
T * get () const
 
void reset (T *ptr)
 
bool operator== (const T *ptr) const
 
T * operator-> () const
 

Detailed Description

template<class T>
class SmartPtr< T >

Definition at line 59 of file hashfn.h.

Constructor & Destructor Documentation

template<class T>
SmartPtr< T >::SmartPtr ( )
inline

Definition at line 61 of file hashfn.h.

61 : ptr_(NULL) {}
#define NULL
Definition: host.h:144
template<class T>
SmartPtr< T >::SmartPtr ( T *  ptr)
inlineexplicit

Definition at line 62 of file hashfn.h.

62 : ptr_(ptr) {}
template<class T>
SmartPtr< T >::~SmartPtr ( )
inline

Definition at line 63 of file hashfn.h.

63  {
64  delete ptr_;
65  }

Member Function Documentation

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

Definition at line 67 of file hashfn.h.

67  {
68  return ptr_;
69  }
template<class T>
T* SmartPtr< T >::operator-> ( ) const
inline

Definition at line 77 of file hashfn.h.

77  {
78  return ptr_;
79  }
template<class T>
bool SmartPtr< T >::operator== ( const T *  ptr) const
inline

Definition at line 74 of file hashfn.h.

74  {
75  return ptr_ == ptr;
76  }
template<class T>
void SmartPtr< T >::reset ( T *  ptr)
inline

Definition at line 70 of file hashfn.h.

70  {
71  if (ptr_ != NULL) delete ptr_;
72  ptr_ = ptr;
73  }
#define NULL
Definition: host.h:144

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