Public Types | Public Member Functions | Private Attributes
vbl_shared_pointer< T > Class Template Reference

Non-intrusive smart pointers. More...

#include <vbl_shared_pointer.h>

List of all members.

Public Types

typedef T element_type
typedef vbl_shared_pointer< T > self
typedef vbl_shared_pointer_data data_t

Public Member Functions

 vbl_shared_pointer ()
 vbl_shared_pointer (T *p)
 vbl_shared_pointer (self const &that)
selfoperator= (self const &that)
 ~vbl_shared_pointer ()
 operator safe_bool () const
bool operator! () const
T const * operator-> () const
T * operator-> ()
T const & operator* () const
T & operator* ()
bool operator!= (self const &that) const
bool operator== (self const &that) const
bool operator< (self const &that) const
T * as_pointer () const
void up_ref () const
void down_ref () const

Private Attributes

 VCL_SAFE_BOOL_DEFINE
T * pointer
 pointer to object.
data_tcount_data

Detailed Description

template<class T>
class vbl_shared_pointer< T >

Non-intrusive smart pointers.

If your compiler supports member templates, these pointers will also work with base classes and derived classes, so that they work very much like raw pointers. If you do this, make sure your destructors are virtual (as you'd need to do for raw pointers anyway).

Definition at line 34 of file vbl_shared_pointer.h.


Member Typedef Documentation

template<class T>
typedef vbl_shared_pointer_data vbl_shared_pointer< T >::data_t

Definition at line 40 of file vbl_shared_pointer.h.

template<class T>
typedef T vbl_shared_pointer< T >::element_type

Definition at line 37 of file vbl_shared_pointer.h.

template<class T>
typedef vbl_shared_pointer<T> vbl_shared_pointer< T >::self

Definition at line 38 of file vbl_shared_pointer.h.


Constructor & Destructor Documentation

template<class T>
vbl_shared_pointer< T >::vbl_shared_pointer ( ) [inline]

Definition at line 42 of file vbl_shared_pointer.h.

template<class T>
vbl_shared_pointer< T >::vbl_shared_pointer ( T *  p) [inline, explicit]

Definition at line 45 of file vbl_shared_pointer.h.

template<class T>
vbl_shared_pointer< T >::vbl_shared_pointer ( self const &  that) [inline]

Definition at line 55 of file vbl_shared_pointer.h.

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

Definition at line 123 of file vbl_shared_pointer.h.


Member Function Documentation

template<class T>
T* vbl_shared_pointer< T >::as_pointer ( ) const [inline]

Definition at line 156 of file vbl_shared_pointer.h.

template<class T>
void vbl_shared_pointer< T >::down_ref ( ) const [inline]

Definition at line 163 of file vbl_shared_pointer.h.

template<class T>
vbl_shared_pointer< T >::operator safe_bool ( ) const [inline]

Definition at line 131 of file vbl_shared_pointer.h.

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

Definition at line 135 of file vbl_shared_pointer.h.

template<class T>
bool vbl_shared_pointer< T >::operator!= ( self const &  that) const [inline]

Definition at line 151 of file vbl_shared_pointer.h.

template<class T>
T const& vbl_shared_pointer< T >::operator* ( ) const [inline]

Definition at line 147 of file vbl_shared_pointer.h.

template<class T>
T& vbl_shared_pointer< T >::operator* ( ) [inline]

Definition at line 148 of file vbl_shared_pointer.h.

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

Definition at line 142 of file vbl_shared_pointer.h.

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

Definition at line 143 of file vbl_shared_pointer.h.

template<class T>
bool vbl_shared_pointer< T >::operator< ( self const &  that) const [inline]

Definition at line 153 of file vbl_shared_pointer.h.

template<class T>
self& vbl_shared_pointer< T >::operator= ( self const &  that) [inline]

Definition at line 115 of file vbl_shared_pointer.h.

template<class T>
bool vbl_shared_pointer< T >::operator== ( self const &  that) const [inline]

Definition at line 152 of file vbl_shared_pointer.h.

template<class T>
void vbl_shared_pointer< T >::up_ref ( ) const [inline]

Definition at line 159 of file vbl_shared_pointer.h.


Member Data Documentation

template<class T>
data_t* vbl_shared_pointer< T >::count_data [private]

Definition at line 171 of file vbl_shared_pointer.h.

template<class T>
T* vbl_shared_pointer< T >::pointer [private]

pointer to object.

Definition at line 170 of file vbl_shared_pointer.h.

template<class T>
vbl_shared_pointer< T >::VCL_SAFE_BOOL_DEFINE [private]

Definition at line 128 of file vbl_shared_pointer.h.


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