tesseract  3.05.02
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 54 of file hashfn.h.

Constructor & Destructor Documentation

◆ SmartPtr() [1/2]

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

Definition at line 56 of file hashfn.h.

56 : ptr_(NULL) {}

◆ SmartPtr() [2/2]

template<class T>
SmartPtr< T >::SmartPtr ( T *  ptr)
inlineexplicit

Definition at line 57 of file hashfn.h.

57 : ptr_(ptr) {}

◆ ~SmartPtr()

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

Definition at line 58 of file hashfn.h.

58  {
59  delete ptr_;
60  }

Member Function Documentation

◆ get()

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

Definition at line 62 of file hashfn.h.

62  {
63  return ptr_;
64  }

◆ operator->()

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

Definition at line 72 of file hashfn.h.

72  {
73  return ptr_;
74  }

◆ operator==()

template<class T>
bool SmartPtr< T >::operator== ( const T *  ptr) const
inline

Definition at line 69 of file hashfn.h.

69  {
70  return ptr_ == ptr;
71  }

◆ reset()

template<class T>
void SmartPtr< T >::reset ( T *  ptr)
inline

Definition at line 65 of file hashfn.h.

65  {
66  delete ptr_;
67  ptr_ = ptr;
68  }

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