2 #ifndef vbl_smart_ptr_h_ 3 #define vbl_smart_ptr_h_ 22 # include <vcl_msvc_warnings.h> 123 operator bool ()
const {
return ptr_? true :
false; }
156 #if 0 // no longer needed 194 static void ref (T *p);
195 static void unref(T *p);
218 #define VBL_SMART_PTR_INSTANTIATE(T) \ 219 extern "please include vbl/vbl_smart_ptr.hxx instead" 221 #endif // vbl_smart_ptr_h_ bool operator==(T const *p, vbl_smart_ptr< T > const &a)
Comparison of pointer with smart-pointer (cannot be a member function).
bool operator!=(vbl_smart_ptr< T >const &p) const
Do a shallow inequality.
T & operator *() const
Dereferencing the pointer.
T * as_pointer() const
These methods all return the raw/dumb pointer.
vbl_smart_ptr(vbl_smart_ptr< T > const &p)
bool is_protected() const
Is this smart pointer responsible for the object being pointed to.
std::ostream & operator<<(std::ostream &, vbl_smart_ptr< T > const &)
void unprotect()
Used for breaking circular references (see above).
bool operator!=(T const *p) const
Do a shallow inequality.
T * ptr_
Pointer to object, or 0.
A templated smart pointer class.
bool operator<(vbl_smart_ptr< T >const &p) const
bool operator!=(T const *p, vbl_smart_ptr< T > const &a)
vbl_smart_ptr< T > & operator=(vbl_smart_ptr< T > const &r)
Assignment.
vbl_smart_ptr(vbl_smart_ptr< Y > const &p)
bool operator>(vbl_smart_ptr< T >const &p) const
bool operator<=(vbl_smart_ptr< T >const &p) const
bool operator==(T const *p) const
Do a shallow equality.
bool operator!() const
Inverse boolean value.
bool protected_
The protected flag says whether or not the object held will be unref()fed when the smart pointer goes...
bool operator>=(vbl_smart_ptr< T >const &p) const
T * ptr() const
These methods all return the raw/dumb pointer.
bool operator==(vbl_smart_ptr< T >const &p) const
Do a shallow equality.
T * operator ->() const
These methods all return the raw/dumb pointer.