Ensure proper management of objects. More...
#include <object.h>
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. | |
smartptr & | operator= (const smartptr &ptr) |
Copy a smart pointer into this smart pointer. | |
smartptr & | operator= (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. |
Ensure proper management of objects.
Definition at line 52 of file object.h.
odbcpp::smartptr< T >::smartptr | ( | ) | [inline] |
odbcpp::smartptr< T >::smartptr | ( | T * | obj | ) | [inline] |
odbcpp::smartptr< T >::smartptr | ( | const smartptr< T > & | ptr | ) | [inline] |
odbcpp::smartptr< T >::~smartptr | ( | ) | [inline] |
odbcpp::smartptr< T >::operator bool | ( | ) | const [inline] |
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.
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.
bool odbcpp::smartptr< T >::operator! | ( | ) | const [inline] |
T* odbcpp::smartptr< T >::operator-> | ( | ) | [inline] |
const T* odbcpp::smartptr< T >::operator-> | ( | ) | const [inline] |
smartptr& odbcpp::smartptr< T >::operator= | ( | const smartptr< T > & | ptr | ) | [inline] |
smartptr& odbcpp::smartptr< T >::operator= | ( | T * | obj | ) | [inline] |
bool odbcpp::smartptr< T >::operator== | ( | const smartptr< T > & | ptr | ) | const [inline] |
bool odbcpp::smartptr< T >::operator== | ( | const T & | obj | ) | const [inline] |
bool odbcpp::smartptr< T >::operator== | ( | const T * | obj | ) | const [inline] |
void odbcpp::smartptr< T >::reset | ( | T * | obj = 0 |
) | [inline] |
Switch the bare pointer with another.
Definition at line 71 of file object.h.
Referenced by odbcpp::dynamic_record::bind_impl(), odbcpp::record::bind_impl(), odbcpp::smartptr< environment >::operator=(), and odbcpp::record_base::unbind().
T* odbcpp::smartptr< T >::f_ptr [private] |
The bare pointer.
Definition at line 113 of file object.h.
Referenced by odbcpp::smartptr< environment >::operator bool(), odbcpp::smartptr< T >::operator T *(), odbcpp::smartptr< environment >::operator!(), odbcpp::smartptr< environment >::operator->(), odbcpp::smartptr< environment >::operator=(), odbcpp::smartptr< environment >::operator==(), odbcpp::smartptr< environment >::reset(), odbcpp::smartptr< environment >::smartptr(), and odbcpp::smartptr< environment >::~smartptr().