tesseract  3.04.01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 64 of file hashfn.h.

Constructor & Destructor Documentation

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

Definition at line 66 of file hashfn.h.

66 : ptr_(NULL) {}
template<class T>
SmartPtr< T >::SmartPtr ( T *  ptr)
inlineexplicit

Definition at line 67 of file hashfn.h.

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

Definition at line 68 of file hashfn.h.

68  {
69  delete ptr_;
70  }

Member Function Documentation

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

Definition at line 72 of file hashfn.h.

72  {
73  return ptr_;
74  }
template<class T>
T* SmartPtr< T >::operator-> ( ) const
inline

Definition at line 82 of file hashfn.h.

82  {
83  return ptr_;
84  }
template<class T>
bool SmartPtr< T >::operator== ( const T *  ptr) const
inline

Definition at line 79 of file hashfn.h.

79  {
80  return ptr_ == ptr;
81  }
template<class T>
void SmartPtr< T >::reset ( T *  ptr)
inline

Definition at line 75 of file hashfn.h.

75  {
76  if (ptr_ != NULL) delete ptr_;
77  ptr_ = ptr;
78  }

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