Made to Order Software Corporation Logo

odbcpp: odbcpp::smartptr< T > Class Template Reference

Ensure proper management of objects. More...

#include <object.h>

Collaboration diagram for odbcpp::smartptr< T >:

List of all members.

Public Member Functions

 operator bool () const
 Check whetehr the pointer is null (false) or not (true).

 operator T * ()
 Cast to the bare pointer.

 operator T * () const
 Cast to the bare pointer as a const pointer.

bool operator! () const
 Check whether the pointer is null (true) or not (false).

T * operator-> ()
 Return the bare pointer.

const T * operator-> () const
 Return the bare pointer as a const pointer.

smartptroperator= (const smartptr &ptr)
 Copy a smart pointer into this smart pointer.

smartptroperator= (T *obj)
 Set the smart pointer with another, same as reset(obj).

bool operator== (const smartptr &ptr) const
 Compare two smart pointers (what they point too).

bool operator== (const T &obj) const
 Compare this smart pointer with a bare reference.

bool operator== (const T *obj) const
 Compare this smart pointer with a bare pointer.

void reset (T *obj=0)
 Switch the bare pointer with another.

 smartptr (const smartptr< T > &ptr)
 Define a smart pointer as a copy of another, this has the effect of calling addref(); the object is not duplicated.

 smartptr (T *obj)
 Define a smart pointer with the specified bare pointer.

 smartptr ()
 Define an empty smart pointer.

 ~smartptr ()
 Relase a smart pointer (call release() on the object).

Private Attributes

T * f_ptr
 The bare pointer.


Detailed Description

template<class T>
class odbcpp::smartptr< T >

Ensure proper management of objects.

Definition at line 52 of file object.h.


Constructor & Destructor Documentation

template<class T>
odbcpp::smartptr< T >::smartptr (  )  [inline]

Define an empty smart pointer.

Definition at line 56 of file object.h.

template<class T>
odbcpp::smartptr< T >::smartptr ( T *  obj  )  [inline]

Define a smart pointer with the specified bare pointer.

Definition at line 60 of file object.h.

template<class T>
odbcpp::smartptr< T >::smartptr ( const smartptr< T > &  ptr  )  [inline]

Define a smart pointer as a copy of another, this has the effect of calling addref(); the object is not duplicated.

Definition at line 64 of file object.h.

template<class T>
odbcpp::smartptr< T >::~smartptr (  )  [inline]

Relase a smart pointer (call release() on the object).

Definition at line 67 of file object.h.


Member Function Documentation

template<class T>
odbcpp::smartptr< T >::operator bool (  )  const [inline]

Check whetehr the pointer is null (false) or not (true).

Definition at line 94 of file object.h.

template<class T>
odbcpp::smartptr< T >::operator T * (  )  [inline]

Cast to the bare pointer.

Definition at line 109 of file object.h.

References odbcpp::smartptr< T >::f_ptr.

template<class T>
odbcpp::smartptr< T >::operator T * (  )  const [inline]

Cast to the bare pointer as a const pointer.

Definition at line 106 of file object.h.

References odbcpp::smartptr< T >::f_ptr.

template<class T>
bool odbcpp::smartptr< T >::operator! (  )  const [inline]

Check whether the pointer is null (true) or not (false).

Definition at line 97 of file object.h.

template<class T>
T* odbcpp::smartptr< T >::operator-> (  )  [inline]

Return the bare pointer.

Definition at line 103 of file object.h.

template<class T>
const T* odbcpp::smartptr< T >::operator-> (  )  const [inline]

Return the bare pointer as a const pointer.

Definition at line 100 of file object.h.

template<class T>
smartptr& odbcpp::smartptr< T >::operator= ( const smartptr< T > &  ptr  )  [inline]

Copy a smart pointer into this smart pointer.

Definition at line 79 of file object.h.

template<class T>
smartptr& odbcpp::smartptr< T >::operator= ( T *  obj  )  [inline]

Set the smart pointer with another, same as reset(obj).

Definition at line 75 of file object.h.

template<class T>
bool odbcpp::smartptr< T >::operator== ( const smartptr< T > &  ptr  )  const [inline]

Compare two smart pointers (what they point too).

Definition at line 91 of file object.h.

template<class T>
bool odbcpp::smartptr< T >::operator== ( const T &  obj  )  const [inline]

Compare this smart pointer with a bare reference.

Definition at line 87 of file object.h.

template<class T>
bool odbcpp::smartptr< T >::operator== ( const T *  obj  )  const [inline]

Compare this smart pointer with a bare pointer.

Definition at line 83 of file object.h.

template<class T>
void odbcpp::smartptr< T >::reset ( T *  obj = 0  )  [inline]

Member Data Documentation


The documentation for this class was generated from the following file:
Generated on Mon Sep 19 12:52:28 2011 for odbcpp by  doxygen 1.6.3